Files
federated-calendar/src/gui/gcal-event-widget.blp
T
Georges Basile Stavracas Neto f40c2cb0e9 gui/fading-label: Rewrite using PangoLayout directly
Instead of an internal label widget, store the text and the PangoLayout
directly, and only render them. Cache as much as possible to avoid
font reshaping.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/765>
2026-05-19 19:25:25 -03:00

86 lines
1.6 KiB
Plaintext

using Gtk 4.0;
using Adw 1;
template $GcalEventWidget: Widget {
focusable: true;
overflow: hidden;
receives-default: true;
accessibility {
has-popup: true;
}
DragSource drag_source {
propagation-phase: bind $read_only_to_propagation_phase_cb(
template.event as <$GcalEvent>.calendar as <$GcalCalendar>.read-only
);
prepare => $on_drag_source_prepare_cb(template) not-swapped;
begin => $on_drag_source_begin_cb(template) not-swapped;
}
GestureClick {
pressed => $on_click_gesture_pressed_cb(template) not-swapped;
released => $on_click_gesture_release_cb(template) not-swapped;
}
Adw.Bin edge {
styles [
"edge",
]
}
$GcalOverflowBin overflow_bin {
hexpand: true;
request-mode: width-for-height;
styles [
"content",
]
Box vertical_box {
orientation: vertical;
$GcalOverflowBin {
request-mode: width-for-height;
Label {
label: bind timestamp_label.label no-sync-create;
xalign: 0.0;
styles [
"dimmed",
]
}
}
Inscription {
text: bind summary_label.text;
hexpand: true;
vexpand: true;
xalign: 0.0;
yalign: 0.0;
min-lines: 1;
text-overflow: ellipsize_end;
}
}
Box horizontal_box {
spacing: 4;
$GcalFadingLabel summary_label {
text: bind template.event as <$GcalEvent>.summary;
hexpand: true;
vexpand: true;
}
Label timestamp_label {
halign: end;
styles [
"dimmed",
]
}
}
}
}