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.
This commit is contained in:
committed by
Georges Basile Stavracas Neto
parent
ca0a5de0f9
commit
2baa96d29f
@@ -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");
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user