Cap tab names (#26)

* implement capped category names

* adhere to clippy

* upd preview
This commit is contained in:
nyx
2024-10-14 14:38:46 -04:00
committed by GitHub
parent 0107ba3b08
commit 6eb67b3733
2 changed files with 23 additions and 19 deletions

BIN
.github/preview.png vendored

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 42 KiB

View File

@@ -138,30 +138,34 @@ impl ConfigGUI {
}
});
for category in &[
"general",
"decoration",
"animations",
"input",
"gestures",
"misc",
"binds",
"group",
"layouts",
"xwayland",
"opengl",
"render",
"cursor",
"debug",
] {
let categories = [
("General", "general"),
("Decoration", "decoration"),
("Animations", "animations"),
("Input", "input"),
("Gestures", "gestures"),
("Misc", "misc"),
("Binds", "binds"),
("Group", "group"),
("Layouts", "layouts"),
("XWayland", "xwayland"),
("OpenGL", "opengl"),
("Render", "render"),
("Cursor", "cursor"),
("Debug", "debug"),
];
for (display_name, category) in &categories {
let widget = ConfigWidget::new(category);
self.stack
.add_titled(&widget.scrolled_window, Some(category), category);
.add_titled(&widget.scrolled_window, Some(category), display_name);
self.config_widgets.insert(category.to_string(), widget);
}
for (category, widget) in &self.config_widgets {
widget.load_config(config, category, self.changed_options.clone());
for (_, category) in &categories {
if let Some(widget) = self.config_widgets.get(*category) {
widget.load_config(config, category, self.changed_options.clone());
}
}
}