[gnome-games/wip/exalm/gtk4: 3/29] fixme: Remove libhandy



commit 360a9de25786d440191f98a333991472cbdf2924
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Tue Sep 18 00:25:40 2018 +0500

    fixme: Remove libhandy
    
    Libhandy isn't available for GTK4 yet, so remove it for now and replace
    with stubs.

 data/ui/application-window.ui  |  5 ----
 data/ui/preferences-page.ui    |  7 +++---
 data/ui/preferences-window.ui  | 19 +++------------
 data/ui/search-bar.ui          |  8 +++---
 flatpak/org.gnome.Games.json   | 16 ------------
 meson.build                    |  3 ---
 src/main.vala                  |  1 -
 src/meson.build                |  1 -
 src/ui/preferences-window.vala | 55 ++----------------------------------------
 src/ui/search-bar.vala         |  2 +-
 10 files changed, 15 insertions(+), 102 deletions(-)
---
diff --git a/data/ui/application-window.ui b/data/ui/application-window.ui
index 443f718e..22b75634 100644
--- a/data/ui/application-window.ui
+++ b/data/ui/application-window.ui
@@ -35,9 +35,6 @@
       </object>
     </child>
     <child type="titlebar">
-      <object class="HdyTitleBar">
-        <property name="visible">True</property>
-        <child>
           <object class="GtkStack" id="header_bar">
             <property name="visible">True</property>
             <child>
@@ -60,8 +57,6 @@
               </packing>
             </child>
           </object>
-        </child>
-      </object>
     </child>
   </template>
 </interface>
diff --git a/data/ui/preferences-page.ui b/data/ui/preferences-page.ui
index c6be5815..941d9cb6 100644
--- a/data/ui/preferences-page.ui
+++ b/data/ui/preferences-page.ui
@@ -10,15 +10,16 @@
           <object class="GtkViewport">
             <property name="visible">True</property>
             <child>
-              <object class="HdyColumn">
+              <object class="GtkBox">
                 <property name="visible">True</property>
                 <property name="expand">True</property>
-                <property name="maximum-width">600</property>
-                <property name="linear-growth-width">300</property>
+                <property name="width-request">600</property>
+                <property name="halign">center</property>
                 <child>
                   <object class="GtkBox" id="box">
                     <property name="visible">True</property>
                     <property name="orientation">vertical</property>
+                    <property name="hexpand">True</property>
                     <property name="margin">12</property>
                     <property name="spacing">12</property>
                   </object>
diff --git a/data/ui/preferences-window.ui b/data/ui/preferences-window.ui
index e3fb9afd..1f168efa 100644
--- a/data/ui/preferences-window.ui
+++ b/data/ui/preferences-window.ui
@@ -8,7 +8,7 @@
     <property name="default-height">500</property>
     <property name="window-position">center-on-parent</property>
     <child type="titlebar">
-      <object class="HdyTitleBar" id="titlebar">
+      <object class="GtkBox" id="titlebar">
         <property name="visible">True</property>
         <child>
           <object class="GtkStack" id="titlebar_stack">
@@ -16,16 +16,14 @@
             <property name="transition-type">slide-left-right</property>
             <property name="transition-duration">250</property>
             <child>
-              <object class="HdyLeaflet" id="titlebar_box">
+              <object class="GtkBox" id="titlebar_box">
                 <property name="visible">True</property>
-                <property name="mode-transition-type">slide</property>
-                <property name="child-transition-type">slide</property>
                 <child>
                   <object class="GtkHeaderBar" id="left_header_bar">
                     <property name="name">left_header_bar</property>
                     <property name="visible">True</property>
                     <property name="title" translatable="yes">Preferences</property>
-                    <property name="show-close-button">True</property>
+                    <property name="show-close-button">False</property>
                   </object>
                 </child>
                 <child>
@@ -82,11 +80,8 @@
         <property name="transition-duration">250</property>
         <signal name="notify::transition-running" handler="subpage_transition_finished"/>
         <child>
-          <object class="HdyLeaflet" id="content_box">
+          <object class="GtkBox" id="content_box">
             <property name="visible">True</property>
-            <property name="mode-transition-type">slide</property>
-            <property name="child-transition-type">slide</property>
-            <signal name="notify::folded" handler="on_folded_changed" after="yes"/>
             <child>
               <object class="GamesPreferencesSidebar" id="sidebar">
                 <property name="stack">stack</property>
