[gnome-calendar] event-widget: Properly overflow
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar] event-widget: Properly overflow
- Date: Wed, 15 Jun 2022 14:41:38 +0000 (UTC)
commit 2baa96d29fe507b7a802122aa7c654e522c29e10
Author: Adrien Plazas <kekun plazas laposte net>
Date: Thu May 5 12:45:28 2022 +0200
event-widget: Properly overflow
This explicitely allows the hour widget and the content as a whole to
overflow horizontally, and hides what overflows, keeping the data within
the boundaries of the widget while still allowing it to reach very
narrow sizes without error messages.
This purposefully leaves the indentation broken to help reviewing the
actual changes.
src/gui/gcal-event-widget.c | 3 +++
src/gui/gcal-event-widget.ui | 13 +++++++++++++
2 files changed, 16 insertions(+)
---
diff --git a/src/gui/gcal-event-widget.c b/src/gui/gcal-event-widget.c
index 3132e6c9..b713cad1 100644
--- a/src/gui/gcal-event-widget.c
+++ b/src/gui/gcal-event-widget.c
@@ -28,6 +28,7 @@
#include "gcal-debug.h"
#include "gcal-event-popover.h"
#include "gcal-event-widget.h"
+#include "gcal-overflow-bin.h"
#include "gcal-utils.h"
#define DESC_MAX_CHAR 200
@@ -759,6 +760,8 @@ gcal_event_widget_init (GcalEventWidget *self)
widget = GTK_WIDGET (self);
self->clock_format_24h = is_clock_format_24h ();
+ g_type_ensure (GCAL_TYPE_OVERFLOW_BIN);
+
gtk_widget_init_template (widget);
gtk_widget_set_cursor_from_name (GTK_WIDGET (self), "pointer");
diff --git a/src/gui/gcal-event-widget.ui b/src/gui/gcal-event-widget.ui
index 318c0e8c..d97e0cd0 100644
--- a/src/gui/gcal-event-widget.ui
+++ b/src/gui/gcal-event-widget.ui
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="GcalEventWidget" parent="GtkWidget">
+ <property name="overflow">hidden</property>
<!-- Drag Source -->
<child>
@@ -19,6 +20,11 @@
</object>
</child>
+ <!-- Overflow Bin -->
+ <child>
+ <object class="GcalOverflowBin">
+ <property name="request-mode">width-for-height</property>
+
<!-- Main Stack -->
<child>
<object class="AdwSqueezer" id="squeezer">
@@ -40,6 +46,9 @@
</closure>
</binding>
<property name="orientation">vertical</property>
+ <child>
+ <object class="GcalOverflowBin">
+ <property name="request-mode">width-for-height</property>
<child>
<object class="GtkLabel">
<property name="label" bind-source="hour_label" bind-property="label" bind-flags="default" />
@@ -48,6 +57,8 @@
<class name="dim-label" />
</style>
</object>
+ </child>
+ </object>
</child>
<child>
<object class="GtkLabel">
@@ -95,5 +106,7 @@
</object>
</child>
+ </object>
+ </child>
</template>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]