Skip to content

Commit

Permalink
cleanup spacing between layout children widgets
Browse files Browse the repository at this point in the history
This will ensure spacing between widgets is consistent regardless of layout and we don't have to do anything strange with margin start / ends
  • Loading branch information
JoshStrobl committed Oct 16, 2023
1 parent 7b0a890 commit 3c6ea9b
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions src/panel/applets/keyboard-layout/KeyboardLayoutApplet.vala
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ public class KeyboardLayoutApplet : Budgie.Applet {
get_style_context().add_class("keyboard-indicator");

/* Layout */
layout = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 0);
layout = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 4);
widget.add(layout);

/* Image */
Expand Down Expand Up @@ -302,17 +302,7 @@ public class KeyboardLayoutApplet : Budgie.Applet {
}

public override void panel_position_changed(Budgie.PanelPosition position) {
Gtk.Orientation orient = Gtk.Orientation.HORIZONTAL;
if (position == Budgie.PanelPosition.LEFT || position == Budgie.PanelPosition.RIGHT) {
orient = Gtk.Orientation.VERTICAL;
img.set_margin_end(5);
label_stack.set_margin_start(2);
}
else {
img.set_margin_end(0);
label_stack.set_margin_start(4);
}
this.layout.set_orientation(orient);
this.layout.set_orientation(position == Budgie.PanelPosition.LEFT || position == Budgie.PanelPosition.RIGHT ? Gtk.Orientation.VERTICAL : Gtk.Orientation.HORIZONTAL);
on_settings_changed("show-icon");
}

Expand Down Expand Up @@ -390,12 +380,6 @@ public class KeyboardLayoutApplet : Budgie.Applet {
}
}

/*
* Reset InputSource list and produce something consumable by xkb
*
* TODO: Share code between WM and plugin in private Budgie library in
* the C rewrite, this is a joke now.
*/
void update_sources() {
sources = null;
sources = new Array<InputSource>();
Expand Down

0 comments on commit 3c6ea9b

Please sign in to comment.