[geary/mjog/port-to-libhandy-1: 5/6] client: Port client codebase to handy-1




commit 193f87abfb60b86c6895d0baab2e1c534b6681f9
Author: Michael Gratton <mike vee net>
Date:   Mon Aug 17 09:48:09 2020 +1000

    client: Port client codebase to handy-1

 src/client/application/application-client.vala            |  3 ++-
 src/client/components/components-preferences-window.vala  | 15 ++++++---------
 .../components/components-problem-report-info-bar.vala    |  3 +--
 src/client/components/components-search-bar.vala          |  4 ++--
 src/client/components/main-toolbar.vala                   |  4 ++--
 src/client/dialogs/dialogs-problem-details-dialog.vala    |  2 +-
 ui/components-inspector-error-view.ui                     |  4 +---
 ui/components-inspector-system-view.ui                    |  4 +---
 ui/problem-details-dialog.ui                              |  5 ++++-
 9 files changed, 20 insertions(+), 24 deletions(-)
---
diff --git a/src/client/application/application-client.vala b/src/client/application/application-client.vala
index a5dc995b3..16da01097 100644
--- a/src/client/application/application-client.vala
+++ b/src/client/application/application-client.vala
@@ -390,6 +390,7 @@ public class Application.Client : Gtk.Application {
 
         // Calls Gtk.init(), amongst other things
         base.startup();
+        Hdy.init();
 
         this.engine = new Geary.Engine(get_resource_directory());
         this.config = new Configuration(SCHEMA_ID);
@@ -950,7 +951,7 @@ public class Application.Client : Gtk.Application {
                 this,
                 new Geary.ProblemReport(err)
             );
-            dialog.run();
+            dialog.show();
         }
 
         if (mutex_token != Geary.Nonblocking.Mutex.INVALID_TOKEN) {
diff --git a/src/client/components/components-preferences-window.vala 
b/src/client/components/components-preferences-window.vala
index 75c5b4b32..e934a815f 100644
--- a/src/client/components/components-preferences-window.vala
+++ b/src/client/components/components-preferences-window.vala
@@ -53,7 +53,7 @@ public class Components.PreferencesWindow : Hdy.PreferencesWindow {
         autoselect_row.title = _("_Automatically select next message");
         autoselect_row.use_underline = true;
         autoselect_row.activatable_widget = autoselect;
-        autoselect_row.add_action(autoselect);
+        autoselect_row.add(autoselect);
 
         var display_preview = new Gtk.Switch();
         display_preview.valign = CENTER;
@@ -63,7 +63,7 @@ public class Components.PreferencesWindow : Hdy.PreferencesWindow {
         display_preview_row.title = _("_Display conversation preview");
         display_preview_row.use_underline = true;
         display_preview_row.activatable_widget = display_preview;
-        display_preview_row.add_action(display_preview);
+        display_preview_row.add(display_preview);
 
         var three_pane_view = new Gtk.Switch();
         three_pane_view.valign = CENTER;
@@ -73,7 +73,7 @@ public class Components.PreferencesWindow : Hdy.PreferencesWindow {
         three_pane_view_row.title = _("Use _three pane view");
         three_pane_view_row.use_underline = true;
         three_pane_view_row.activatable_widget = three_pane_view;
-        three_pane_view_row.add_action(three_pane_view);
+        three_pane_view_row.add(three_pane_view);
 
         var single_key_shortucts = new Gtk.Switch();
         single_key_shortucts.valign = CENTER;
@@ -86,7 +86,7 @@ public class Components.PreferencesWindow : Hdy.PreferencesWindow {
         );
         single_key_shortucts_row.use_underline = true;
         single_key_shortucts_row.activatable_widget = single_key_shortucts;
-        single_key_shortucts_row.add_action(single_key_shortucts);
+        single_key_shortucts_row.add(single_key_shortucts);
 
         var startup_notifications = new Gtk.Switch();
         startup_notifications.valign = CENTER;
@@ -100,7 +100,7 @@ public class Components.PreferencesWindow : Hdy.PreferencesWindow {
             "Geary will keep running after all windows are closed"
         );
         startup_notifications_row.activatable_widget = startup_notifications;
-        startup_notifications_row.add_action(startup_notifications);
+        startup_notifications_row.add(startup_notifications);
 
         var group = new Hdy.PreferencesGroup();
         /// Translators: Preferences group title
@@ -117,8 +117,6 @@ public class Components.PreferencesWindow : Hdy.PreferencesWindow {
         /// Translators: Preferences page title
         page.title = _("Preferences");
         page.icon_name = "preferences-other-symbolic";
-        page.propagate_natural_height = true;
-        page.propagate_natural_width = true;
         page.add(group);
         page.show_all();
 
@@ -180,7 +178,6 @@ public class Components.PreferencesWindow : Hdy.PreferencesWindow {
         /// Translators: Preferences page title
         page.title = _("Plugins");
         page.icon_name = "application-x-addon-symbolic";
-        page.propagate_natural_width = true;
         page.add(group);
         page.show_all();
 
@@ -199,7 +196,7 @@ public class Components.PreferencesWindow : Hdy.PreferencesWindow {
         row.title = plugin.get_name();
         row.subtitle = plugin.get_description();
         row.activatable_widget = @switch;
-        row.add_action(@switch);
+        row.add(@switch);
 
         return row;
     }
diff --git a/src/client/components/components-problem-report-info-bar.vala 
b/src/client/components/components-problem-report-info-bar.vala
index 63a6dfa1a..d2042f8c3 100644
--- a/src/client/components/components-problem-report-info-bar.vala
+++ b/src/client/components/components-problem-report-info-bar.vala
@@ -113,8 +113,7 @@ public class Components.ProblemReportInfoBar : InfoBar {
                 main.application,
                 this.report
             );
-            dialog.run();
-            dialog.destroy();
+            dialog.show();
         }
     }
 
diff --git a/src/client/components/components-search-bar.vala 
b/src/client/components/components-search-bar.vala
index 3988a2aab..c5f1076af 100644
--- a/src/client/components/components-search-bar.vala
+++ b/src/client/components/components-search-bar.vala
@@ -39,8 +39,8 @@ public class SearchBar : Hdy.SearchBar {
         this.entry.placeholder_text = DEFAULT_SEARCH_TEXT;
         this.entry.has_focus = true;
 
-        var column = new Hdy.Column();
-        column.maximum_width = 450;
+        var column = new Hdy.Clamp();
+        column.maximum_size = 450;
         column.add(this.entry);
 
         connect_entry(this.entry);
diff --git a/src/client/components/main-toolbar.vala b/src/client/components/main-toolbar.vala
index 2a160f8b2..31f87df6c 100644
--- a/src/client/components/main-toolbar.vala
+++ b/src/client/components/main-toolbar.vala
@@ -95,13 +95,13 @@ public class MainToolbar : Gtk.Box {
 
     public void set_conversation_header(Gtk.HeaderBar header) {
         conversation_header.hide();
-        this.header_group.add_header_bar(header);
+        this.header_group.add_gtk_header_bar(header);
         pack_start(header, true, true);
     }
 
     public void remove_conversation_header(Gtk.HeaderBar header) {
         remove(header);
-        this.header_group.remove_header_bar(header);
+        this.header_group.remove_gtk_header_bar(header);
         conversation_header.show();
     }
 
diff --git a/src/client/dialogs/dialogs-problem-details-dialog.vala 
b/src/client/dialogs/dialogs-problem-details-dialog.vala
index 2dcfcb0c8..34e4cb9c3 100644
--- a/src/client/dialogs/dialogs-problem-details-dialog.vala
+++ b/src/client/dialogs/dialogs-problem-details-dialog.vala
@@ -9,7 +9,7 @@
  * Displays technical details when a problem has been reported.
  */
 [GtkTemplate (ui = "/org/gnome/Geary/problem-details-dialog.ui")]
-public class Dialogs.ProblemDetailsDialog : Hdy.Dialog {
+public class Dialogs.ProblemDetailsDialog : Gtk.Dialog {
 
 
     private const string ACTION_CLOSE = "problem-details-close";
diff --git a/ui/components-inspector-error-view.ui b/ui/components-inspector-error-view.ui
index 133402354..78df053ee 100644
--- a/ui/components-inspector-error-view.ui
+++ b/ui/components-inspector-error-view.ui
@@ -7,15 +7,13 @@
     <property name="visible">True</property>
     <property name="can_focus">False</property>
     <child>
-      <object class="HdyColumn">
+      <object class="HdyClamp">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="margin_left">16</property>
         <property name="margin_right">16</property>
         <property name="margin_top">32</property>
         <property name="margin_bottom">32</property>
-        <property name="maximum_width">500</property>
-        <property name="linear_growth_width">1</property>
         <child>
           <object class="GtkGrid">
             <property name="visible">True</property>
diff --git a/ui/components-inspector-system-view.ui b/ui/components-inspector-system-view.ui
index 8ef50dc40..e470f9d57 100644
--- a/ui/components-inspector-system-view.ui
+++ b/ui/components-inspector-system-view.ui
@@ -19,15 +19,13 @@
             <property name="visible">True</property>
             <property name="can_focus">False</property>
             <child>
-              <object class="HdyColumn">
+              <object class="HdyClamp">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="margin_left">16</property>
                 <property name="margin_right">16</property>
                 <property name="margin_top">32</property>
                 <property name="margin_bottom">32</property>
-                <property name="maximum_width">500</property>
-                <property name="linear_growth_width">1</property>
                 <child>
                   <object class="GtkFrame">
                     <property name="visible">True</property>
diff --git a/ui/problem-details-dialog.ui b/ui/problem-details-dialog.ui
index 5e667fed5..bb3e03066 100644
--- a/ui/problem-details-dialog.ui
+++ b/ui/problem-details-dialog.ui
@@ -3,8 +3,11 @@
 <interface>
   <requires lib="gtk+" version="3.20"/>
   <requires lib="libhandy" version="0.0"/>
-  <template class="DialogsProblemDetailsDialog" parent="HdyDialog">
+  <template class="DialogsProblemDetailsDialog" parent="GtkDialog">
     <property name="can_focus">False</property>
+    <property name="modal">True</property>
+    <property name="type_hint">dialog</property>
+    <property name="window_position">center</property>
     <child type="titlebar">
       <object class="GtkHeaderBar">
         <property name="visible">True</property>


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