From 8eec90c35c2eaf8801183b3e8dbe8c530d11a63c Mon Sep 17 00:00:00 2001 From: Logan McNaughton <848146+loganmc10@users.noreply.github.com> Date: Sat, 23 May 2026 11:36:33 +0200 Subject: [PATCH] remove focusscope (#945) --- src/ui/gui/side_bar.slint | 49 --------------------------------------- 1 file changed, 49 deletions(-) diff --git a/src/ui/gui/side_bar.slint b/src/ui/gui/side_bar.slint index c2f9887..5d1566c 100644 --- a/src/ui/gui/side_bar.slint +++ b/src/ui/gui/side_bar.slint @@ -93,9 +93,6 @@ export component SideBar inherits Rectangle { in property title: "Gopher64"; in property portrait; in-out property current-item: 0; - out property current-focused: fs.has-focus ? fs.focused-tab : -1; - - forward-focus: fs; Rectangle { width: 100%; @@ -103,48 +100,6 @@ export component SideBar inherits Rectangle { background: Palette.background.darker(0.2); } - fs := FocusScope { - key-pressed(event) => { - if (event.text == "\n") { - root.current-item = root.current-focused; - return accept; - } - if (root.portrait) { - if (event.text == Key.LeftArrow) { - self.focused-tab = Math.max(self.focused-tab - 1, 0); - return accept; - } - if (event.text == Key.RightArrow) { - self.focused-tab = Math.min(self.focused-tab + 1, root.model.length - 1); - return accept; - } - } else { - if (event.text == Key.UpArrow) { - self.focused-tab = Math.max(self.focused-tab - 1, 0); - return accept; - } - if (event.text == Key.DownArrow) { - self.focused-tab = Math.min(self.focused-tab + 1, root.model.length - 1); - return accept; - } - } - return reject; - } - - key-released(event) => { - if (event.text == " ") { - root.current-item = root.current-focused; - return accept; - } - return reject; - } - - property focused-tab: 0; - - width: 0; - height: 0; - } - // Bottom bar in portrait: icons in a row, centered vertically in the bar. portrait-strip := HorizontalLayout { visible: root.portrait; @@ -155,7 +110,6 @@ export component SideBar inherits Rectangle { alignment: space-evenly; accessible-role: tab-list; - accessible-delegate-focus: root.current-focused >= 0 ? root.current-focused : root.current-item; accessible-label: root.title; accessible-item-count: root.model.length; @@ -168,7 +122,6 @@ export component SideBar inherits Rectangle { } tab-index: index; - has-focus: index == root.current-focused; icon: item.icon; label: item.label; selected: index == root.current-item; @@ -186,7 +139,6 @@ export component SideBar inherits Rectangle { alignment: space-evenly; accessible-role: tab-list; - accessible-delegate-focus: root.current-focused >= 0 ? root.current-focused : root.current-item; accessible-label: root.title; accessible-item-count: root.model.length; @@ -199,7 +151,6 @@ export component SideBar inherits Rectangle { } tab-index: index; - has-focus: index == root.current-focused; icon: item.icon; label: item.label; selected: index == root.current-item;