[gnome-control-center] keyboard: Use content style for listboxes



commit 1fa95b5fc50ca12e996ec3511187e05e3f55a442
Author: Mohammed Sadiq <sadiq sadiqpk org>
Date:   Wed May 12 19:07:58 2021 +0530

    keyboard: Use content style for listboxes

 panels/keyboard/cc-input-list-box.c       |   4 -
 panels/keyboard/cc-input-list-box.ui      |   5 +-
 panels/keyboard/cc-keyboard-panel.c       |   3 -
 panels/keyboard/cc-keyboard-panel.ui      | 211 ++++++++++++++----------------
 panels/keyboard/cc-xkb-modifier-dialog.c  |   2 -
 panels/keyboard/cc-xkb-modifier-dialog.ui |   4 +-
 6 files changed, 104 insertions(+), 125 deletions(-)
---
diff --git a/panels/keyboard/cc-input-list-box.c b/panels/keyboard/cc-input-list-box.c
index 6c2cb5614..191207490 100644
--- a/panels/keyboard/cc-input-list-box.c
+++ b/panels/keyboard/cc-input-list-box.c
@@ -762,10 +762,6 @@ cc_input_list_box_init (CcInputListBox *self)
   maybe_start_ibus ();
 #endif
 
-  gtk_list_box_set_header_func (GTK_LIST_BOX (self),
-                                cc_list_box_update_header_func,
-                                NULL, NULL);
-
   g_signal_connect_object (self->input_settings, "changed::" KEY_INPUT_SOURCES,
                            G_CALLBACK (input_sources_changed), self, G_CONNECT_SWAPPED);
 
diff --git a/panels/keyboard/cc-input-list-box.ui b/panels/keyboard/cc-input-list-box.ui
index 3df59dee9..cbe7a9f32 100644
--- a/panels/keyboard/cc-input-list-box.ui
+++ b/panels/keyboard/cc-input-list-box.ui
@@ -5,6 +5,9 @@
     <property name="can_focus">True</property>
     <property name="selection-mode">none</property>
     <signal name="row_activated" handler="input_row_activated_cb" object="CcInputListBox" swapped="yes"/>
+    <style>
+      <class name="content"/>
+    </style>
     <child>
       <object class="GtkListBoxRow" id="no_inputs_row">
         <property name="visible">True</property>
@@ -47,4 +50,4 @@
       <widget name="no_inputs_row"/>
     </widgets>
   </object>
-</interface>
\ No newline at end of file
+</interface>
diff --git a/panels/keyboard/cc-keyboard-panel.c b/panels/keyboard/cc-keyboard-panel.c
index 6b203f18f..8c0e03056 100644
--- a/panels/keyboard/cc-keyboard-panel.c
+++ b/panels/keyboard/cc-keyboard-panel.c
@@ -257,9 +257,6 @@ cc_keyboard_panel_init (CcKeyboardPanel *self)
                                              GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1);
   g_object_unref (provider);
 
-  gtk_list_box_set_header_func (self->input_source_list, cc_list_box_update_header_func, NULL, NULL);
-  gtk_list_box_set_header_func (self->special_chars_list, cc_list_box_update_header_func, NULL, NULL);
-
   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 9bc7f105d..9b0952e88 100644
--- a/panels/keyboard/cc-keyboard-panel.ui
+++ b/panels/keyboard/cc-keyboard-panel.ui
@@ -67,15 +67,9 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkFrame">
+                  <object class="CcInputListBox" id="input_list">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="margin_bottom">20</property>
-                    <child>
-                      <object class="CcInputListBox" id="input_list">
-                        <property name="visible">True</property>
-                      </object>
-                    </child>
+                    <property name="margin-bottom">20</property>
                   </object>
                 </child>
                 <child>
@@ -109,62 +103,59 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkFrame">
+                  <object class="GtkListBox" id="input_source_list">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="margin_bottom">20</property>
+                    <property name="margin-bottom">20</property>
+                    <style>
+                      <class name="content"/>
+                    </style>
                     <child>
-                      <object class="GtkListBox" id="input_source_list">
+                      <object class="GtkListBoxRow">
                         <property name="visible">True</property>
                         <child>
-                          <object class="GtkListBoxRow">
+                          <object class="GtkRadioButton" id="same_source">
                             <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="xalign">0</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                            <style>
+                              <class name="keyboard-panel-radio-button" />
+                            </style>
                             <child>
-                              <object class="GtkRadioButton" id="same_source">
+                              <object class="GtkLabel">
                                 <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="xalign">0</property>
-                                <property name="active">True</property>
-                                <property name="draw_indicator">True</property>
-                                <style>
-                                  <class name="keyboard-panel-radio-button" />
-                                </style>
-                                <child>
-                                  <object class="GtkLabel">
-                                    <property name="visible">True</property>
-                                    <property name="margin_left">6</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="label" translatable="yes">Use the _same source for all 
windows</property>
-                                  </object>
-                                </child>
+                                <property name="margin_left">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>
+                    </child>
+                    <child>
+                      <object class="GtkListBoxRow">
+                        <property name="visible">True</property>
                         <child>
-                          <object class="GtkListBoxRow">
+                          <object class="GtkRadioButton" id="per_window_source">
                             <property name="visible">True</property>
+                            <property name="can_focus">True</property>
+                            <property name="receives_default">False</property>
+                            <property name="xalign">0</property>
+                            <property name="active">True</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="group">same_source</property>
+                            <style>
+                              <class name="keyboard-panel-radio-button" />
+                            </style>
                             <child>
-                              <object class="GtkRadioButton" id="per_window_source">
+                              <object class="GtkLabel">
                                 <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="xalign">0</property>
-                                <property name="active">True</property>
-                                <property name="draw_indicator">True</property>
-                                <property name="group">same_source</property>
-                                <style>
-                                  <class name="keyboard-panel-radio-button" />
-                                </style>
-                                <child>
-                                  <object class="GtkLabel">
-                                    <property name="visible">True</property>
-                                    <property name="margin_left">6</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="label" translatable="yes">Switch input sources 
_individually for each window</property>
-                                  </object>
-                                </child>
+                                <property name="margin_left">6</property>
+                                <property name="use_underline">True</property>
+                                <property name="label" translatable="yes">Switch input sources _individually 
for each window</property>
                               </object>
                             </child>
                           </object>
@@ -205,62 +196,59 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkFrame">
+                  <object class="GtkListBox" id="special_chars_list">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
-                    <property name="margin_bottom">20</property>
+                    <property name="can_focus">True</property>
+                    <property name="selection-mode">none</property>
+                    <property name="width-request">250</property>
+                    <property name="margin-bottom">20</property>
+                    <signal name="row-activated" handler="special_chars_activated" object="CcKeyboardPanel" 
swapped="no" />
+                    <style>
+                      <class name="content"/>
+                    </style>
                     <child>
-                      <object class="GtkListBox" id="special_chars_list">
+                      <object class="HdyActionRow" id="alt_chars_row">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="selection-mode">none</property>
-                        <property name="width-request">250</property>
-                        <signal name="row-activated" handler="special_chars_activated" 
object="CcKeyboardPanel" swapped="no" />
+                        <property name="title" translatable="yes">Alternate Characters Key</property>
+                        <property name="activatable">True</property>
                         <child>
-                          <object class="HdyActionRow" id="alt_chars_row">
+                          <object class="GtkLabel" id="value_alternate_chars">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                            <property name="title" translatable="yes">Alternate Characters Key</property>
-                            <property name="activatable">True</property>
-                            <child>
-                              <object class="GtkLabel" id="value_alternate_chars">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="label" translatable="no">Right Alt</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkImage">
-                                <property name="visible">True</property>
-                                <property name="icon_name">go-next-symbolic</property>
-                                <style>
-                                  <class name="dim-label"/>
-                                </style>
-                              </object>
-                            </child>
+                            <property name="label" translatable="no">Right Alt</property>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkImage">
+                            <property name="visible">True</property>
+                            <property name="icon_name">go-next-symbolic</property>
+                            <style>
+                              <class name="dim-label"/>
+                            </style>
                           </object>
-                       </child>
+                        </child>
+                      </object>
+                   </child>
+                    <child>
+                      <object class="HdyActionRow" id="compose_row">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="title" translatable="yes">Compose Key</property>
+                        <property name="activatable">True</property>
                         <child>
