Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PopoverWidget: Add everything to a scrolledwindow #272

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions src/Widgets/PopoverWidget.vala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*
*/

public class Network.Widgets.PopoverWidget : Gtk.Grid {
public class Network.Widgets.PopoverWidget : Gtk.Box {
public NM.Client nm_client { get; construct; }
private NM.VpnConnection? active_vpn_connection = null;

Expand Down Expand Up @@ -110,9 +110,20 @@ public class Network.Widgets.PopoverWidget : Gtk.Grid {
toggle_revealer = new Gtk.Revealer ();
toggle_revealer.add (toggle_box);

add (toggle_revealer);
add (vpn_box);
add (wifi_box);
var box = new Gtk.Box (Gtk.Orientation.VERTICAL, 0);
box.add (toggle_revealer);
box.add (vpn_box);
box.add (wifi_box);

var scrolled_window = new Gtk.ScrolledWindow (null, null) {
hscrollbar_policy = Gtk.PolicyType.NEVER,
max_content_height = 724, // 768 - 32px for panel height - 12px for margins
propagate_natural_height = true,
propagate_natural_width = true
};
scrolled_window.add (box);

add (scrolled_window);

if (is_in_session) {
hidden_item = new Gtk.ModelButton ();
Expand All @@ -138,6 +149,7 @@ public class Network.Widgets.PopoverWidget : Gtk.Grid {
}

toggle_revealer.reveal_child = other_box.get_children () != null;

show_all ();
update_vpn_connection ();

Expand Down