Fix GTK CSS warnings and popover cleanup on widget destroy

Remove overflow property from .icon-rounded (not valid in GTK CSS).
Remove prefers-reduced-motion media query (not supported by GTK CSS
engine - reduced motion is handled by gtk-enable-animations setting).
Unparent PopoverMenu on widget destroy to prevent finalization warnings
when library view refreshes.
This commit is contained in:
lashman
2026-02-27 11:14:14 +02:00
parent 33cc8a757a
commit a7ed3742fb
2 changed files with 9 additions and 9 deletions

View File

@@ -75,7 +75,6 @@ flowboxchild:focus-visible .card {
/* Rounded icon clipping for list view */ /* Rounded icon clipping for list view */
.icon-rounded { .icon-rounded {
border-radius: 8px; border-radius: 8px;
overflow: hidden;
} }
/* ===== WCAG AAA Focus Indicators ===== */ /* ===== WCAG AAA Focus Indicators ===== */
@@ -190,14 +189,9 @@ row:focus-visible {
} }
/* ===== Reduced Motion (WCAG AAA 2.3.3) ===== */ /* ===== Reduced Motion (WCAG AAA 2.3.3) ===== */
@media (prefers-reduced-motion: reduce) { /* Note: GTK CSS does not support prefers-reduced-motion or !important.
* { Reduced motion is handled by the GTK toolkit settings instead
transition-duration: 0 !important; (gtk-enable-animations). */
transition-delay: 0 !important;
animation-duration: 0 !important;
animation-delay: 0 !important;
}
}
/* ===== Minimum Target Size (WCAG 2.5.8) ===== */ /* ===== Minimum Target Size (WCAG 2.5.8) ===== */
button.flat.circular, button.flat.circular,

View File

@@ -607,6 +607,12 @@ fn attach_context_menu(widget: &impl gtk::prelude::IsA<gtk::Widget>, menu_model:
popover.set_parent(widget.as_ref()); popover.set_parent(widget.as_ref());
popover.set_has_arrow(false); popover.set_has_arrow(false);
// Unparent the popover when the widget is destroyed to avoid GTK warnings
let popover_cleanup = popover.clone();
widget.as_ref().connect_destroy(move |_| {
popover_cleanup.unparent();
});
// Right-click // Right-click
let click = gtk::GestureClick::new(); let click = gtk::GestureClick::new();
click.set_button(3); click.set_button(3);