Separate functions for 3 sections of panel
This commit is contained in:
parent
dae3ff1b11
commit
247c4bbd8e
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
19
nbcl/panel/panel_section_center.nbcl
Normal file
19
nbcl/panel/panel_section_center.nbcl
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
19
nbcl/panel/panel_section_left.nbcl
Normal file
19
nbcl/panel/panel_section_left.nbcl
Normal 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"
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user