From 5688d304390ff4f24b9108e45e4aa9c5354bdc31 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?=
<7645683+bruvzg@users.noreply.github.com>
Date: Sat, 12 Apr 2025 20:51:17 +0300
Subject: [PATCH] Remove debug focus rect draws from MenuBar and GraphNode.
---
doc/classes/MenuBar.xml | 2 +-
scene/gui/graph_node.cpp | 4 ----
scene/gui/menu_bar.cpp | 6 +-----
3 files changed, 2 insertions(+), 10 deletions(-)
diff --git a/doc/classes/MenuBar.xml b/doc/classes/MenuBar.xml
index 2fecdd2381b..d7698f87527 100644
--- a/doc/classes/MenuBar.xml
+++ b/doc/classes/MenuBar.xml
@@ -100,7 +100,7 @@
Flat [MenuBar] don't display item decoration.
-
+
Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead.
diff --git a/scene/gui/graph_node.cpp b/scene/gui/graph_node.cpp
index aad854762ba..0499a4c2486 100644
--- a/scene/gui/graph_node.cpp
+++ b/scene/gui/graph_node.cpp
@@ -639,10 +639,6 @@ void GraphNode::_notification(int p_what) {
// Draw body (slots area) stylebox.
draw_style_box(sb_to_draw_panel, body_rect);
- if (has_focus()) {
- draw_style_box(theme_cache.panel_focus, body_rect);
- }
-
// Draw title bar stylebox above.
draw_style_box(sb_to_draw_titlebar, titlebar_rect);
diff --git a/scene/gui/menu_bar.cpp b/scene/gui/menu_bar.cpp
index 16a13812f62..b1a8a406369 100644
--- a/scene/gui/menu_bar.cpp
+++ b/scene/gui/menu_bar.cpp
@@ -423,10 +423,6 @@ void MenuBar::_draw_menu_item(int p_index) {
bool pressed = (active_menu == p_index);
bool rtl = is_layout_rtl();
- if (has_focus() && focused_menu == -1 && p_index == 0) {
- hovered = true;
- }
-
if (menu_cache[p_index].hidden) {
return;
}
@@ -969,7 +965,7 @@ String MenuBar::get_tooltip(const Point2 &p_pos) const {
}
MenuBar::MenuBar() {
- set_focus_mode(FOCUS_ALL);
+ set_focus_mode(FOCUS_ACCESSIBILITY);
set_process_shortcut_input(true);
}