[gnome-calendar/wip/cdavis/hdyviewswitcher] gui: Use HdyViewSwitcher




commit b63970a287e250dee3b4e62f0a24e1c7483aec2f
Author: Christopher Davis <brainblasted disroot org>
Date:   Tue Feb 9 00:39:57 2021 -0800

    gui: Use HdyViewSwitcher
    
    For GNOME 40 apps should migrate to use HdyViewSwitcher.
    For now, this does not mean full adaptivity.

 src/gui/gcal-window.ui                    |  5 ++++-
 src/gui/icons/calendar-month-symbolic.svg | 11 +++++++++++
 src/gui/icons/calendar-week-symbolic.svg  | 17 +++++++++++++++++
 src/gui/icons/calendar-year-symbolic.svg  | 14 ++++++++++++++
 src/gui/icons/icons.gresource.xml         |  8 ++++++++
 src/gui/icons/meson.build                 |  5 +++++
 src/gui/meson.build                       |  1 +
 7 files changed, 60 insertions(+), 1 deletion(-)
---
diff --git a/src/gui/gcal-window.ui b/src/gui/gcal-window.ui
index b50cac7b..21370952 100644
--- a/src/gui/gcal-window.ui
+++ b/src/gui/gcal-window.ui
@@ -45,6 +45,7 @@
                       <packing>
                         <property name="name">week</property>
                         <property name="title" translatable="yes">Week</property>
+                        <property name="icon_name">calendar-week-symbolic</property>
                       </packing>
                     </child>
                     <child>
@@ -60,6 +61,7 @@
                         <property name="position">1</property>
                         <property name="name">month</property>
                         <property name="title" translatable="yes">Month</property>
+                        <property name="icon_name">calendar-month-symbolic</property>
                       </packing>
                     </child>
                     <child>
@@ -74,6 +76,7 @@
                         <property name="position">2</property>
                         <property name="name">year</property>
                         <property name="title" translatable="yes">Year</property>
+                        <property name="icon_name">calendar-year-symbolic</property>
                       </packing>
                     </child>
                   </object>
@@ -234,7 +237,7 @@
               </object>
             </child>
             <child type="title">
-              <object class="GtkStackSwitcher" id="views_switcher">
+              <object class="HdyViewSwitcher" id="views_switcher">
                 <property name="visible">True</property>
                 <property name="stack">views_stack</property>
               </object>
diff --git a/src/gui/icons/calendar-month-symbolic.svg b/src/gui/icons/calendar-month-symbolic.svg
new file mode 100644
index 00000000..029c9525
--- /dev/null
+++ b/src/gui/icons/calendar-month-symbolic.svg
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; width="16px" 
height="16px" viewBox="0 0 16 16" version="1.1">
+<g id="surface19818">
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
3.042969 1 C 1.914062 1 1 1.914062 1 3.042969 L 1 12.917969 C 1 14.050781 1.914062 14.960938 3.042969 
14.960938 L 12.957031 14.960938 C 14.085938 14.960938 15 14.050781 15 12.917969 L 15 3.042969 C 15 1.914062 
14.085938 1 12.957031 1 Z M 3 5.960938 L 13 5.960938 L 13 12.960938 L 3 12.960938 Z M 3 5.960938 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
4 10 L 6 10 L 6 12 L 4 12 Z M 4 10 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
7 10 L 9 10 L 9 12 L 7 12 Z M 7 10 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
10 7 L 12 7 L 12 9 L 10 9 Z M 10 7 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
7 7 L 9 7 L 9 9 L 7 9 Z M 7 7 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
4 7 L 6 7 L 6 9 L 4 9 Z M 4 7 "/>
+</g>
+</svg>
diff --git a/src/gui/icons/calendar-week-symbolic.svg b/src/gui/icons/calendar-week-symbolic.svg
new file mode 100644
index 00000000..b8154e8e
--- /dev/null
+++ b/src/gui/icons/calendar-week-symbolic.svg
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; width="16px" 
height="16px" viewBox="0 0 16 16" version="1.1">
+<g id="surface19812">
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
2 3 L 4 3 C 4.550781 3 5 3.449219 5 4 C 5 4.550781 4.550781 5 4 5 L 2 5 C 1.449219 5 1 4.550781 1 4 C 1 
3.449219 1.449219 3 2 3 Z M 2 3 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
7 3 L 9 3 C 9.550781 3 10 3.449219 10 4 C 10 4.550781 9.550781 5 9 5 L 7 5 C 6.449219 5 6 4.550781 6 4 C 6 
3.449219 6.449219 3 7 3 Z M 7 3 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
12 3 L 14 3 C 14.550781 3 15 3.449219 15 4 C 15 4.550781 14.550781 5 14 5 L 12 5 C 11.449219 5 11 4.550781 11 
4 C 11 3.449219 11.449219 3 12 3 Z M 12 3 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
1 7 L 5 7 L 5 8 L 1 8 Z M 1 7 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
1 10 L 5 10 L 5 11 L 1 11 Z M 1 10 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
1 13 L 5 13 L 5 14 L 1 14 Z M 1 13 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
6 7 L 10 7 L 10 8 L 6 8 Z M 6 7 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
6 10 L 10 10 L 10 11 L 6 11 Z M 6 10 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
6 13 L 10 13 L 10 14 L 6 14 Z M 6 13 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
11 7 L 15 7 L 15 8 L 11 8 Z M 11 7 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
11 10 L 15 10 L 15 11 L 11 11 Z M 11 10 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
11 13 L 15 13 L 15 14 L 11 14 Z M 11 13 "/>
+</g>
+</svg>
diff --git a/src/gui/icons/calendar-year-symbolic.svg b/src/gui/icons/calendar-year-symbolic.svg
new file mode 100644
index 00000000..ff8eb210
--- /dev/null
+++ b/src/gui/icons/calendar-year-symbolic.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg xmlns="http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; width="16px" 
height="16px" viewBox="0 0 16 16" version="1.1">
+<g id="surface19824">
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
1 1 L 5 1 L 5 5 L 1 5 Z M 1 1 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
6 1 L 10 1 L 10 5 L 6 5 Z M 6 1 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
11 1 L 15 1 L 15 5 L 11 5 Z M 11 1 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
1 6 L 5 6 L 5 10 L 1 10 Z M 1 6 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
6 6 L 10 6 L 10 10 L 6 10 Z M 6 6 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
11 6 L 15 6 L 15 10 L 11 10 Z M 11 6 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
1 11 L 5 11 L 5 15 L 1 15 Z M 1 11 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
6 11 L 10 11 L 10 15 L 6 15 Z M 6 11 "/>
+<path style=" stroke:none;fill-rule:nonzero;fill:rgb(18.039216%,20.392157%,21.176471%);fill-opacity:1;" d="M 
11 11 L 15 11 L 15 15 L 11 15 Z M 11 11 "/>
+</g>
+</svg>
diff --git a/src/gui/icons/icons.gresource.xml b/src/gui/icons/icons.gresource.xml
new file mode 100644
index 00000000..b6357088
--- /dev/null
+++ b/src/gui/icons/icons.gresource.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<gresources>
+  <gresource prefix="/org/gnome/calendar/icons">
+    <file compressed="true">calendar-month-symbolic.svg</file>
+    <file compressed="true">calendar-week-symbolic.svg</file>
+    <file compressed="true">calendar-year-symbolic.svg</file>
+  </gresource>
+</gresources>
diff --git a/src/gui/icons/meson.build b/src/gui/icons/meson.build
new file mode 100644
index 00000000..a081f0e7
--- /dev/null
+++ b/src/gui/icons/meson.build
@@ -0,0 +1,5 @@
+built_sources += gnome.compile_resources(
+  'icon-resources',
+  'icons.gresource.xml',
+  c_name: 'icons',
+)
diff --git a/src/gui/meson.build b/src/gui/meson.build
index 12e5616e..d4f55962 100644
--- a/src/gui/meson.build
+++ b/src/gui/meson.build
@@ -1,6 +1,7 @@
 subdir('calendar-management')
 subdir('event-editor')
 subdir('gtk')
+subdir('icons')
 subdir('views')
 
 calendar_incs +=  include_directories('.')


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