The GTK inspector would always target and inspect the `main_widget` box rather than the parent widget, which became repetitive to keep pressing the "Parent widget" button when working with accessibility, as the parent widget contained the accessible properties and states. GtkBoxLayout solves that by allowing us to get rid of the box completely, which exclusively makes it inspect the widget we actually want to target. Part-of: <https://gitlab.gnome.org/GNOME/gnome-calendar/-/merge_requests/587>
86 lines
1.7 KiB
Plaintext
86 lines
1.7 KiB
Plaintext
using Gtk 4.0;
|
|
using Adw 1;
|
|
|
|
template $GcalEventWidget: Widget {
|
|
focusable: true;
|
|
overflow: hidden;
|
|
receives-default: true;
|
|
|
|
DragSource drag_source {
|
|
prepare => $on_drag_source_prepare_cb(template) not-swapped;
|
|
begin => $on_drag_source_begin_cb(template) not-swapped;
|
|
}
|
|
|
|
GestureClick {
|
|
button: 1;
|
|
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",
|
|
]
|
|
|
|
Adw.Squeezer squeezer {
|
|
hexpand: false;
|
|
homogeneous: false;
|
|
orientation: vertical;
|
|
|
|
Box vertical_box {
|
|
visible: bind $get_vertical_enabled(template.event, template.orientation) as <bool>;
|
|
orientation: vertical;
|
|
|
|
$GcalOverflowBin {
|
|
request-mode: width-for-height;
|
|
|
|
Label {
|
|
label: bind timestamp_label.label no-sync-create;
|
|
xalign: 0.0;
|
|
|
|
styles [
|
|
"dim-label",
|
|
]
|
|
}
|
|
}
|
|
|
|
Inscription {
|
|
text: bind summary_inscription.text no-sync-create;
|
|
hexpand: true;
|
|
vexpand: true;
|
|
xalign: 0.0;
|
|
yalign: 0.0;
|
|
min-lines: 1;
|
|
text-overflow: ellipsize_end;
|
|
}
|
|
}
|
|
|
|
Box horizontal_box {
|
|
spacing: 4;
|
|
|
|
Inscription summary_inscription {
|
|
hexpand: true;
|
|
xalign: 0.0;
|
|
min-lines: 1;
|
|
text-overflow: ellipsize_end;
|
|
}
|
|
|
|
Label timestamp_label {
|
|
styles [
|
|
"dim-label",
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|