Commit b65a343c authored by Adrien Plazas's avatar Adrien Plazas
Browse files

Merge branch 'pureos/byzantium-adaptive' into 'pureos/byzantium'

Make it adaptive

See merge request Librem5/gnome-calendar!1
parents f77716b6 a41efe8b
gnome-calendar (41.0-1pureos1) byzantium; urgency=medium
[ Adrien Plazas ]
* debian: Bump glib down to 2.66.8
* debian: Bump gweather down to 3.27.2
* debian: Add patches to make the application adaptive
-- Adrien Plazas <adrien.plazas@puri.sm> Fri, 12 Oct 2021 13:06:00 +0200
gnome-calendar (41.0-1) unstable; urgency=medium
* Team upload
......
......@@ -19,10 +19,10 @@ Build-Depends: appstream-util,
libhandy-1-dev (>= 1.0.0),
libgeoclue-2-dev (>= 2.4),
libgeocode-glib-dev (>= 3.23),
libglib2.0-dev (>= 2.67.5),
libglib2.0-dev (>= 2.66.8),
libgoa-1.0-dev (>= 3.2.0),
libgtk-3-dev (>= 3.22.20),
libgweather-3-dev (>= 40.0),
libgweather-3-dev (>= 3.27.2),
libical-dev (>= 1.0.1),
libsoup2.4-dev,
meson (>= 0.53.0),
......
......@@ -15,10 +15,10 @@ Build-Depends: appstream-util,
libhandy-1-dev (>= 1.0.0),
libgeoclue-2-dev (>= 2.4),
libgeocode-glib-dev (>= 3.23),
libglib2.0-dev (>= 2.67.5),
libglib2.0-dev (>= 2.66.8),
libgoa-1.0-dev (>= 3.2.0),
libgtk-3-dev (>= 3.22.20),
libgweather-3-dev (>= 40.0),
libgweather-3-dev (>= 3.27.2),
libical-dev (>= 1.0.1),
libsoup2.4-dev,
meson (>= 0.53.0),
......
From b2701547c84ee93be4dc7ac9f5a698f1c6eed079 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Mon, 11 Oct 2021 14:03:44 +0200
Subject: [PATCH] Add calendar-today-symbolic
---
src/gui/icons/calendar-today-symbolic.svg | 1 +
src/gui/icons/icons.gresource.xml | 1 +
2 files changed, 2 insertions(+)
create mode 100644 src/gui/icons/calendar-today-symbolic.svg
diff --git a/src/gui/icons/calendar-today-symbolic.svg b/src/gui/icons/calendar-today-symbolic.svg
new file mode 100644
index 00000000..3a5165d0
--- /dev/null
+++ b/src/gui/icons/calendar-today-symbolic.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="15.974" height="16"><path d="M7 0v1.031A6.514 6.514 0 001.063 7H0v1h1.063A6.513 6.513 0 007 13.969V15h1v-1.031c3.188-.234 5.724-2.78 5.969-5.969H15V7h-1.03C13.724 3.811 11.189 1.233 8 1V0zm.531 2.813A4.665 4.665 0 0112.22 7.5a4.665 4.665 0 01-4.688 4.688c-2.606 0-4.75-2.082-4.75-4.688s2.144-4.688 4.75-4.688zM7.501 4a3.5 3.5 0 100 7 3.5 3.5 0 000-7z" style="marker:none" color="#000" overflow="visible" fill="#474747"/></svg>
\ No newline at end of file
diff --git a/src/gui/icons/icons.gresource.xml b/src/gui/icons/icons.gresource.xml
index cac85aec..0735cc65 100644
--- a/src/gui/icons/icons.gresource.xml
+++ b/src/gui/icons/icons.gresource.xml
@@ -2,6 +2,7 @@
<gresources>
<gresource prefix="/org/gnome/calendar/icons/scalable/emblems/">
<file compressed="true">calendar-month-symbolic.svg</file>
+ <file compressed="true">calendar-today-symbolic.svg</file>
<file compressed="true">calendar-week-symbolic.svg</file>
<file compressed="true">calendar-year-symbolic.svg</file>
</gresource>
--
2.30.2
From 28313b50da160881f24ae28c8f25fcc4a8ee33bd Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Mon, 11 Oct 2021 14:07:59 +0200
Subject: [PATCH] window: Move the today button towards the center
This will help making it adaptive.
---
src/gui/gcal-window.ui | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/gui/gcal-window.ui b/src/gui/gcal-window.ui
index 46ea361a..3434ce54 100644
--- a/src/gui/gcal-window.ui
+++ b/src/gui/gcal-window.ui
@@ -185,18 +185,6 @@
</child>
</object>
</child>
- <child>
- <object class="GtkButton" id="today_button">
- <property name="label" translatable="yes">Today</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="action-name">win.today</property>
- <accelerator key="t" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
- <accelerator key="Down" modifiers="GDK_MOD1_MASK" signal="clicked"/>
- <accelerator key="Home" signal="clicked"/>
- </object>
- </child>
<child>
<object class="GtkBox" id="button_box">
<property name="visible">True</property>
@@ -237,6 +225,18 @@
</style>
</object>
</child>
+ <child>
+ <object class="GtkButton" id="today_button">
+ <property name="label" translatable="yes">Today</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="action-name">win.today</property>
+ <accelerator key="t" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
+ <accelerator key="Down" modifiers="GDK_MOD1_MASK" signal="clicked"/>
+ <accelerator key="Home" signal="clicked"/>
+ </object>
+ </child>
<child type="title">
<object class="HdyViewSwitcher" id="views_switcher">
<property name="visible">True</property>
--
2.30.2
From 0c284ee7945c9db73aa307d33be5ac855073ed46 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Mon, 11 Oct 2021 14:09:54 +0200
Subject: [PATCH] window: Make the Today button adaptive
This makes the Today button use an icon when the window is narrow,
allowing it to reach narrower widths.
---
src/gui/gcal-window.ui | 46 ++++++++++++++++++++++++++++++++++--------
1 file changed, 38 insertions(+), 8 deletions(-)
diff --git a/src/gui/gcal-window.ui b/src/gui/gcal-window.ui
index 3434ce54..13e94976 100644
--- a/src/gui/gcal-window.ui
+++ b/src/gui/gcal-window.ui
@@ -226,15 +226,45 @@
</object>
</child>
<child>
- <object class="GtkButton" id="today_button">
- <property name="label" translatable="yes">Today</property>
+ <object class="HdySqueezer" id="today_button">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="action-name">win.today</property>
- <accelerator key="t" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
- <accelerator key="Down" modifiers="GDK_MOD1_MASK" signal="clicked"/>
- <accelerator key="Home" signal="clicked"/>
+ <property name="transition-type">crossfade</property>
+ <property name="xalign">0</property>
+ <child>
+ <object class="GtkButton">
+ <property name="label" translatable="yes">Today</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="action-name">win.today</property>
+ <property name="sensitive" bind-source="today_button" bind-property="sensitive" bind-flags="sync-create"/>
+ <accelerator key="t" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
+ <accelerator key="Down" modifiers="GDK_MOD1_MASK" signal="clicked"/>
+ <accelerator key="Home" signal="clicked"/>
+ </object>
+ </child>
+ <child>
+ <object class="GtkButton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="action-name">win.today</property>
+ <property name="sensitive" bind-source="today_button" bind-property="sensitive" bind-flags="sync-create"/>
+ <property name="halign">start</property>
+ <accelerator key="t" modifiers="GDK_CONTROL_MASK" signal="clicked"/>
+ <accelerator key="Down" modifiers="GDK_MOD1_MASK" signal="clicked"/>
+ <accelerator key="Home" signal="clicked"/>
+ <style>
+ <class name="image-button"/>
+ </style>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="icon_name">calendar-today-symbolic</property>
+ </object>
+ </child>
+ </object>
+ </child>
</object>
</child>
<child type="title">
--
2.30.2
From d8979d2c70ed3def6ea4d6dcad5762644a6326b2 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Mon, 11 Oct 2021 12:59:31 +0200
Subject: [PATCH] window: Strictly center the view switcher
This simply looks better.
---
src/gui/gcal-window.ui | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/gui/gcal-window.ui b/src/gui/gcal-window.ui
index 13e94976..af40fe87 100644
--- a/src/gui/gcal-window.ui
+++ b/src/gui/gcal-window.ui
@@ -170,6 +170,7 @@
<object class="HdyHeaderBar" id="header_bar">
<property name="visible">True</property>
<property name="show_close_button">True</property>
+ <property name="centering-policy">strict</property>
<property name="title" translatable="yes">Calendar</property>
<child>
<object class="GtkButton" id="new_event_button">
--
2.30.2
From 8f5f3b596e2282389c4393ad01f11fde60f776cd Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Mon, 11 Oct 2021 12:28:15 +0200
Subject: [PATCH] window: Relocate the view switcher to the bottom when narrow
This will help reaching narrower widths.
---
src/gui/gcal-window.c | 23 +++++++++++++++++++++++
src/gui/gcal-window.ui | 26 ++++++++++++++++++++++++--
2 files changed, 47 insertions(+), 2 deletions(-)
diff --git a/src/gui/gcal-window.c b/src/gui/gcal-window.c
index 75e937ab..abb4392f 100644
--- a/src/gui/gcal-window.c
+++ b/src/gui/gcal-window.c
@@ -117,6 +117,8 @@ struct _GcalWindow
GtkWidget *menu_button;
GtkWidget *today_button;
GtkWidget *views_switcher;
+ GtkWidget *views_switcher_bar;
+ GtkWidget *views_switcher_squeezer;
GcalEventEditorDialog *event_editor;
GtkWidget *import_dialog;
@@ -197,6 +199,20 @@ static GParamSpec* properties[N_PROPS] = { NULL, };
* Auxiliary methods
*/
+static void
+update_views_switcher_bar_revealed (GcalWindow *window)
+{
+ gboolean revealed = hdy_squeezer_get_visible_child (HDY_SQUEEZER (window->views_switcher_squeezer)) != (GtkWidget *) window->views_switcher;
+
+ hdy_view_switcher_bar_set_reveal (HDY_VIEW_SWITCHER_BAR (window->views_switcher_bar), revealed);
+}
+
+static void
+notify_views_switcher_squeezer_visible_child_cb (GcalWindow *window)
+{
+ update_views_switcher_bar_revealed (window);
+}
+
static void
update_today_button_sensitive (GcalWindow *window)
{
@@ -1133,6 +1149,8 @@ gcal_window_class_init (GcalWindowClass *klass)
gtk_widget_class_bind_template_child (widget_class, GcalWindow, views_overlay);
gtk_widget_class_bind_template_child (widget_class, GcalWindow, views_stack);
gtk_widget_class_bind_template_child (widget_class, GcalWindow, views_switcher);
+ gtk_widget_class_bind_template_child (widget_class, GcalWindow, views_switcher_bar);
+ gtk_widget_class_bind_template_child (widget_class, GcalWindow, views_switcher_squeezer);
gtk_widget_class_bind_template_child (widget_class, GcalWindow, weather_settings);
gtk_widget_class_bind_template_child (widget_class, GcalWindow, week_view);
gtk_widget_class_bind_template_child (widget_class, GcalWindow, year_view);
@@ -1144,6 +1162,9 @@ gcal_window_class_init (GcalWindowClass *klass)
gtk_widget_class_bind_template_callback (widget_class, view_changed);
+ /* Adaptiveness related */
+ gtk_widget_class_bind_template_callback (widget_class, notify_views_switcher_squeezer_visible_child_cb);
+
/* Event removal related */
gtk_widget_class_bind_template_callback (widget_class, hide_notification);
gtk_widget_class_bind_template_callback (widget_class, remove_event);
@@ -1221,6 +1242,8 @@ gcal_window_init (GcalWindow *self)
gcal_window_add_accelerator (app, "win.change-view(2)", "<Ctrl>3");
gcal_window_add_accelerator (app, "app.quit", "<Ctrl>q");
gcal_window_add_accelerator (app, "win.new-event", "<Ctrl>n");
+
+ update_views_switcher_bar_revealed (self);
}
/**
diff --git a/src/gui/gcal-window.ui b/src/gui/gcal-window.ui
index af40fe87..c54ef0fd 100644
--- a/src/gui/gcal-window.ui
+++ b/src/gui/gcal-window.ui
@@ -15,6 +15,15 @@
<object class="GtkBox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
+ <child>
+ <object class="HdyViewSwitcherBar" id="views_switcher_bar">
+ <property name="visible">True</property>
+ <property name="stack">views_stack</property>
+ </object>
+ <packing>
+ <property name="pack_type">end</property>
+ </packing>
+ </child>
<child>
<object class="GtkOverlay" id="views_overlay">
<property name="visible">True</property>
@@ -269,9 +278,22 @@
</object>
</child>
<child type="title">
- <object class="HdyViewSwitcher" id="views_switcher">
+ <object class="HdySqueezer" id="views_switcher_squeezer">
+ <property name="transition-type">crossfade</property>
<property name="visible">True</property>
- <property name="stack">views_stack</property>
+ <property name="no-show-all">True</property>
+ <signal name="notify::visible-child" handler="notify_views_switcher_squeezer_visible_child_cb" swapped="yes"/>
+ <child>
+ <object class="HdyViewSwitcher" id="views_switcher">
+ <property name="visible">True</property>
+ <property name="stack">views_stack</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ </object>
+ </child>
</object>
</child>
<child>
--
2.30.2
From efea047a4cf55852eae77a364994733af4c56886 Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Mon, 11 Oct 2021 14:41:34 +0200
Subject: [PATCH] event-widget: Wrap by word
This makes the events somewhat readable when extremely narrow.
---
src/gui/gcal-event-widget.ui | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/gui/gcal-event-widget.ui b/src/gui/gcal-event-widget.ui
index 53a6f04a..1caeef65 100644
--- a/src/gui/gcal-event-widget.ui
+++ b/src/gui/gcal-event-widget.ui
@@ -94,9 +94,9 @@
<property name="can_focus">False</property>
<property name="label" bind-source="summary_label" bind-property="label" bind-flags="default" />
<property name="wrap">True</property>
+ <property name="wrap-mode">char</property>
<property name="hexpand">True</property>
<property name="xalign">0.0</property>
- <property name="ellipsize">end</property>
</object>
<packing>
<property name="left_attach">0</property>
--
2.30.2
From 9e63b576cdbfea833c3b5bb01b1a28cebba6817e Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Mon, 11 Oct 2021 14:58:56 +0200
Subject: [PATCH] event-editor-dialog: Use HdyPreferencesGroup and
HdyPreferencesPage
This helps simplifying the code a bit and standardizing it with the rest
of GNOME.
---
.../event-editor/gcal-event-editor-dialog.c | 5 --
.../event-editor/gcal-event-editor-dialog.ui | 87 +++++++------------
2 files changed, 29 insertions(+), 63 deletions(-)
diff --git a/src/gui/event-editor/gcal-event-editor-dialog.c b/src/gui/event-editor/gcal-event-editor-dialog.c
index 0d9eb085..e2f04234 100644
--- a/src/gui/event-editor/gcal-event-editor-dialog.c
+++ b/src/gui/event-editor/gcal-event-editor-dialog.c
@@ -58,7 +58,6 @@ struct _GcalEventEditorDialog
GcalEventEditorSection *notes_section;
GcalEventEditorSection *reminders_section;
GcalEventEditorSection *schedule_section;
- GtkWidget *scrolled_window;
GtkWidget *sources_button;
GtkWidget *sources_popover;
GtkWidget *source_image;
@@ -272,9 +271,6 @@ transient_size_allocate_cb (GcalEventEditorDialog *self)
transient = gtk_window_get_transient_for (GTK_WINDOW (self));
gtk_widget_get_allocation (GTK_WIDGET (transient), &alloc);
-
- gtk_scrolled_window_set_max_content_height (GTK_SCROLLED_WINDOW (self->scrolled_window),
- MAX (400, (gint) (0.75 * alloc.height)));
}
static void
@@ -542,7 +538,6 @@ gcal_event_editor_dialog_class_init (GcalEventEditorDialogClass *klass)
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, notes_section);
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, reminders_section);
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, schedule_section);
- gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, scrolled_window);
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, sources_button);
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, sources_popover);
gtk_widget_class_bind_template_child (widget_class, GcalEventEditorDialog, source_image);
diff --git a/src/gui/event-editor/gcal-event-editor-dialog.ui b/src/gui/event-editor/gcal-event-editor-dialog.ui
index d7583121..7c069876 100644
--- a/src/gui/event-editor/gcal-event-editor-dialog.ui
+++ b/src/gui/event-editor/gcal-event-editor-dialog.ui
@@ -2,9 +2,10 @@
<interface>
<template class="GcalEventEditorDialog" parent="GtkDialog">
<property name="can_focus">False</property>
- <property name="resizable">False</property>
+ <property name="resizable">True</property>
<property name="modal">True</property>
<property name="default-width">450</property>
+ <property name="default-height">500</property>
<property name="window_position">center-on-parent</property>
<property name="use_header_bar">1</property>
<property name="destroy_with_parent">True</property>
@@ -126,93 +127,64 @@
<property name="spacing">0</property>
<property name="border_width">0</property>
<child>
- <object class="GtkScrolledWindow" id="scrolled_window">
+ <object class="HdyPreferencesPage">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hscrollbar_policy">never</property>
- <property name="min_content_height">400</property>
- <property name="propagate_natural_height">true</property>
+ <property name="vexpand">True</property>
+
<child>
- <object class="GtkBox">
+ <object class="HdyPreferencesGroup">
<property name="visible">True</property>
- <property name="margin">18</property>
- <property name="spacing">12</property>
- <property name="orientation">vertical</property>
-
- <!-- Summary -->
<child>
<object class="GcalSummarySection" id="summary_section">
<property name="visible">True</property>
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
</object>
</child>
+ </object>
+ </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="margin-top">12</property>
- <property name="xalign">0.0</property>
- <property name="label" translatable="yes">Schedule</property>
- <attributes>
- <attribute name="weight" value="bold" />
- </attributes>
- </object>
- </child>
-
+ <child>
+ <object class="HdyPreferencesGroup">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Schedule</property>
<child>
<object class="GcalScheduleSection" id="schedule_section">
<property name="visible">True</property>
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
</object>
</child>
+ </object>
+ </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="margin-top">12</property>
- <property name="xalign">0.0</property>
- <property name="label" translatable="yes">Reminders</property>
- <attributes>
- <attribute name="weight" value="bold" />
- </attributes>
- </object>
- </child>
-
- <!-- Reminders -->
+ <child>
+ <object class="HdyPreferencesGroup">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Reminders</property>
<child>
<object class="GcalRemindersSection" id="reminders_section">
<property name="visible">True</property>
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
</object>
</child>
+ </object>
+ </child>
- <!-- Notes -->
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hexpand">True</property>
- <property name="margin-top">12</property>
- <property name="xalign">0.0</property>
- <property name="label" translatable="yes">Notes</property>
- <attributes>
- <attribute name="weight" value="bold" />
- </attributes>
- </object>
- </child>
-
+ <child>
+ <object class="HdyPreferencesGroup">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Notes</property>
<child>
<object class="GcalNotesSection" id="notes_section">
<property name="visible">True</property>
<property name="sensitive" bind-source="GcalEventEditorDialog" bind-property="writable" bind-flags="default" />
</object>
</child>
+ </object>
+ </child>
- <!-- Delete Button -->
+ <child>
+ <object class="HdyPreferencesGroup">
+ <property name="visible">True</property>
<child>
<object class="GtkButton" id="delete_button">
<property name="visible">True</property>
@@ -231,7 +203,6 @@
</style>
</object>
</child>
-
</object>
</child>
--
2.30.2
From b0b489ce3ed26e59eca24ed4c164bd841fe3a92c Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Mon, 11 Oct 2021 15:46:20 +0200
Subject: [PATCH] event-editor-dialog: Better style sections
This gives them rounded corners and separators.
---
src/gui/event-editor/gcal-notes-section.ui | 4 ++++
src/gui/event-editor/gcal-reminders-section.ui | 8 ++++----
src/gui/event-editor/gcal-schedule-section.ui | 2 +-
src/gui/event-editor/gcal-summary-section.ui | 2 +-
src/theme/Adwaita.css | 15 +++++++++++++++
5 files changed, 25 insertions(+), 6 deletions(-)