net-device-bluetooth: Use AdwActionRow and .boxed-list
This makes both the row and the list fit in better with the rest of the page.
This commit is contained in:
parent
1b45b633ae
commit
3ee642e421
2 changed files with 28 additions and 48 deletions
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include <glib-object.h>
|
#include <glib-object.h>
|
||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
|
#include <adwaita.h>
|
||||||
|
|
||||||
#include <NetworkManager.h>
|
#include <NetworkManager.h>
|
||||||
|
|
||||||
|
@ -35,7 +36,7 @@ struct _NetDeviceBluetooth
|
||||||
{
|
{
|
||||||
GtkBox parent;
|
GtkBox parent;
|
||||||
|
|
||||||
GtkLabel *device_label;
|
AdwActionRow *row;
|
||||||
GtkSwitch *device_off_switch;
|
GtkSwitch *device_off_switch;
|
||||||
GtkButton *options_button;
|
GtkButton *options_button;
|
||||||
GtkSeparator *separator;
|
GtkSeparator *separator;
|
||||||
|
@ -168,7 +169,7 @@ net_device_bluetooth_class_init (NetDeviceBluetoothClass *klass)
|
||||||
|
|
||||||
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/network/network-bluetooth.ui");
|
gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/control-center/network/network-bluetooth.ui");
|
||||||
|
|
||||||
gtk_widget_class_bind_template_child (widget_class, NetDeviceBluetooth, device_label);
|
gtk_widget_class_bind_template_child (widget_class, NetDeviceBluetooth, row);
|
||||||
gtk_widget_class_bind_template_child (widget_class, NetDeviceBluetooth, device_off_switch);
|
gtk_widget_class_bind_template_child (widget_class, NetDeviceBluetooth, device_off_switch);
|
||||||
gtk_widget_class_bind_template_child (widget_class, NetDeviceBluetooth, options_button);
|
gtk_widget_class_bind_template_child (widget_class, NetDeviceBluetooth, options_button);
|
||||||
gtk_widget_class_bind_template_child (widget_class, NetDeviceBluetooth, separator);
|
gtk_widget_class_bind_template_child (widget_class, NetDeviceBluetooth, separator);
|
||||||
|
@ -216,5 +217,5 @@ void
|
||||||
net_device_bluetooth_set_title (NetDeviceBluetooth *self, const gchar *title)
|
net_device_bluetooth_set_title (NetDeviceBluetooth *self, const gchar *title)
|
||||||
{
|
{
|
||||||
g_return_if_fail (NET_IS_DEVICE_BLUETOOTH (self));
|
g_return_if_fail (NET_IS_DEVICE_BLUETOOTH (self));
|
||||||
gtk_label_set_label (self->device_label, title);
|
adw_preferences_row_set_title (ADW_PREFERENCES_ROW (self->row), title);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,24 +12,10 @@
|
||||||
<object class="GtkListBox">
|
<object class="GtkListBox">
|
||||||
<property name="selection_mode">none</property>
|
<property name="selection_mode">none</property>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkListBoxRow">
|
<object class="AdwActionRow" id="row">
|
||||||
<property name="activatable">False</property>
|
<property name="activatable_widget">device_off_switch</property>
|
||||||
<child>
|
<property name="title" translatable="yes">Wired</property>
|
||||||
<object class="GtkBox">
|
<child type="suffix">
|
||||||
<property name="margin_top">8</property>
|
|
||||||
<property name="margin_bottom">8</property>
|
|
||||||
<property name="margin_start">12</property>
|
|
||||||
<property name="margin_end">12</property>
|
|
||||||
<property name="spacing">12</property>
|
|
||||||
<child>
|
|
||||||
<object class="GtkLabel" id="device_label">
|
|
||||||
<property name="hexpand">True</property>
|
|
||||||
<property name="xalign">0.0</property>
|
|
||||||
<property name="label" translatable="yes">Wired</property>
|
|
||||||
<property name="ellipsize">end</property>
|
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<child>
|
|
||||||
<object class="GtkSwitch" id="device_off_switch">
|
<object class="GtkSwitch" id="device_off_switch">
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<signal name="notify::active" handler="device_off_switch_changed_cb" object="NetDeviceBluetooth" swapped="yes"/>
|
<signal name="notify::active" handler="device_off_switch_changed_cb" object="NetDeviceBluetooth" swapped="yes"/>
|
||||||
|
@ -38,20 +24,12 @@
|
||||||
</accessibility>
|
</accessibility>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child type="suffix">
|
||||||
<object class="GtkButton" id="options_button">
|
<object class="GtkButton" id="options_button">
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="use_underline">True</property>
|
<property name="use_underline">True</property>
|
||||||
<signal name="clicked" handler="options_button_clicked_cb" object="NetDeviceBluetooth" swapped="yes"/>
|
|
||||||
<style>
|
|
||||||
<class name="image-button"/>
|
|
||||||
</style>
|
|
||||||
<child>
|
|
||||||
<object class="GtkImage">
|
|
||||||
<property name="icon_name">emblem-system-symbolic</property>
|
<property name="icon_name">emblem-system-symbolic</property>
|
||||||
<property name="icon_size">1</property>
|
<signal name="clicked" handler="options_button_clicked_cb" object="NetDeviceBluetooth" swapped="yes"/>
|
||||||
</object>
|
|
||||||
</child>
|
|
||||||
<accessibility>
|
<accessibility>
|
||||||
<property name="label" translatable="yes">Options…</property>
|
<property name="label" translatable="yes">Options…</property>
|
||||||
</accessibility>
|
</accessibility>
|
||||||
|
@ -59,8 +37,9 @@
|
||||||
</child>
|
</child>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</object>
|
<style>
|
||||||
</child>
|
<class name="boxed-list"/>
|
||||||
|
</style>
|
||||||
</object>
|
</object>
|
||||||
</child>
|
</child>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue