[gnome-control-center/gbsneto/gtk4: 54/72] lock: Port to GTK4




commit 21de97d518314dd5d7f5daeef42ca8c5692bb9c5
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Wed Oct 20 17:13:10 2021 -0300

    lock: Port to GTK4
    
    This one was even more trivial than the previous one!

 panels/lock/cc-lock-panel.c  |  5 -----
 panels/lock/cc-lock-panel.ui | 32 ++++++++++----------------------
 panels/meson.build           |  2 +-
 shell/cc-panel-loader.c      |  4 ++--
 4 files changed, 13 insertions(+), 30 deletions(-)
---
diff --git a/panels/lock/cc-lock-panel.c b/panels/lock/cc-lock-panel.c
index 86800e871..d3ad3a893 100644
--- a/panels/lock/cc-lock-panel.c
+++ b/panels/lock/cc-lock-panel.c
@@ -19,7 +19,6 @@
  * Author: Matthias Clasen <mclasen redhat com>
  */
 
-#include "list-box-helper.h"
 #include "cc-lock-panel.h"
 #include "cc-lock-resources.h"
 #include "cc-util.h"
@@ -284,10 +283,6 @@ cc_lock_panel_init (CcLockPanel *self)
 
   gtk_widget_init_template (GTK_WIDGET (self));
 
-  gtk_list_box_set_header_func (self->lock_list_box,
-                                cc_list_box_update_header_func,
-                                NULL, NULL);
-
   self->cancellable = g_cancellable_new ();
 
   self->lock_settings = g_settings_new ("org.gnome.desktop.screensaver");
diff --git a/panels/lock/cc-lock-panel.ui b/panels/lock/cc-lock-panel.ui
index 6255195ff..945ae2676 100644
--- a/panels/lock/cc-lock-panel.ui
+++ b/panels/lock/cc-lock-panel.ui
@@ -2,14 +2,11 @@
 <!-- Generated with glade 3.18.1 -->
 <interface>
   <template class="CcLockPanel" parent="CcPanel">
-    <property name="visible">True</property>
     <child>
       <object class="GtkScrolledWindow">
-        <property name="visible">1</property>
         <property name="hscrollbar-policy">never</property>
         <child>
-          <object class="HdyClamp">
-            <property name="visible">True</property>
+          <object class="AdwClamp">
             <property name="margin_top">32</property>
             <property name="margin_bottom">32</property>
             <property name="margin_start">12</property>
@@ -17,12 +14,10 @@
 
             <child>
               <object class="GtkBox">
-                <property name="visible">1</property>
                 <property name="orientation">vertical</property>
                 <property name="hexpand">1</property>
                 <child>
                   <object class="GtkLabel" id="lock_description_label">
-                    <property name="visible">1</property>
                     <property name="margin-bottom">12</property>
                     <property name="label" translatable="yes">Automatically locking the screen prevents 
others from accessing the computer while you're away.</property>
                     <property name="wrap">1</property>
@@ -33,14 +28,15 @@
 
                 <child>
                   <object class="GtkListBox" id="lock_list_box">
-                    <property name="visible">1</property>
-                    <property name="can-focus">1</property>
                     <property name="selection-mode">none</property>
 
+                    <style>
+                      <class name="content" />
+                    </style>
+
                     <!-- Blank Screen Delay row -->
                     <child>
-                      <object class="HdyActionRow">
-                        <property name="visible">true</property>
+                      <object class="AdwActionRow">
                         <property name="title" translatable="yes">Blank Screen Delay</property>
                         <property name="subtitle" translatable="yes">Period of inactivity after which the 
screen will go blank.</property>
                         <property name="subtitle-lines">2</property>
@@ -49,7 +45,6 @@
                         <property name="use-underline">true</property>
                         <child>
                           <object class="GtkComboBoxText" id="blank_screen_combo">
-                            <property name="visible">1</property>
                             <property name="valign">center</property>
                             <property name="entry_text_column">0</property>
                             <property name="model">blank_screen_model</property>
@@ -61,14 +56,12 @@
 
                     <!-- Automatic Screen Lock row -->
                     <child>
-                      <object class="HdyActionRow">
-                        <property name="visible">true</property>
+                      <object class="AdwActionRow">
                         <property name="title" translatable="yes">Automatic Screen _Lock</property>
                         <property name="activatable-widget">automatic_screen_lock_switch</property>
                         <property name="use-underline">true</property>
                         <child>
                           <object class="GtkSwitch" id="automatic_screen_lock_switch">
-                            <property name="visible">1</property>
                             <property name="halign">end</property>
                             <property name="valign">center</property>
                           </object>
@@ -78,8 +71,7 @@
 
                     <!-- Automatic Screen Lock Delay row -->
                     <child>
-                      <object class="HdyActionRow">
-                        <property name="visible">true</property>
+                      <object class="AdwActionRow">
                         <property name="title" translatable="yes">Automatic _Screen Lock Delay</property>
                         <property name="subtitle" translatable="yes">Period after the screen blanks when the 
screen is automatically locked.</property>
                         <property name="subtitle-lines">2</property>
@@ -88,7 +80,6 @@
                         <property name="use-underline">true</property>
                         <child>
                           <object class="GtkComboBoxText" id="lock_after_combo">
-                            <property name="visible">1</property>
                             <property name="valign">center</property>
                             <property name="entry_text_column">0</property>
                             <property name="model">lock_after_model</property>
@@ -100,14 +91,12 @@
 
                     <!-- Show Notifications row -->
                     <child>
-                      <object class="HdyActionRow">
-                        <property name="visible">true</property>
+                      <object class="AdwActionRow">
                         <property name="title" translatable="yes">Show _Notifications on Lock 
Screen</property>
                         <property name="activatable-widget">show_notifications_switch</property>
                         <property name="use-underline">true</property>
                         <child>
                           <object class="GtkSwitch" id="show_notifications_switch">
-                            <property name="visible">1</property>
                             <property name="halign">end</property>
                             <property name="valign">center</property>
                           </object>
@@ -117,7 +106,7 @@
 
                     <!-- USB protection row -->
                     <child>
-                      <object class="HdyActionRow" id="usb_protection_row">
+                      <object class="AdwActionRow" id="usb_protection_row">
                         <property name="visible">false</property>
                         <property name="title" translatable="yes">Forbid new _USB devices</property>
                         <property name="subtitle" translatable="yes">Prevent new USB devices from 
interacting with the system when the screen is locked.</property>
@@ -126,7 +115,6 @@
                         <property name="use-underline">true</property>
                         <child>
                           <object class="GtkSwitch" id="usb_protection_switch">
-                            <property name="visible">true</property>
                             <property name="halign">end</property>
                             <property name="valign">center</property>
                           </object>
diff --git a/panels/meson.build b/panels/meson.build
index 7127b0c0b..064333e4c 100644
--- a/panels/meson.build
+++ b/panels/meson.build
@@ -12,7 +12,7 @@ panels = [
   'info-overview',
 #  'keyboard',
   'location',
-#  'lock',
+  'lock',
 #  'microphone',
 #  'mouse',
 #  'multitasking',
diff --git a/shell/cc-panel-loader.c b/shell/cc-panel-loader.c
index 965533837..eabc05734 100644
--- a/shell/cc-panel-loader.c
+++ b/shell/cc-panel-loader.c
@@ -72,7 +72,7 @@ extern GType cc_location_panel_get_type (void);
 extern GType cc_camera_panel_get_type (void);
 //extern GType cc_microphone_panel_get_type (void);
 //extern GType cc_usage_panel_get_type (void);
-//extern GType cc_lock_panel_get_type (void);
+extern GType cc_lock_panel_get_type (void);
 //extern GType cc_diagnostics_panel_get_type (void);
 
 /* Static init functions */
@@ -111,7 +111,7 @@ static CcPanelLoaderVtable default_panels[] =
   PANEL_TYPE("info-overview",    cc_info_overview_panel_get_type,        NULL),
   //PANEL_TYPE("keyboard",         cc_keyboard_panel_get_type,             NULL),
   PANEL_TYPE("location",         cc_location_panel_get_type,             NULL),
-  //PANEL_TYPE("lock",             cc_lock_panel_get_type,                 NULL),
+  PANEL_TYPE("lock",             cc_lock_panel_get_type,                 NULL),
   //PANEL_TYPE("microphone",       cc_microphone_panel_get_type,           NULL),
   //PANEL_TYPE("mouse",            cc_mouse_panel_get_type,                NULL),
   //PANEL_TYPE("multitasking",     cc_multitasking_panel_get_type,         NULL),


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