diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/base_button.cpp | 2 | ||||
-rw-r--r-- | scene/gui/line_edit.cpp | 2 | ||||
-rw-r--r-- | scene/gui/scroll_bar.cpp | 2 | ||||
-rw-r--r-- | scene/gui/tree.cpp | 12 | ||||
-rw-r--r-- | scene/gui/video_player.cpp | 2 |
5 files changed, 14 insertions, 6 deletions
diff --git a/scene/gui/base_button.cpp b/scene/gui/base_button.cpp index 5713a35b7a..04c0817b15 100644 --- a/scene/gui/base_button.cpp +++ b/scene/gui/base_button.cpp @@ -39,7 +39,7 @@ void BaseButton::_unpress_group() { if (!button_group.is_valid()) return; - status.pressed = true; + status.pressed = false; for (Set<BaseButton *>::Element *E = button_group->buttons.front(); E; E = E->next()) { if (E->get() == this) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 7493ea95a8..aa5ae089bf 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -534,7 +534,7 @@ void LineEdit::_notification(int p_what) { switch (p_what) { #ifdef TOOLS_ENABLED case NOTIFICATION_ENTER_TREE: { - if (Engine::get_singleton()->is_editor_hint()) { + if (!get_tree()->is_node_being_edited(this)) { cursor_set_blink_enabled(EDITOR_DEF("text_editor/cursor/caret_blink", false)); cursor_set_blink_speed(EDITOR_DEF("text_editor/cursor/caret_blink_speed", 0.65)); diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 41f4beb1c9..6044b86ef5 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -343,7 +343,7 @@ void ScrollBar::_notification(int p_what) { double dist = sqrt(target * target); double vel = ((target / dist) * 500) * get_fixed_process_delta_time(); - if (vel >= dist) { + if (Math::abs(vel) >= dist) { set_value(target_scroll); } else { set_value(get_value() + vel); diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 8d6eb0f8e2..822136820e 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -2135,8 +2135,15 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { if (selected_item->get_children() != NULL && !selected_item->is_collapsed()) { selected_item->set_collapsed(true); } else { - selected_col = columns.size() - 1; - dobreak = false; // fall through to key_up + if (columns.size() == 1) { // goto parent with one column + TreeItem *parent = selected_item->get_parent(); + if (selected_item != get_root() && parent && parent->is_selectable(selected_col) && !(hide_root && parent == get_root())) { + select_single_item(parent, get_root(), selected_col); + } + } else { + selected_col = columns.size() - 1; + dobreak = false; // fall through to key_up + } } } else { if (select_mode == SELECT_MULTI) { @@ -2149,6 +2156,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) { } update(); accept_event(); + ensure_cursor_is_visible(); if (dobreak) { break; diff --git a/scene/gui/video_player.cpp b/scene/gui/video_player.cpp index e08d050ca7..816556af30 100644 --- a/scene/gui/video_player.cpp +++ b/scene/gui/video_player.cpp @@ -282,7 +282,7 @@ float VideoPlayer::get_stream_position() const { if (playback.is_null()) return 0; - return playback->get_position(); + return playback->get_playback_position(); }; Ref<Texture> VideoPlayer::get_video_texture() { |