[gnome-characters/bilelmoussaoui/gtk4: 22/27] shortcuts: use gtk's automatic way for loading it




commit cd0afbfc8b4123bd8b53e985c6b26a4ec4666475
Author: Bilal Elmoussaoui <bil elmoussaoui gmail com>
Date:   Sat Nov 20 18:02:50 2021 +0100

    shortcuts: use gtk's automatic way for loading it

 data/org.gnome.Characters.data.gresource.xml | 2 +-
 data/shortcuts.ui                            | 8 +-------
 src/window.js                                | 4 ----
 3 files changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/data/org.gnome.Characters.data.gresource.xml b/data/org.gnome.Characters.data.gresource.xml
index 5564d15..a219f7f 100644
--- a/data/org.gnome.Characters.data.gresource.xml
+++ b/data/org.gnome.Characters.data.gresource.xml
@@ -5,7 +5,7 @@
     <file preprocess="xml-stripblanks">mainwindow.ui</file>
     <file preprocess="xml-stripblanks">character.ui</file>
     <file preprocess="xml-stripblanks">characterlist.ui</file>
-    <file preprocess="xml-stripblanks">shortcuts.ui</file>
+    <file preprocess="xml-stripblanks" alias="gtk/help-overlay.ui">shortcuts.ui</file>
     <file preprocess="xml-stripblanks">menu.ui</file>
     <file preprocess="xml-stripblanks">sidebar.ui</file>
     <file>style.css</file>
diff --git a/data/shortcuts.ui b/data/shortcuts.ui
index 3ca64c7..adb19a8 100644
--- a/data/shortcuts.ui
+++ b/data/shortcuts.ui
@@ -1,40 +1,34 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <object class="GtkShortcutsWindow" id="shortcuts">
+  <object class="GtkShortcutsWindow" id="help_overlay">
     <property name="modal">True</property>
     <child>
       <object class="GtkShortcutsSection">
-        <property name="visible">1</property>
         <property name="section-name">shortcuts</property>
         <property name="max-height">10</property>
         <child>
           <object class="GtkShortcutsGroup">
-            <property name="visible">1</property>
             <property name="title" translatable="yes" context="shortcut window">General</property>
             <child>
               <object class="GtkShortcutsShortcut">
-                <property name="visible">1</property>
                 <property name="accelerator">F10</property>
                 <property name="title" translatable="yes" context="shortcut window">Open menu</property>
               </object>
             </child>
             <child>
               <object class="GtkShortcutsShortcut">
-                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;F</property>
                 <property name="title" translatable="yes" context="shortcut window">Search</property>
               </object>
             </child>
             <child>
               <object class="GtkShortcutsShortcut">
-                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;question</property>
                 <property name="title" translatable="yes" context="shortcut window">Keyboard 
shortcuts</property>
               </object>
             </child>
             <child>
               <object class="GtkShortcutsShortcut">
-                <property name="visible">1</property>
                 <property name="accelerator">&lt;ctrl&gt;Q</property>
                 <property name="title" translatable="yes" context="shortcut window">Quit</property>
               </object>
diff --git a/src/window.js b/src/window.js
index 8afe14b..fee77cf 100644
--- a/src/window.js
+++ b/src/window.js
@@ -102,10 +102,6 @@ var MainWindow = GObject.registerClass({
         this._mainView = new MainView(this._sidebar);
 
         this._container.append(this._mainView);
-        
-        let builder = Gtk.Builder.new_from_resource('/org/gnome/Characters/shortcuts.ui');
-        let helpOverlay = builder.get_object("shortcuts");
-        this.set_help_overlay(helpOverlay);
 
         // Due to limitations of gobject-introspection wrt GdkEvent
         // and GdkEventKey, this needs to be a signal handler


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