1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-08-17 14:51:04 +02:00

feat: fully implement orientation/justify options

Adds `orientation` and `justify` options to all modules and custom
widgets where it makes sense to do so.

Any modules without support document this. Widgets fully document the
options inline where present for now.

Resolves #296
This commit is contained in:
Jake Stanger 2025-03-22 19:19:47 +00:00
parent 0855039bce
commit c20feb77b7
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
29 changed files with 317 additions and 161 deletions

View file

@ -1,6 +1,6 @@
use super::open_state::OpenState;
use crate::gtk_helpers::IronbarGtkExt;
use crate::image::new_icon_button;
use crate::image::IconButton;
use crate::modules::workspaces::WorkspaceItemContext;
use crate::try_send;
use gtk::Button as GtkButton;
@ -8,7 +8,7 @@ use gtk::prelude::*;
#[derive(Debug, Clone)]
pub struct Button {
button: GtkButton,
button: IconButton,
workspace_id: i64,
}
@ -16,7 +16,7 @@ impl Button {
pub fn new(id: i64, name: &str, open_state: OpenState, context: &WorkspaceItemContext) -> Self {
let label = context.name_map.get(name).map_or(name, String::as_str);
let button = new_icon_button(label, &context.icon_theme, context.icon_size);
let button = IconButton::new(label, &context.icon_theme, context.icon_size);
button.set_widget_name(name);
button.add_class("item");