Separate functions for 3 sections of panel

This commit is contained in:
Candifloss 2026-09-07 11:51:33 +05:30
parent dae3ff1b11
commit 247c4bbd8e
3 changed files with 45 additions and 1 deletions

View File

@ -1,4 +1,6 @@
# 3 Sections of the panel
import "nbcl/panel/panel_section_left.nbcl" as panel_section_left { * }
import "nbcl/panel/panel_section_center.nbcl" as panel_section_center { * }
import "nbcl/panel/panel_section_right.nbcl" as panel_section_right { * }
component PanelSection (section_side, widg_align) {
@ -10,7 +12,11 @@ component PanelSection (section_side, widg_align) {
width = config.panel_width/3
space_evenly = true
panel_section_right.panel_right()
match section_side {
"left" => panel_section_left.panel_left()
"center" => panel_section_center.panel_center()
"right" => panel_section_right.panel_right()
}
}
}

View File

@ -0,0 +1,19 @@
# Middle part of the top bar
fn panel_center() {
Box {
space_evenly = false
halign = "center"
# Display current date
DateTimeWidg "paneldatewidg" {
widgname = "paneldatewidg"
widgtextvar = "date_ddM"
}
# Display current time
DateTimeWidg "paneltimewidg" {
widgname = "paneltimewidg"
widgtextvar = "time_hhmm"
}
}
}

View File

@ -0,0 +1,19 @@
# Left-hand side of the top bar
fn panel_left() {
Box {
space_evenly = false
halign = "start"
# Display current date
DateTimeWidg "paneldatewidg" {
widgname = "paneldatewidg"
widgtextvar = "date_ddM"
}
# Display current time
DateTimeWidg "paneltimewidg" {
widgname = "paneltimewidg"
widgtextvar = "time_hhmm"
}
}
}