[devhelp] window: Add toggle button for the side panel



commit 8d94412478541501785448ee4d88180ba56e645d
Author: Manuel Wassermann <manuel wassermann97 gmail com>
Date:   Wed Jul 21 05:48:12 2021 +0200

    window: Add toggle button for the side panel

 data/icons/view-left-pane-symbolic.svg |  6 ++++++
 src/dh-window.ui                       | 20 ++++++++++++++++++++
 src/dh.gresource.xml                   |  3 +++
 3 files changed, 29 insertions(+)
---
diff --git a/data/icons/view-left-pane-symbolic.svg b/data/icons/view-left-pane-symbolic.svg
new file mode 100644
index 00000000..b0b8449f
--- /dev/null
+++ b/data/icons/view-left-pane-symbolic.svg
@@ -0,0 +1,6 @@
+<svg xmlns="http://www.w3.org/2000/svg"; width="16" height="16">
+    <g color="#000" fill="#2e3436">
+        <path d="M15.012 1h-14v14h14zm-1 1v12h-12V2z" 
style="line-height:normal;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000;text-transform:none;text-orientation:mixed;shape-padding:0;isolation:auto;mix-blend-mode:normal;marker:none"
 font-weight="400" font-family="sans-serif" white-space="normal" overflow="visible"/>
+        <path d="M5.014 2.95v10.032H2.98V2.95z" style="marker:none" overflow="visible"/>
+    </g>
+</svg>
diff --git a/src/dh-window.ui b/src/dh-window.ui
index 038a22cd..934b8ac2 100644
--- a/src/dh-window.ui
+++ b/src/dh-window.ui
@@ -118,6 +118,26 @@
             <property name="pack_type">start</property>
           </packing>
         </child>
+        <child>
+          <object class="GtkToggleButton" id="sidebar_button">
+            <property name="active">True</property>
+            <property name="visible">True</property>
+            <property name="valign">center</property>
+            <property name="can_focus">False</property>
+            <property name="tooltip_text" translatable="yes">Toggle Side Panel</property>
+            <property name="action_name">win.show-sidebar</property>
+            <style>
+              <class name="image-button"/>
+            </style>
+            <child>
+              <object class="GtkImage" id="sidebar_button_image">
+                <property name="visible">True</property>
+                <property name="icon_size">1</property>
+                <property name="icon_name">view-left-pane-symbolic</property>
+              </object>
+            </child>
+          </object>
+        </child>
         <child>
           <object class="GtkMenuButton" id="window_menu_button">
             <property name="visible">True</property>
diff --git a/src/dh.gresource.xml b/src/dh.gresource.xml
index b8d494f0..3bd13bd8 100644
--- a/src/dh.gresource.xml
+++ b/src/dh.gresource.xml
@@ -16,4 +16,7 @@
   <gresource prefix="/org/gnome/devhelp/gtk">
     <file preprocess="xml-stripblanks">help-overlay.ui</file>
   </gresource>
+  <gresource prefix="/org/gnome/devhelp/icons">
+    <file  preprocess="xml-stripblanks" 
alias="scalable/actions/view-left-pane-symbolic.svg">../data/icons/view-left-pane-symbolic.svg</file>
+  </gresource>
 </gresources>


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