Skip to content

Commit

Permalink
headers, rm airplane
Browse files Browse the repository at this point in the history
  • Loading branch information
danirabbit committed Mar 28, 2024
1 parent a8066d5 commit 56d0f8b
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 29 deletions.
32 changes: 6 additions & 26 deletions src/MainView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public class Network.MainView : Gtk.Box {
construct {
network_interface = new GLib.List<Widgets.Page> ();

virtual_header = new Granite.HeaderLabel (_("Virtual"));
devices_header = new Granite.HeaderLabel (_("Devices"));
// virtual_header = new Granite.HeaderLabel (_("Virtual"));
// devices_header = new Granite.HeaderLabel (_("Devices"));

var proxy = new Widgets.DeviceItem (_("Proxy"), "preferences-system-network") {
item_type = VIRTUAL
Expand All @@ -58,8 +58,6 @@ public class Network.MainView : Gtk.Box {
};
device_list.set_sort_func (sort_func);
device_list.set_header_func (update_headers);
device_list.append (proxy);
device_list.append (vpn);

var label = new Gtk.Label (_("Airplane Mode"));

Expand All @@ -82,11 +80,13 @@ public class Network.MainView : Gtk.Box {
content = new Gtk.Stack () {
hexpand = true
};
content.add_named (airplane_mode, "airplane-mode-info");
// content.add_named (airplane_mode, "airplane-mode-info");
content.add_child (vpn_page);
content.add_child (proxy.page);

var sidebar = new Switchboard.SettingsSidebar (content);
var sidebar = new Switchboard.SettingsSidebar (content) {
show_title_buttons = true
};

var paned = new Gtk.Paned (HORIZONTAL) {
start_child = sidebar,
Expand All @@ -98,15 +98,6 @@ public class Network.MainView : Gtk.Box {

append (paned);

device_list.row_selected.connect ((row) => {
row.activate ();
});

device_list.row_activated.connect ((row) => {
var page = ((Widgets.DeviceItem)row).page;
content.visible_child = page;
});

unowned var network_manager = NetworkManager.get_default ();
unowned var nm_client = network_manager.client;
nm_client.connection_added.connect (connection_added_cb);
Expand Down Expand Up @@ -354,15 +345,4 @@ public class Network.MainView : Gtk.Box {
row.set_header (null);
}
}

// Workaround to set styles
private class Sidebar : Gtk.Box {
class construct {
set_css_name ("settingssidebar");
}

construct {
add_css_class (Granite.STYLE_CLASS_SIDEBAR);
}
}
}
1 change: 1 addition & 0 deletions src/Views/EthernetPage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ namespace Network.Widgets {
Object (
activatable: true,
device: device,
header: _("Devices"),
icon: new ThemedIcon ("network-wired")
);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Views/HotspotPage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
root_iface: root_iface,
description: _("Enabling Hotspot will disconnect from any connected wireless networks. You will not be able to connect to a wireless network while Hotspot is active."),
device: root_iface.device,
icon: new ThemedIcon ("network-wireless-hotspot")
icon: new ThemedIcon ("network-wireless-hotspot"),
header: _("Virtual")
);
}

Expand Down
1 change: 1 addition & 0 deletions src/Views/ModemPage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ namespace Network.Widgets {
Object (
activatable: true,
device: device,
header: _("Devices"),
icon: new ThemedIcon ("network-cellular")
);

Expand Down
1 change: 1 addition & 0 deletions src/Views/ProxyPage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ namespace Network.Widgets {
activatable: true,
title: _("Proxy"),
icon: new ThemedIcon ("preferences-system-network"),
header: _("Virtual"),
owner: _owner
);

Expand Down
3 changes: 2 additions & 1 deletion src/Views/VPNPage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ public class Network.VPNPage : Network.Widgets.Page {
Object (
title: _("VPN"),
description: _("A Virtual Private Network can hide network traffic on public networks or from your internet service provider. It can't protect passwords from attackers or prevent websites from identifying you."),
icon: new ThemedIcon ("network-vpn")
icon: new ThemedIcon ("network-vpn"),
header: _("Virtual")
);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Views/WifiPage.vala
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ public class Network.WifiInterface : Network.Widgets.Page {
public WifiInterface (NM.Device device) {
Object (
activatable: true,
device: device
device: device,
header: _("Devices")
);
}

Expand Down

0 comments on commit 56d0f8b

Please sign in to comment.