-                          <object class="HdyActionRow" id="compose_row">
+                          <object class="GtkLabel" id="value_compose">
                             <property name="visible">True</property>
                             <property name="can_focus">True</property>
-                            <property name="title" translatable="yes">Compose Key</property>
-                            <property name="activatable">True</property>
-                            <child>
-                              <object class="GtkLabel" id="value_compose">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkImage">
-                                <property name="visible">True</property>
-                                <property name="icon_name">go-next-symbolic</property>
-                                <style>
-                                  <class name="dim-label"/>
-                                </style>
-                              </object>
-                            </child>
+                          </object>
+                        </child>
+                        <child>
+                          <object class="GtkImage">
+                            <property name="visible">True</property>
+                            <property name="icon_name">go-next-symbolic</property>
+                            <style>
+                              <class name="dim-label"/>
+                            </style>
                           </object>
                         </child>
                       </object>
@@ -279,31 +267,28 @@
                   </object>
                 </child>
                 <child>
-                  <object class="GtkFrame">
+                  <object class="GtkListBox" id="keyboard_shortcuts_listbox">
                     <property name="visible">True</property>
-                    <property name="can_focus">False</property>
+                    <property name="can_focus">True</property>
+                    <property name="selection-mode">none</property>
+                    <property name="width-request">250</property>
+                    <signal name="row-activated" handler="keyboard_shortcuts_activated" 
object="CcKeyboardPanel" swapped="no" />
+                    <style>
+                      <class name="content"/>
+                    </style>
                     <child>
-                      <object class="GtkListBox" id="keyboard_shortcuts_listbox">
+                      <object class="HdyActionRow" id="common_shortcuts_row">
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
-                        <property name="selection-mode">none</property>
-                        <property name="width-request">250</property>
-                        <signal name="row-activated" handler="keyboard_shortcuts_activated" 
object="CcKeyboardPanel" swapped="no" />
+                        <property name="title" translatable="yes">View and Customize Shortcuts</property>
+                        <property name="activatable">True</property>
                         <child>
-                          <object class="HdyActionRow" id="common_shortcuts_row">
+                          <object class="GtkImage">
                             <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="title" translatable="yes">View and Customize Shortcuts</property>
-                            <property name="activatable">True</property>
-                            <child>
-                              <object class="GtkImage">
-                                <property name="visible">True</property>
-                                <property name="icon_name">go-next-symbolic</property>
-                                <style>
-                                  <class name="dim-label"/>
-                                </style>
-                              </object>
-                            </child>
+                            <property name="icon_name">go-next-symbolic</property>
+                            <style>
+                             <class name="dim-label"/>
+                            </style>
                           </object>
                         </child>
                       </object>
diff --git a/panels/keyboard/cc-xkb-modifier-dialog.c b/panels/keyboard/cc-xkb-modifier-dialog.c
index ae6326a96..b1fae3d6d 100644
--- a/panels/keyboard/cc-xkb-modifier-dialog.c
+++ b/panels/keyboard/cc-xkb-modifier-dialog.c
@@ -299,8 +299,6 @@ cc_xkb_modifier_dialog_init (CcXkbModifierDialog *self)
 
   self->modifier = NULL;
 
-  gtk_list_box_set_header_func (self->listbox, cc_list_box_update_header_func, NULL, NULL);
-
   self->input_source_settings = g_settings_new ("org.gnome.desktop.input-sources");
   g_signal_connect_object (self->input_source_settings,
                            "changed::xkb-options",
diff --git a/panels/keyboard/cc-xkb-modifier-dialog.ui b/panels/keyboard/cc-xkb-modifier-dialog.ui
index 851b92d6b..7863ebef3 100644
--- a/panels/keyboard/cc-xkb-modifier-dialog.ui
+++ b/panels/keyboard/cc-xkb-modifier-dialog.ui
@@ -36,7 +36,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <style>
-                  <class name="frame"/>
+                  <class name="content"/>
                 </style>
                 <child>
                   <object class="HdyActionRow" id="switch_row">
@@ -60,7 +60,7 @@
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <style>
-                  <class name="frame"/>
+                  <class name="content"/>
                 </style>
               </object>
             </child>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]