sharing: Add maximum height for the networks list box
This commit is contained in:
parent
588928a946
commit
5eca0f898c
2 changed files with 9 additions and 20 deletions
|
@ -30,7 +30,6 @@
|
|||
|
||||
struct _CcSharingNetworksPrivate {
|
||||
GtkWidget *listbox;
|
||||
GtkWidget *scrolledwindow;
|
||||
|
||||
GtkWidget *current_row;
|
||||
GtkWidget *current_label;
|
||||
|
@ -116,6 +115,7 @@ cc_sharing_update_networks (CcSharingNetworks *self)
|
|||
"SharingStatus",
|
||||
g_variant_new_uint32 (GSD_SHARING_STATUS_OFFLINE));
|
||||
g_error_free (error);
|
||||
cc_list_box_adjust_scrolling (GTK_LIST_BOX (self->priv->listbox));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -130,6 +130,7 @@ cc_sharing_update_networks (CcSharingNetworks *self)
|
|||
self->priv->networks = g_list_prepend (self->priv->networks, net);
|
||||
}
|
||||
self->priv->networks = g_list_reverse (self->priv->networks);
|
||||
cc_list_box_adjust_scrolling (GTK_LIST_BOX (self->priv->listbox));
|
||||
|
||||
g_variant_unref (networks);
|
||||
}
|
||||
|
@ -387,6 +388,8 @@ cc_sharing_update_networks_box (CcSharingNetworks *self)
|
|||
}
|
||||
|
||||
cc_sharing_networks_update_status (self);
|
||||
|
||||
cc_list_box_adjust_scrolling (GTK_LIST_BOX (self->priv->listbox));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -411,6 +414,8 @@ cc_sharing_networks_constructed (GObject *object)
|
|||
cc_list_box_update_header_func, NULL,
|
||||
NULL);
|
||||
|
||||
cc_list_box_setup_scrolling (GTK_LIST_BOX (self->priv->listbox));
|
||||
|
||||
self->priv->current_row = cc_sharing_networks_new_current_row (self);
|
||||
gtk_list_box_insert (GTK_LIST_BOX (self->priv->listbox), self->priv->current_row, -1);
|
||||
g_object_set_data (G_OBJECT (self), "switch", self->priv->current_switch);
|
||||
|
@ -550,7 +555,6 @@ cc_sharing_networks_class_init (CcSharingNetworksClass *klass)
|
|||
gtk_widget_class_set_template_from_resource (widget_class,
|
||||
"/org/gnome/control-center/sharing/networks.ui");
|
||||
|
||||
gtk_widget_class_bind_template_child_private (widget_class, CcSharingNetworks, scrolledwindow);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, CcSharingNetworks, listbox);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
<property name="can_focus">False</property>
|
||||
<property name="xalign">0</property>
|
||||
<property name="label" translatable="yes">Networks</property>
|
||||
<property name="mnemonic_widget">scrolledwindow</property>
|
||||
<attributes>
|
||||
<attribute name="weight" value="bold"/>
|
||||
</attributes>
|
||||
|
@ -29,30 +28,16 @@
|
|||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkBox" id="shared-networks-box">
|
||||
<object class="GtkFrame" id="shared-networks-frame">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="orientation">vertical</property>
|
||||
<property name="hexpand">True</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<child>
|
||||
<object class="GtkScrolledWindow" id="scrolledwindow">
|
||||
<object class="GtkListBox" id="listbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="vexpand">True</property>
|
||||
<property name="shadow_type">in</property>
|
||||
<property name="vscrollbar-policy">never</property>
|
||||
<child>
|
||||
<object class="GtkListBox" id="listbox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
|
|
Loading…
Add table
Reference in a new issue