Skip to content

Commit

Permalink
Enhance UI consistency and functionality in NetworkFuse
Browse files Browse the repository at this point in the history
- Add `hexpand` property to various Gtk.Box elements for better layout management.
- Replace Gtk.Button with He.Button for settings buttons, adding `is_disclosure` property.
- Update VPN section to use a Gtk.Box with a settings button instead of a label.
  • Loading branch information
lainsce committed Sep 12, 2024
1 parent 71719c6 commit bef5050
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions fuses/network/NetworkFuse.vala
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,16 @@ public class Network.NetworkFuse : Fusebox.Fuse {
wired_block.title = (_("Wired"));

var wired_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 12) {
hexpand = true,
halign = Gtk.Align.END
};
wired_switch = new He.Switch() {
valign = Gtk.Align.CENTER
};

var settings_button = new Gtk.Button.from_icon_name("emblem-system-symbolic");
var settings_button = new He.Button ("emblem-system-symbolic", "") {
is_disclosure = true
};
settings_button.add_css_class("circular");

wired_box.append(wired_switch);
Expand All @@ -88,20 +91,29 @@ public class Network.NetworkFuse : Fusebox.Fuse {
private void create_vpn_section() {
vpn_block = new He.MiniContentBlock();
vpn_block.title = (_("VPN"));
vpn_block.subtitle = (_("Not set up"));

var vpn_label = new Gtk.Label(_("Not set up")) {
var settings_button = new He.Button ("emblem-system-symbolic", "") {
is_disclosure = true
};
settings_button.add_css_class("circular");

var vpn_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 12) {
hexpand = true,
halign = Gtk.Align.END
};

vpn_block.widget = vpn_label;
vpn_box.append(settings_button);

vpn_block.widget = vpn_box;
}

private void create_proxy_section() {
proxy_block = new He.MiniContentBlock();
proxy_block.title = (_("Proxy"));

var proxy_box = new Gtk.Box(Gtk.Orientation.HORIZONTAL, 12) {
hexpand = true,
halign = Gtk.Align.END
};
proxy_switch = new He.Switch() {
Expand Down

0 comments on commit bef5050

Please sign in to comment.