From fbfacb697205a3c76c2acc51d656779938011f52 Mon Sep 17 00:00:00 2001 From: Zoey Ahmed Date: Mon, 23 Mar 2026 17:35:12 +0000 Subject: [PATCH] gui/blueprint: Drop unneeded casts to built-ins Blueprint can now "infer" the type a closure returns, as long as it is not the property of a custom GType, so some of the casts (e.g. `as `) will not be necessary anymore Part-of: --- src/gui/event-editor/gcal-organizer-row.blp | 2 +- src/gui/gcal-search-button.blp | 6 +++--- src/gui/gcal-window.blp | 8 ++++---- src/gui/views/gcal-week-view.blp | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/gui/event-editor/gcal-organizer-row.blp b/src/gui/event-editor/gcal-organizer-row.blp index 229b1843..fe552180 100644 --- a/src/gui/event-editor/gcal-organizer-row.blp +++ b/src/gui/event-editor/gcal-organizer-row.blp @@ -3,7 +3,7 @@ using Adw 1; template $GcalOrganizerRow: Adw.ActionRow { title: _("Organizer"); - subtitle: bind $generate_subtitle(template.organizer) as ; + subtitle: bind $generate_subtitle(template.organizer); styles [ "property", diff --git a/src/gui/gcal-search-button.blp b/src/gui/gcal-search-button.blp index e12034ac..a500ba87 100644 --- a/src/gui/gcal-search-button.blp +++ b/src/gui/gcal-search-button.blp @@ -132,12 +132,12 @@ Popover popover { ellipsize: end; xalign: 0.0; max-width-chars: 40; - label: bind $escape_markup_cb(template.item as <$GcalSearchHit>.title) as ; + label: bind $escape_markup_cb(template.item as <$GcalSearchHit>.title); } Label separator { label: "—"; - visible: bind $string_is_not_empty_cb(template.item as <$GcalSearchHit>.subtitle) as ; + visible: bind $string_is_not_empty_cb(template.item as <$GcalSearchHit>.subtitle); styles [ "dimmed", @@ -149,7 +149,7 @@ Popover popover { use-markup: true; ellipsize: end; xalign: 0.0; - label: bind $escape_markup_cb(template.item as <$GcalSearchHit>.subtitle) as ; + label: bind $escape_markup_cb(template.item as <$GcalSearchHit>.subtitle); styles [ "subtitle", diff --git a/src/gui/gcal-window.blp b/src/gui/gcal-window.blp index 4fee0f50..8e96e84a 100644 --- a/src/gui/gcal-window.blp +++ b/src/gui/gcal-window.blp @@ -266,15 +266,15 @@ template $GcalWindow: Adw.ApplicationWindow { ActionBar { [start] Button previous_date_button { - icon-name: bind $get_previous_date_icon(views_stack.visible-child) as ; - tooltip-text: bind $get_previous_date_tooltip(views_stack.visible-child-name) as ; + icon-name: bind $get_previous_date_icon(views_stack.visible-child); + tooltip-text: bind $get_previous_date_tooltip(views_stack.visible-child-name); action-name: "win.previous-date"; } [start] Button next_date_button { - icon-name: bind $get_next_date_icon(views_stack.visible-child) as ; - tooltip-text: bind $get_next_date_tooltip(views_stack.visible-child-name) as ; + icon-name: bind $get_next_date_icon(views_stack.visible-child); + tooltip-text: bind $get_next_date_tooltip(views_stack.visible-child-name); action-name: "win.next-date"; } diff --git a/src/gui/views/gcal-week-view.blp b/src/gui/views/gcal-week-view.blp index 74698d14..5d83e19d 100644 --- a/src/gui/views/gcal-week-view.blp +++ b/src/gui/views/gcal-week-view.blp @@ -16,7 +16,7 @@ template $GcalWeekView: Box { ToggleButton { visible: bind header.can-expand; active: bind header.expanded bidirectional; - tooltip-text: bind $get_header_state_tooltip(header.expanded) as ; + tooltip-text: bind $get_header_state_tooltip(header.expanded); hexpand: true; halign: center; valign: end;