[gnome-games/wip/exalm/gtk4: 9/37] fixme: Remove libhandy



commit a77966acfc477f729173589edc1ac3861721c7bf
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/collection-box.ui         |  2 --
 data/ui/collection-header-bar.ui  |  2 +-
 data/ui/preferences-page.ui       |  7 ++---
 data/ui/preferences-window.ui     | 19 +++-----------
 data/ui/search-bar.ui             |  8 +++---
 flatpak/org.gnome.Games.json      | 15 -----------
 meson.build                       |  3 ---
 src/main.vala                     |  1 -
 src/meson.build                   |  1 -
 src/ui/collection-box.vala        |  3 ---
 src/ui/collection-header-bar.vala |  2 +-
 src/ui/preferences-window.vala    | 55 ++-------------------------------------
 src/ui/search-bar.vala            |  2 +-
 14 files changed, 17 insertions(+), 108 deletions(-)
---
diff --git a/data/ui/application-window.ui b/data/ui/application-window.ui
index c5d87266..802b67a0 100644
--- a/data/ui/application-window.ui
+++ b/data/ui/application-window.ui
@@ -16,14 +16,9 @@
       </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>
           </object>
-        </child>
-      </object>
     </child>
   </template>
 </interface>
diff --git a/data/ui/collection-box.ui b/data/ui/collection-box.ui
index 50fa825f..7e187a72 100644
--- a/data/ui/collection-box.ui
+++ b/data/ui/collection-box.ui
@@ -53,8 +53,6 @@
               </object>
               <packing>
                 <property name="name">platform</property>
-                <!-- FIXME: the icon is meant to be used for text formatting -->
-                <property name="icon-name">view-list-bullet-symbolic</property>
                 <property name="title" translatable="yes">Platforms</property>
               </packing>
             </child>
diff --git a/data/ui/collection-header-bar.ui b/data/ui/collection-header-bar.ui
index e9b0b7cd..1c13c749 100644
--- a/data/ui/collection-header-bar.ui
+++ b/data/ui/collection-header-bar.ui
@@ -58,7 +58,7 @@
         <property name="visible">True</property>
         <property name="transition-type">crossfade</property>
         <child>
-          <object class="HdyViewSwitcher" id="view_switcher">
+          <object class="GtkStackSwitcher" id="view_switcher">
             <property name="visible">True</property>
           </object>
         </child>
diff --git a/data/ui/preferences-page.ui b/data/ui/preferences-page.ui
index b420b53d..66256e76 100644
--- a/data/ui/preferences-page.ui
+++ b/data/ui/preferences-page.ui
@@ -15,15 +15,16 @@
                 <property name="visible">True</property>
                 <property name="vexpand">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 32d9d711..1fb792a8 100644
--- a/data/ui/preferences-window.ui
+++ b/data/ui/preferences-window.ui
@@ -7,7 +7,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">
@@ -15,16 +15,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>
@@ -81,11 +79,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>
@@ -152,10 +147,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 61ece7e1..18f24328 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>
   <requires lib="gtk+" version="3.24"/>
-  <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 280c7754..ceb582e1 100644
--- a/flatpak/org.gnome.Games.json
+++ b/flatpak/org.gnome.Games.json
@@ -179,21 +179,6 @@
                 }
             ]
         },
-        {
-            "name" : "libhandy",
-            "buildsystem" : "meson",
-            "config-opts" : [
-                "-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 39a91782..ef27b4cb 100644
--- a/meson.build
+++ b/meson.build
@@ -31,14 +31,12 @@ 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'
 
 archive_dep = dependency ('libarchive')
 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')
@@ -77,7 +75,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 139e8f6a..29d984df 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -217,7 +217,6 @@ dependencies = [
   glib_dep,
   grilo_dep,
   gtk_dep,
-  handy_dep,
   manette_dep,
   retro_gtk_dep,
   rsvg_dep,
diff --git a/src/ui/collection-box.vala b/src/ui/collection-box.vala
index de324394..1371afca 100644
--- a/src/ui/collection-box.vala
+++ b/src/ui/collection-box.vala
@@ -58,9 +58,6 @@ private class Games.CollectionBox : Gtk.Box {
                                                BindingFlags.BIDIRECTIONAL);
                loading_notification_binding = bind_property ("loading-notification", 
loading_notification_revealer, "reveal-child",
                                                              BindingFlags.DEFAULT);
-
-               var icon_name = Config.APPLICATION_ID + "-symbolic";
-               viewstack.child_set (collection_view, "icon-name", icon_name);
        }
 
        public void show_error (string error_message) {
diff --git a/src/ui/collection-header-bar.vala b/src/ui/collection-header-bar.vala
index 5f42ffcf..f2195538 100644
--- a/src/ui/collection-header-bar.vala
+++ b/src/ui/collection-header-bar.vala
@@ -30,7 +30,7 @@ private class Games.CollectionHeaderBar : Gtk.HeaderBar {
        [GtkChild]
        private Gtk.Label empty_title;
        [GtkChild]
-       private Hdy.ViewSwitcher view_switcher;
+       private Gtk.StackSwitcher view_switcher;
        [GtkChild]
        private Gtk.ToggleButton search;
        private Binding search_binding;
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]