@@ -148,10 +143,4 @@
       <widget name="stack"/>
     </widgets>
   </object>
-  <object class="HdyHeaderGroup" id="header_group">
-    <headerbars>
-      <headerbar name="left_header_bar"/>
-      <headerbar name="right_header_bar"/>
-    </headerbars>
-  </object>
 </interface>
diff --git a/data/ui/search-bar.ui b/data/ui/search-bar.ui
index 2af4e451..d1f27263 100644
--- a/data/ui/search-bar.ui
+++ b/data/ui/search-bar.ui
@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.16 -->
-  <template class="GamesSearchBar" parent="HdySearchBar">
+  <template class="GamesSearchBar" parent="GtkSearchBar">
     <property name="visible">True</property>
     <child>
-      <object class="HdyColumn">
+      <object class="GtkBox">
         <property name="visible">True</property>
-        <property name="maximum-width">400</property>
-        <property name="linear-growth-width">300</property>
+        <property name="width-request">400</property>
         <child>
           <object class="GtkSearchEntry" id="entry">
             <property name="visible">True</property>
+            <property name="hexpand">True</property>
             <signal name="search-changed" handler="on_search_changed"/>
             <signal name="activate" handler="on_search_activated"/>
           </object>
diff --git a/flatpak/org.gnome.Games.json b/flatpak/org.gnome.Games.json
index 3cc715ae..e738133a 100644
--- a/flatpak/org.gnome.Games.json
+++ b/flatpak/org.gnome.Games.json
@@ -182,22 +182,6 @@
                 }
             ]
         },
