[gnome-control-center] keyboard: Use AdwActionRow for input switch rows
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] keyboard: Use AdwActionRow for input switch rows
- Date: Sun, 13 Feb 2022 13:41:33 +0000 (UTC)
commit 485dd456bbed351d0605c94dcb5ceb50c8eeb4f5
Author: Christopher Davis <christopherdavis gnome org>
Date: Sat Feb 12 15:00:05 2022 -0800
keyboard: Use AdwActionRow for input switch rows
panels/keyboard/cc-keyboard-panel.c | 23 +-------------
panels/keyboard/cc-keyboard-panel.ui | 58 +++++++++++-------------------------
2 files changed, 19 insertions(+), 62 deletions(-)
---
diff --git a/panels/keyboard/cc-keyboard-panel.c b/panels/keyboard/cc-keyboard-panel.c
index 228a62ceb..663bcc249 100644
--- a/panels/keyboard/cc-keyboard-panel.c
+++ b/panels/keyboard/cc-keyboard-panel.c
@@ -38,8 +38,6 @@ struct _CcKeyboardPanel
{
CcPanel parent_instance;
- GtkListBox *input_source_list;
-
GtkCheckButton *per_window_source;
GtkCheckButton *same_source;
GSettings *keybindings_settings;
@@ -51,7 +49,7 @@ struct _CcKeyboardPanel
GtkWidget *value_alternate_chars;
GtkWidget *value_compose;
- GtkListBoxRow *common_shortcuts_row;
+ AdwActionRow *common_shortcuts_row;
};
CC_PANEL_REGISTER (CcKeyboardPanel, cc_keyboard_panel)
@@ -98,14 +96,6 @@ static const CcXkbModifier COMPOSE_MODIFIER = {
NULL,
};
-static const gchar *custom_css =
-".keyboard-panel-radio-button {"
-" padding-left: 6px;"
-" padding-right: 12px;"
-" padding-top: 12px;"
-" padding-bottom: 12px;"
-"}";
-
static void
special_chars_activated (AdwActionRow *row,
CcKeyboardPanel *self)
@@ -196,7 +186,6 @@ cc_keyboard_panel_class_init (CcKeyboardPanelClass *klass)
gtk_widget_class_set_template_from_resource (widget_class,
"/org/gnome/control-center/keyboard/cc-keyboard-panel.ui");
- gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, input_source_list);
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, input_switch_group);
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, per_window_source);
gtk_widget_class_bind_template_child (widget_class, CcKeyboardPanel, same_source);
@@ -238,20 +227,10 @@ translate_switch_input_source (GValue *value,
static void
cc_keyboard_panel_init (CcKeyboardPanel *self)
{
- GtkCssProvider *provider;
-
g_resources_register (cc_keyboard_get_resource ());
gtk_widget_init_template (GTK_WIDGET (self));
- provider = gtk_css_provider_new ();
- gtk_css_provider_load_from_data (provider, custom_css, -1);
-
- gtk_style_context_add_provider_for_display (gdk_display_get_default (),
- GTK_STYLE_PROVIDER (provider),
- GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
- g_object_unref (provider);
-
self->input_source_settings = g_settings_new ("org.gnome.desktop.input-sources");
/* "Input Source Switching" section */
diff --git a/panels/keyboard/cc-keyboard-panel.ui b/panels/keyboard/cc-keyboard-panel.ui
index bfb9a4437..3c444931e 100644
--- a/panels/keyboard/cc-keyboard-panel.ui
+++ b/panels/keyboard/cc-keyboard-panel.ui
@@ -27,48 +27,26 @@
<object class="AdwPreferencesGroup" id="input_switch_group">
<property name="title" translatable="yes">Input Source Switching</property>
<child>
- <object class="GtkListBox" id="input_source_list">
- <property name="margin-bottom">20</property>
- <style>
- <class name="boxed-list"/>
- </style>
- <child>
- <object class="GtkListBoxRow">
- <child>
- <object class="GtkCheckButton" id="same_source">
- <property name="active">True</property>
- <style>
- <class name="keyboard-panel-radio-button" />
- </style>
- <child>
- <object class="GtkLabel">
- <property name="margin_start">6</property>
- <property name="use_underline">True</property>
- <property name="label" translatable="yes">Use the _same source for all
windows</property>
- </object>
- </child>
- </object>
- </child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Use the _same source for all windows</property>
+ <property name="use-underline">True</property>
+ <property name="activatable-widget">same_source</property>
+ <child type="prefix">
+ <object class="GtkCheckButton" id="same_source">
+ <property name="valign">center</property>
</object>
</child>
- <child>
- <object class="GtkListBoxRow">
- <child>
- <object class="GtkCheckButton" id="per_window_source">
- <property name="active">True</property>
- <property name="group">same_source</property>
- <style>
- <class name="keyboard-panel-radio-button" />
- </style>
- <child>
- <object class="GtkLabel">
- <property name="margin_start">6</property>
- <property name="use_underline">True</property>
- <property name="label" translatable="yes">Switch input sources _individually for
each window</property>
- </object>
- </child>
- </object>
- </child>
+ </object>
+ </child>
+ <child>
+ <object class="AdwActionRow">
+ <property name="title" translatable="yes">Switch input sources _individually for each
window</property>
+ <property name="use-underline">True</property>
+ <property name="activatable-widget">per_window_source</property>
+ <child type="prefix">
+ <object class="GtkCheckButton" id="per_window_source">
+ <property name="valign">center</property>
+ <property name="group">same_source</property>
</object>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]