[epiphany/wip/exalm/libhandy-take-2: 3/5] Revert "Revert "data-dialog: Use HdyWindow""



commit d6597874ebda6c3272a26f7c0c895a7968b830e3
Author: Alexander Mikhaylenko <alexm gnome org>
Date:   Tue May 26 21:19:31 2020 +0500

    Revert "Revert "data-dialog: Use HdyWindow""
    
    This reverts commit 30f6dc422cca0137b1a8ce67e3f607c80fcbe3e9.
    
    Include the fix too, no need to keep separate commit for this.

 src/preferences/ephy-data-dialog.c |  4 +-
 src/preferences/ephy-data-dialog.h |  7 ++--
 src/resources/gtk/data-dialog.ui   | 85 +++++++++++++++++++-------------------
 3 files changed, 48 insertions(+), 48 deletions(-)
---
diff --git a/src/preferences/ephy-data-dialog.c b/src/preferences/ephy-data-dialog.c
index 853dedd35..bd22a44d5 100644
--- a/src/preferences/ephy-data-dialog.c
+++ b/src/preferences/ephy-data-dialog.c
@@ -23,8 +23,6 @@
 
 #include <ctype.h>
 #include <glib/gi18n.h>
-#define HANDY_USE_UNSTABLE_API
-#include <handy.h>
 
 typedef struct {
   GtkWidget *box;
@@ -45,7 +43,7 @@ typedef struct {
   char *search_text;
 } EphyDataDialogPrivate;
 
-G_DEFINE_TYPE_WITH_PRIVATE (EphyDataDialog, ephy_data_dialog, GTK_TYPE_WINDOW)
+G_DEFINE_TYPE_WITH_PRIVATE (EphyDataDialog, ephy_data_dialog, HDY_TYPE_WINDOW)
 
 enum {
   PROP_0,
diff --git a/src/preferences/ephy-data-dialog.h b/src/preferences/ephy-data-dialog.h
index 3b1e57554..ed89d6851 100644
--- a/src/preferences/ephy-data-dialog.h
+++ b/src/preferences/ephy-data-dialog.h
@@ -20,17 +20,18 @@
 
 #pragma once
 
-#include <gtk/gtk.h>
+#define HANDY_USE_UNSTABLE_API
+#include <handy.h>
 
 G_BEGIN_DECLS
 
 #define EPHY_TYPE_DATA_DIALOG (ephy_data_dialog_get_type ())
 
-G_DECLARE_DERIVABLE_TYPE (EphyDataDialog, ephy_data_dialog, EPHY, DATA_DIALOG, GtkWindow)
+G_DECLARE_DERIVABLE_TYPE (EphyDataDialog, ephy_data_dialog, EPHY, DATA_DIALOG, HdyWindow)
 
 struct _EphyDataDialogClass
 {
-  GtkWindowClass parent_class;
+  HdyWindowClass parent_class;
 };
 
 const gchar *ephy_data_dialog_get_clear_all_description (EphyDataDialog *self);
diff --git a/src/resources/gtk/data-dialog.ui b/src/resources/gtk/data-dialog.ui
index fe42a1240..eedafb1f8 100644
--- a/src/resources/gtk/data-dialog.ui
+++ b/src/resources/gtk/data-dialog.ui
@@ -13,7 +13,7 @@
     <property name="can_focus">False</property>
     <property name="icon_name">user-trash-symbolic</property>
   </object>
-  <template class="EphyDataDialog" parent="GtkWindow">
+  <template class="EphyDataDialog" parent="HdyWindow">
     <property name="can_focus">False</property>
     <property name="modal">True</property>
     <property name="window_position">center-on-parent</property>
@@ -22,55 +22,56 @@
     <property name="destroy_with_parent">True</property>
     <property name="type_hint">dialog</property>
     <signal name="key-press-event" handler="on_key_press_event" swapped="no"/>
-    <child type="titlebar">
-      <object class="GtkHeaderBar">
+    <child>
+      <object class="GtkBox" id="box">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
-        <property name="show_close_button">True</property>
-        <child>
-          <object class="GtkButton" id="clear_all_button">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="image">clear_all_image</property>
-            <property name="always_show_image">True</property>
-            <signal name="clicked" handler="on_clear_all_button_clicked" swapped="yes"/>
-            <accelerator key="Delete" modifiers="GDK_SHIFT_MASK" signal="clicked"/>
-            <style>
-              <class name="destructive-action"/>
-              <class name="image-button"/>
-            </style>
-          </object>
-        </child>
+        <property name="orientation">vertical</property>
         <child>
-          <object class="GtkToggleButton" id="search_button">
+          <object class="HdyHeaderBar">
             <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="receives_default">True</property>
-            <property name="image">search_image</property>
-            <property name="always_show_image">True</property>
-            <property name="active" bind-source="search_bar" bind-property="search-mode-enabled" 
bind-flags="sync-create|bidirectional"/>
-            <accelerator key="F" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
-            <style>
-              <class name="image-button"/>
-            </style>
-            <child internal-child="accessible">
-              <object class="AtkObject">
-                <property name="AtkObject::accessible-name" translatable="yes">Search</property>
+            <property name="can_focus">False</property>
+            <property name="show_close_button">True</property>
+            <property name="title" bind-source="EphyDataDialog" bind-property="title"/>
+            <child>
+              <object class="GtkButton" id="clear_all_button">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="image">clear_all_image</property>
+                <property name="always_show_image">True</property>
+                <signal name="clicked" handler="on_clear_all_button_clicked" swapped="yes"/>
+                <accelerator key="Delete" modifiers="GDK_SHIFT_MASK" signal="clicked"/>
+                <style>
+                  <class name="destructive-action"/>
+                  <class name="image-button"/>
+                </style>
               </object>
             </child>
+            <child>
+              <object class="GtkToggleButton" id="search_button">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="image">search_image</property>
+                <property name="always_show_image">True</property>
+                <property name="active" bind-source="search_bar" bind-property="search-mode-enabled" 
bind-flags="sync-create|bidirectional"/>
+                <accelerator key="F" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
+                <style>
+                  <class name="image-button"/>
+                </style>
+                <child internal-child="accessible">
+                  <object class="AtkObject">
+                    <property name="AtkObject::accessible-name" translatable="yes">Search</property>
+                  </object>
+                </child>
+              </object>
+              <packing>
+                <property name="pack_type">end</property>
+              </packing>
+            </child>
           </object>
-          <packing>
-            <property name="pack_type">end</property>
-          </packing>
         </child>
-      </object>
-    </child>
-    <child>
-      <object class="GtkBox" id="box">
-        <property name="visible">True</property>
-        <property name="can_focus">False</property>
-        <property name="orientation">vertical</property>
         <child>
           <object class="HdySearchBar" id="search_bar">
             <property name="visible">True</property>


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