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

d/patches: Add making the week header fit phones

Fixes #11
parent 4de13521
Pipeline #72923 passed with stages
in 4 minutes and 25 seconds
From a9934eadc2cbdbecfc5e9bf7e46094210b87bb5f Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Tue, 9 Nov 2021 11:45:15 +0100
Subject: [PATCH] week-header: Ellipsize the "Other events" label
This helps it fit phones.
---
src/gui/views/gcal-week-header.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/gui/views/gcal-week-header.c b/src/gui/views/gcal-week-header.c
index a2a78473..9f386e15 100644
--- a/src/gui/views/gcal-week-header.c
+++ b/src/gui/views/gcal-week-header.c
@@ -473,6 +473,8 @@ update_overflow (GcalWeekHeader *self)
if (!label)
{
label = gtk_label_new ("");
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_xalign (GTK_LABEL (label), 0);
gtk_grid_attach (GTK_GRID (self->grid),
label,
i,
--
2.30.2
From 541f16cd994812438e24bc96d20bd33ca73ad86b Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Tue, 9 Nov 2021 11:43:55 +0100
Subject: [PATCH] event-widget: Reduce the slanted variant width a bit
This will help it fit phones.
---
src/gui/css-code.h | 12 ++++++------
src/gui/gcal-event-widget.c | 4 ++--
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/gui/css-code.h b/src/gui/css-code.h
index a10912d0..6043dbd0 100644
--- a/src/gui/css-code.h
+++ b/src/gui/css-code.h
@@ -68,8 +68,8 @@
" background-repeat: no-repeat;"\
" background-origin: padding-box, padding-box, border-box, border-box;"\
" background-clip: padding-box, padding-box, border-box, border-box;"\
-" padding-left: 24px;"\
-" padding-right: 24px;"\
+" padding-left: 22px;"\
+" padding-right: 22px;"\
" padding-top: 3px;"\
" padding-bottom: 4px;"\
" border-radius: 0;"\
@@ -159,7 +159,7 @@
" background-clip: padding-box, border-box;"\
" border-radius: 0 2px 2px 0;"\
" padding-right: 4px;"\
-" padding-left: 24px;"\
+" padding-left: 22px;"\
" padding-top: 3px;"\
" padding-bottom: 4px;"\
"}"\
@@ -190,7 +190,7 @@
" border-bottom: 1px solid transparent; /* for the shadow displacement */"\
" background-position: right bottom, right bottom;"\
" border-radius: 2px 0 0 2px;"\
-" padding-right: 24px;"\
+" padding-right: 22px;"\
" padding-left: 4px;"\
"}"\
".color-%1$d.slanted-start:dir(rtl):backdrop {"\
@@ -224,7 +224,7 @@
" background-origin: padding-box, border-box;"\
" background-clip: padding-box, border-box;"\
" border-radius: 2px 0 0 2px;"\
-" padding-right: 24px;"\
+" padding-right: 22px;"\
" padding-left: 4px;"\
" padding-top: 3px;"\
" padding-bottom: 4px;"\
@@ -256,7 +256,7 @@
" background-position: left bottom, left bottom;"\
" border-radius: 0 2px 2px 0;"\
" padding-right: 4px;"\
-" padding-left: 24px;"\
+" padding-left: 22px;"\
"}"\
".color-%1$d.slanted-end:dir(rtl):backdrop {"\
" background-image: linear-gradient(80deg, /* left edge */"\
diff --git a/src/gui/gcal-event-widget.c b/src/gui/gcal-event-widget.c
index dd34f1c4..2ed9df60 100644
--- a/src/gui/gcal-event-widget.c
+++ b/src/gui/gcal-event-widget.c
@@ -219,8 +219,8 @@ gcal_event_widget_update_style (GcalEventWidget *self)
gtk_style_context_add_class (context, "slanted-end");
/* TODO: adjust margins based on the CSS gradients sizes, not hardcoded */
- gtk_widget_set_margin_start (self->stack, slanted_start ? 20 : 4);
- gtk_widget_set_margin_end (self->stack, slanted_end ? 20 : 4);
+ gtk_widget_set_margin_start (self->stack, slanted_start ? 18 : 4);
+ gtk_widget_set_margin_end (self->stack, slanted_end ? 18 : 4);
/* Add style classes for orientation selectors */
if (self->orientation == GTK_ORIENTATION_HORIZONTAL)
--
2.30.2
From f659d3d377a333ceea03a45e6f90825dee904a2a Mon Sep 17 00:00:00 2001
From: Adrien Plazas <kekun.plazas@laposte.net>
Date: Tue, 9 Nov 2021 11:44:45 +0100
Subject: [PATCH] event-widget: Drop even the ellipsis if it doesn't fit
This helps the widget fit phones.
---
src/gui/gcal-event-widget.ui | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/gui/gcal-event-widget.ui b/src/gui/gcal-event-widget.ui
index 1caeef65..2b45cf21 100644
--- a/src/gui/gcal-event-widget.ui
+++ b/src/gui/gcal-event-widget.ui
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalEventWidget" parent="GtkBin">
+ <child>
+ <object class="HdySqueezer">
+ <property name="visible">True</property>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
@@ -110,6 +113,14 @@
</child>
</object>
+ </child>
+ <child>
+ <object class="GtkLabel">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ </object>
+ </child>
+ </object>
</child>
</template>
</interface>
--
2.30.2
......@@ -19,3 +19,7 @@ pureos/adaptive/0012-search-button-Make-the-results-fit-phones.patch
pureos/adaptive/0013-calendar-popover-Ensure-it-fits-phones.patch
pureos/adaptive/0014-utils-Add-gcal_get_abbreviated_month_name.patch
pureos/adaptive/0015-week-header-Show-abbreviated-month-names-if-they-don.patch
pureos/adaptive/0016-week-header-Ellipsize-the-Other-events-label.patch
pureos/adaptive/0017-event-widget-Reduce-the-slanted-variant-width-a-bit.patch
pureos/adaptive/0018-event-widget-Drop-even-the-ellipsis-if-it-doesn-t-fi.patch
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment