This commit is contained in:
2026-09-12 21:50:09 +01:00
parent b20e03def7
commit b81eb967ee
17 changed files with 468 additions and 14 deletions
+7 -1
View File
@@ -11,6 +11,8 @@ pub(crate) struct Bar {
pub(crate) active_popup: Option<String>,
/// Module registry keyed by stable module id.
pub(crate) modules: BTreeMap<&'static str, Box<dyn BarModule>>,
/// Left, Middle, Right ; Module Order
pub(crate) order: (Vec<String>, Vec<String>, Vec<String>),
/// Surface id of the open popup.
pub(crate) popup_id: Option<window::Id>,
/// Fan-out routing table: module id -> services it wants.
@@ -21,7 +23,10 @@ pub(crate) struct Bar {
}
impl Bar {
pub(crate) fn new(modules_config_table: &Table) -> Self {
pub(crate) fn new(
modules_config_table: &Table,
modules_order: (Vec<String>, Vec<String>, Vec<String>),
) -> Self {
// Registry owns construction: adding a module never edits this file.
let modules: BTreeMap<&'static str, Box<dyn BarModule>> =
modules::all(modules_config_table.clone())
@@ -41,6 +46,7 @@ impl Bar {
Self {
active_popup: None,
modules,
order: modules_order,
popup_id: None,
routes,
inputs,
+5 -9
View File
@@ -1,4 +1,4 @@
use iced::widget::{column, container, text};
use iced::widget::{container, row, text};
use iced::{window, Alignment, Element, Length, Theme};
use crate::app::Bar;
@@ -24,14 +24,10 @@ fn bar_view(bar: &Bar) -> Element<'_, Message> {
}
}
container(
column(children)
.width(Length::Fill)
.align_x(Alignment::Center),
)
.padding(8)
.align_x(Alignment::Center)
.into()
container(row(children).width(Length::Fill).align_y(Alignment::Center))
.padding(8)
.align_x(Alignment::Center)
.into()
}
pub(crate) fn style(_bar: &Bar, theme: &Theme) -> iced::theme::Style {