From 75339f07ed164fa94838036a604a1dcb6d53564c Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Sat, 15 Oct 2022 16:35:31 +0100 Subject: [PATCH] fix: vertical bars ignoring height config option --- src/bar.rs | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/bar.rs b/src/bar.rs index 717315c..7ef4078 100644 --- a/src/bar.rs +++ b/src/bar.rs @@ -30,26 +30,33 @@ pub fn create_bar( setup_layer_shell(&win, monitor, config.position, config.anchor_to_edges); + let orientation = config.position.get_orientation(); + let content = gtk::Box::builder() - .orientation(config.position.get_orientation()) + .orientation(orientation) .spacing(0) .hexpand(false) - .height_request(config.height) - .name("bar") - .build(); + .name("bar"); + + let content = if orientation == Orientation::Horizontal { + content.height_request(config.height) + } else { + content.width_request(config.height) + } + .build(); let start = gtk::Box::builder() - .orientation(config.position.get_orientation()) + .orientation(orientation) .spacing(0) .name("start") .build(); let center = gtk::Box::builder() - .orientation(config.position.get_orientation()) + .orientation(orientation) .spacing(0) .name("center") .build(); let end = gtk::Box::builder() - .orientation(config.position.get_orientation()) + .orientation(orientation) .spacing(0) .name("end") .build();