From 205c8a12ed28809e18f8d9b44689fecb6fac15a8 Mon Sep 17 00:00:00 2001 From: Marcus Nilsson Date: Fri, 16 Jul 2021 23:15:20 +0200 Subject: [PATCH] ThemeEditor: Disable focus for demo widgets Pressing tab would focus on the demo widgets instead of switching between the combo box and color input field. Instead set the focus policy to NoFocus for all the widgets. --- Userland/Applications/ThemeEditor/PreviewWidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Userland/Applications/ThemeEditor/PreviewWidget.cpp b/Userland/Applications/ThemeEditor/PreviewWidget.cpp index 84cf73af0b..d47a7e8c20 100644 --- a/Userland/Applications/ThemeEditor/PreviewWidget.cpp +++ b/Userland/Applications/ThemeEditor/PreviewWidget.cpp @@ -49,6 +49,11 @@ private: m_statusbar->set_text("Status bar"); m_editor = add(); m_editor->set_text("Text editor\nwith multiple\nlines."); + + for_each_child_widget([](auto& child) { + child.set_focus_policy(GUI::FocusPolicy::NoFocus); + return IterationDecision::Continue; + }); } virtual void resize_event(GUI::ResizeEvent&) override