src/gui: Fade out event widget title label instead of ellipsizing
Co-Authored-By: Titouan Real <titouan.real@gmail.com> Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/657>
This commit is contained in:
committed by
Georges Basile Stavracas Neto
co-authored by
Titouan Real
parent
bd4d503080
commit
4e2ed18ffc
@@ -51,7 +51,7 @@ template $GcalEventWidget: Widget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Inscription {
|
Inscription {
|
||||||
text: bind summary_inscription.text no-sync-create;
|
text: bind summary_label.label;
|
||||||
hexpand: true;
|
hexpand: true;
|
||||||
vexpand: true;
|
vexpand: true;
|
||||||
xalign: 0.0;
|
xalign: 0.0;
|
||||||
@@ -64,14 +64,13 @@ template $GcalEventWidget: Widget {
|
|||||||
Box horizontal_box {
|
Box horizontal_box {
|
||||||
spacing: 4;
|
spacing: 4;
|
||||||
|
|
||||||
Inscription summary_inscription {
|
$GcalFadingLabel summary_label {}
|
||||||
hexpand: true;
|
|
||||||
xalign: 0.0;
|
|
||||||
min-lines: 1;
|
|
||||||
text-overflow: ellipsize_end;
|
|
||||||
}
|
|
||||||
|
|
||||||
Label timestamp_label {
|
Label timestamp_label {
|
||||||
|
halign: end;
|
||||||
|
hexpand: true;
|
||||||
|
vexpand: true;
|
||||||
|
|
||||||
styles [
|
styles [
|
||||||
"dimmed",
|
"dimmed",
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include <glib/gi18n.h>
|
#include <glib/gi18n.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "gcal-fading-label.h"
|
||||||
#include "gcal-application.h"
|
#include "gcal-application.h"
|
||||||
#include "gcal-context.h"
|
#include "gcal-context.h"
|
||||||
#include "gcal-clock.h"
|
#include "gcal-clock.h"
|
||||||
@@ -56,7 +57,7 @@ struct _GcalEventWidget
|
|||||||
GtkWidget *timestamp_label;
|
GtkWidget *timestamp_label;
|
||||||
GtkWidget *edge;
|
GtkWidget *edge;
|
||||||
GtkWidget *overflow_bin;
|
GtkWidget *overflow_bin;
|
||||||
GtkWidget *summary_inscription;
|
GtkWidget *summary_label;
|
||||||
GtkWidget *vertical_box;
|
GtkWidget *vertical_box;
|
||||||
GtkEventController *drag_source;
|
GtkEventController *drag_source;
|
||||||
GtkWidget *preview_popover;
|
GtkWidget *preview_popover;
|
||||||
@@ -523,8 +524,8 @@ gcal_event_widget_set_event_internal (GcalEventWidget *self,
|
|||||||
/* Summary label */
|
/* Summary label */
|
||||||
g_object_bind_property (event,
|
g_object_bind_property (event,
|
||||||
"summary",
|
"summary",
|
||||||
self->summary_inscription,
|
self->summary_label,
|
||||||
"text",
|
"label",
|
||||||
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
G_BINDING_DEFAULT | G_BINDING_SYNC_CREATE);
|
||||||
|
|
||||||
g_object_bind_property_full (gcal_event_get_calendar (event),
|
g_object_bind_property_full (gcal_event_get_calendar (event),
|
||||||
@@ -753,6 +754,8 @@ gcal_event_widget_class_init (GcalEventWidgetClass *klass)
|
|||||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
|
||||||
|
|
||||||
|
g_type_ensure (GCAL_TYPE_FADING_LABEL);
|
||||||
|
|
||||||
object_class->set_property = gcal_event_widget_set_property;
|
object_class->set_property = gcal_event_widget_set_property;
|
||||||
object_class->get_property = gcal_event_widget_get_property;
|
object_class->get_property = gcal_event_widget_get_property;
|
||||||
object_class->dispose = gcal_event_widget_dispose;
|
object_class->dispose = gcal_event_widget_dispose;
|
||||||
@@ -849,7 +852,7 @@ gcal_event_widget_class_init (GcalEventWidgetClass *klass)
|
|||||||
gtk_widget_class_bind_template_child (widget_class, GcalEventWidget, edge);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventWidget, edge);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEventWidget, overflow_bin);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventWidget, overflow_bin);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEventWidget, timestamp_label);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventWidget, timestamp_label);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEventWidget, summary_inscription);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventWidget, summary_label);
|
||||||
gtk_widget_class_bind_template_child (widget_class, GcalEventWidget, vertical_box);
|
gtk_widget_class_bind_template_child (widget_class, GcalEventWidget, vertical_box);
|
||||||
|
|
||||||
gtk_widget_class_bind_template_callback (widget_class, on_click_gesture_pressed_cb);
|
gtk_widget_class_bind_template_callback (widget_class, on_click_gesture_pressed_cb);
|
||||||
|
|||||||
Reference in New Issue
Block a user