system settings
git clone https://git.lucas.co/cce-system-interface.git
fix: dropdowns on a scrolled page draw their menu over the page's text
The page's widgets are laid out unscrolled and drawn scroll_y higher;
popover_offset tells the engine so, and the text under an open menu is
clipped where the menu is rather than one scroll offset below it.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
src/main.rs | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/main.rs b/src/main.rs
index d84d33e..121bd0f 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -599,6 +599,17 @@ impl cce_ui::engine::Application for SystemInterface {
Some(&mut self.ui_context)
}
+ // Page widgets are laid out unscrolled and drawn `scroll_y` higher (the
+ // popover replay in `rebuild_layout` subtracts it); the chrome dropdown
+ // is in window coords already.
+ fn popover_offset(&self, id: cce_ui::widget::WidgetId) -> (f32, f32) {
+ if id == self.page_dropdown.id() {
+ (0.0, 0.0)
+ } else {
+ (0.0, -self.scroll_y)
+ }
+ }
+
fn clear_color(&self) -> [f32; 4] {
[0.039, 0.102, 0.055, 1.0]
}