소스 검색

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.
Marcus Nilsson 4 년 전
부모
커밋
205c8a12ed
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      Userland/Applications/ThemeEditor/PreviewWidget.cpp

+ 5 - 0
Userland/Applications/ThemeEditor/PreviewWidget.cpp

@@ -49,6 +49,11 @@ private:
         m_statusbar->set_text("Status bar");
         m_editor = add<GUI::TextEditor>();
         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