-        {
-            "name" : "libhandy",
-            "buildsystem" : "meson",
-            "config-opts" : [
-                "--libdir=lib",
-                "-Dtests=false",
-                "-Dexamples=false",
-                "-Dglade_catalog=disabled"
-            ],
-            "sources" : [
-                {
-                    "type" : "git",
-                    "url" : "https://source.puri.sm/Librem5/libhandy.git";
-                }
-            ]
-        },
         {
             "name" : "manette",
             "buildsystem" : "meson",
diff --git a/meson.build b/meson.build
index 83afe05b..cc2b17ea 100644
--- a/meson.build
+++ b/meson.build
@@ -31,13 +31,11 @@ valac = meson.get_compiler ('vala')
 glib_min_version = '2.38'
 manette_min_version = '0.2.0'
 retro_gtk_min_version = '0.15.3'
-handy_min_version = '0.0.8'
 
 gio_dep = dependency ('gio-2.0', version: '>=' + glib_min_version)
 glib_dep = dependency ('glib-2.0', version: '>=' + glib_min_version)
 grilo_dep = dependency ('grilo-0.3')
 gtk_dep = dependency ('gtk+-3.0')
-handy_dep = dependency ('libhandy-0.0', version: '>=' + handy_min_version)
 manette_dep = dependency ('manette-0.2', version: '>=' + manette_min_version)
 retro_gtk_dep = dependency ('retro-gtk-0.14', version: '>=' + retro_gtk_min_version)
 rsvg_dep = dependency ('librsvg-2.0')
@@ -76,7 +74,6 @@ srcinc = include_directories('src')
 add_project_arguments (
   '-DGETTEXT_PACKAGE="' + meson.project_name () + '"',
   '-DRETRO_GTK_USE_UNSTABLE_API',
-  '-DHANDY_USE_UNSTABLE_API',
   language: 'c'
 )
 
diff --git a/src/main.vala b/src/main.vala
index 493dad22..accb61fa 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -6,7 +6,6 @@ int main (string[] args) {
        Intl.textdomain (Config.GETTEXT_PACKAGE);
 
        Grl.init (ref args);
-       Hdy.init (ref args);
 
        var app = new Games.Application ();
        var result = app.run (args);
diff --git a/src/meson.build b/src/meson.build
index 94bb1055..39569cd4 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -203,7 +203,6 @@ vala_sources = [
 
 dependencies = [
   config_dep,
-  handy_dep,
   gio_dep,
   glib_dep,
   grilo_dep,
diff --git a/src/ui/preferences-window.vala b/src/ui/preferences-window.vala
index bbf5755a..3a716c6b 100644
--- a/src/ui/preferences-window.vala
+++ b/src/ui/preferences-window.vala
@@ -2,29 +2,18 @@
 
 [GtkTemplate (ui = "/org/gnome/Games/ui/preferences-window.ui")]
 private class Games.PreferencesWindow : Gtk.Window {
-       [GtkChild]
-       private Hdy.TitleBar titlebar;
        [GtkChild]
        private Gtk.Stack titlebar_stack;
        [GtkChild]
-       private Hdy.Leaflet titlebar_box;
-       [GtkChild]
-       private Gtk.HeaderBar left_header_bar;
+       private Gtk.Box titlebar_box;
        [GtkChild]
        private Gtk.HeaderBar right_header_bar;
        [GtkChild]
        private Gtk.Stack main_stack;
        [GtkChild]
-       private Hdy.Leaflet content_box;
-       [GtkChild]
-       private PreferencesSidebar sidebar;
+       private Gtk.Box content_box;
        [GtkChild]
        private Gtk.Stack stack;
-       [GtkChild]
-       private Hdy.HeaderGroup header_group;
-
-       [GtkChild]
-       private Gtk.Button back_button;
 
        private PreferencesSubpage _subpage;
        public PreferencesSubpage subpage {
@@ -37,7 +26,6 @@ private class Games.PreferencesWindow : Gtk.Window {
                                previous_subpage = subpage;
                                main_stack.visible_child = content_box;
                                titlebar_stack.visible_child = titlebar_box;
-                               selection_mode_binding.unbind ();
                        }
 
                        if (value != null) {
@@ -46,15 +34,8 @@ private class Games.PreferencesWindow : Gtk.Window {
                                main_stack.add (value);
                                main_stack.visible_child = value;
 
-                               selection_mode_binding = value.bind_property ("request-selection-mode",
-                                                                             titlebar, "selection-mode",
-                                                                             BindingFlags.SYNC_CREATE);
-
                                titlebar_stack.add (header_bar);
                                titlebar_stack.visible_child = header_bar;
-
-                               content_box.visible_child = stack;
-                               titlebar_box.visible_child = right_header_bar;
                        }
 
                        _subpage = value;
@@ -65,7 +46,6 @@ private class Games.PreferencesWindow : Gtk.Window {
        private PreferencesSubpage previous_subpage;
 
        private Binding subpage_binding;
-       private Binding selection_mode_binding;
 
        construct {
                update_ui ();
@@ -73,10 +53,6 @@ private class Games.PreferencesWindow : Gtk.Window {
 
        [GtkCallback]
        private void sidebar_row_selected () {
-               content_box.visible_child = stack;
-               titlebar_box.visible_child = right_header_bar;
-               update_header_group ();
-
                update_ui ();
        }
 
@@ -107,32 +83,5 @@ private class Games.PreferencesWindow : Gtk.Window {
 
        [GtkCallback]
        private void on_back_clicked () {
-               content_box.visible_child = sidebar;
-               titlebar_box.visible_child = left_header_bar;
-               update_header_group ();
-       }
-
-       [GtkCallback]
-       private void on_folded_changed (Object object, ParamSpec paramSpec) {
-               var folded = content_box.folded;
-
-               update_header_group ();
-               back_button.visible = folded;
-               sidebar.show_selection = !folded;
-
-               if (folded)
-                       stack.transition_type = Gtk.StackTransitionType.NONE;
-               else
-                       stack.transition_type = Gtk.StackTransitionType.CROSSFADE;
-       }
-
-       private void update_header_group () {
-               var folded = content_box.folded;
-               var visible_header_bar = titlebar_box.visible_child as Gtk.HeaderBar;
-
-               if (folded)
-                       header_group.focus = visible_header_bar;
-               else
-                       header_group.focus = null;
        }
 }
diff --git a/src/ui/search-bar.vala b/src/ui/search-bar.vala
index 2d663210..e417fb96 100644
--- a/src/ui/search-bar.vala
+++ b/src/ui/search-bar.vala
@@ -1,7 +1,7 @@
 // This file is part of GNOME Games. License: GPL-3.0+.
 
 [GtkTemplate (ui = "/org/gnome/Games/ui/search-bar.ui")]
-private class Games.SearchBar : Hdy.SearchBar {
+private class Games.SearchBar : Gtk.SearchBar {
        public string text { get; private set; }
 
        [GtkChild]


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