summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-04-22 12:00:34 +0200
committerGitHub <noreply@github.com>2019-04-22 12:00:34 +0200
commita342131eba2834240289112a1b8d5d0c68a265c9 (patch)
treec412df9c24c8b568086ea6ff72a097fb8d20dbc0 /scene/gui
parent1e67f214c520b2c1a9fed30f78440c4e1d4d14dd (diff)
parent856a8226a5306632f5dd4d9e9c916d89e3e21495 (diff)
Merge pull request #27673 from qarmin/small_fixes
Small fixes, mostly duplicated code
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/base_button.cpp2
-rw-r--r--scene/gui/popup_menu.cpp2
-rw-r--r--scene/gui/rich_text_label.cpp2
-rw-r--r--scene/gui/tree.cpp1
4 files changed, 3 insertions, 4 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp
index 806c8afa5b..d68cdd5f8d 100644
--- a/scene/gui/base_button.cpp
+++ b/scene/gui/base_button.cpp
@@ -59,7 +59,7 @@ void BaseButton::_gui_input(Ref<InputEvent> p_event) {
Ref<InputEventMouseButton> b = p_event;
if (b.is_valid()) {
- if (status.disabled || ((1 << (b->get_button_index() - 1)) & button_mask) == 0)
+ if (((1 << (b->get_button_index() - 1)) & button_mask) == 0)
return;
if (status.pressing_button)
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index 94c73b2e42..23c61f37d6 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -239,7 +239,7 @@ void PopupMenu::_gui_input(const Ref<InputEvent> &p_event) {
for (int i = search_from; i >= 0; i--) {
- if (i < 0 || i >= items.size())
+ if (i >= items.size())
continue;
if (!items[i].separator && !items[i].disabled) {
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 3fbf809012..0155ad793f 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -1997,7 +1997,7 @@ bool RichTextLabel::search(const String &p_string, bool p_from_selection, bool p
Item *it = main;
int charidx = 0;
- if (p_from_selection && selection.active && selection.enabled) {
+ if (p_from_selection && selection.active) {
it = selection.to;
charidx = selection.to_char + 1;
}
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index 7e59606d2b..f22fe5b6a5 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -3938,7 +3938,6 @@ Tree::Tree() {
cache.click_item = NULL;
cache.click_column = 0;
cache.hover_cell = -1;
- cache.hover_index = -1;
last_keypress = 0;
focus_in_id = 0;