[gnome-calendar/cdavis/gtk4-button-tweaks: 69/69] window: Use AdwButtonContent for Today button




commit 26a1761b4a199858e3383bc95a1ffea6054e5797
Author: Christopher Davis <christopherdavis gnome org>
Date:   Mon Feb 7 15:26:29 2022 -0800

    window: Use AdwButtonContent for Today button
    
    Text buttons in headerbars should come with an icon,
    or an arrow if they're a dropdown. For this, we
    have AdwButtonContent.
    
    This commit makes use of AdwButtonContent for
    the Today button, adding an icon and allowing
    for the button to be flat in the headerbar.

 src/gui/gcal-window.ui                    | 7 ++++++-
 src/gui/icons/calendar-today-symbolic.svg | 2 ++
 src/gui/icons/icons.gresource.xml         | 1 +
 3 files changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/gui/gcal-window.ui b/src/gui/gcal-window.ui
index c92a001a..9bef195a 100644
--- a/src/gui/gcal-window.ui
+++ b/src/gui/gcal-window.ui
@@ -121,8 +121,13 @@
             </child>
             <child>
               <object class="GtkButton" id="today_button">
-                <property name="label" translatable="yes">Today</property>
                 <property name="action-name">win.today</property>
+                <property name="child">
+                  <object class="AdwButtonContent">
+                    <property name="label" translatable="yes">Today</property>
+                    <property name="icon-name">calendar-today-symbolic</property>
+                  </object>
+                </property>
               </object>
             </child>
             <child>
diff --git a/src/gui/icons/calendar-today-symbolic.svg b/src/gui/icons/calendar-today-symbolic.svg
new file mode 100644
index 00000000..4dc64266
--- /dev/null
+++ b/src/gui/icons/calendar-today-symbolic.svg
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"; height="16px" viewBox="0 0 16 16" width="16px"><g 
fill="#2e3436"><path d="m 3.042969 1 c -1.128907 0 -2.042969 0.914062 -2.042969 2.042969 v 9.875 c 0 1.132812 
0.914062 2.042969 2.042969 2.042969 h 9.914062 c 1.128907 0 2.042969 -0.910157 2.042969 -2.042969 v -9.875 c 
0 -1.128907 -0.914062 -2.042969 -2.042969 -2.042969 z m -0.042969 4.960938 h 10 v 7 h -10 z m 0 0"/><path 
d="m 5 7 v 4 h 4 v -4 z m 1 1 h 2 v 2 h -2 z m 0 0"/></g></svg>
diff --git a/src/gui/icons/icons.gresource.xml b/src/gui/icons/icons.gresource.xml
index cac85aec..c0cfde45 100644
--- a/src/gui/icons/icons.gresource.xml
+++ b/src/gui/icons/icons.gresource.xml
@@ -4,5 +4,6 @@
     <file compressed="true">calendar-month-symbolic.svg</file>
     <file compressed="true">calendar-week-symbolic.svg</file>
     <file compressed="true">calendar-year-symbolic.svg</file>
+    <file compressed="true">calendar-today-symbolic.svg</file>
   </gresource>
 </gresources>


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