diff options
Diffstat (limited to 'scene/gui')
-rw-r--r-- | scene/gui/scroll_bar.cpp | 2 | ||||
-rw-r--r-- | scene/gui/tabs.cpp | 6 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 13 | ||||
-rw-r--r-- | scene/gui/text_edit.h | 1 |
4 files changed, 18 insertions, 4 deletions
diff --git a/scene/gui/scroll_bar.cpp b/scene/gui/scroll_bar.cpp index 07380f45cc..0e68476439 100644 --- a/scene/gui/scroll_bar.cpp +++ b/scene/gui/scroll_bar.cpp @@ -330,6 +330,8 @@ void ScrollBar::_notification(int p_what) { if (Math::abs(vel) >= dist) { set_value(target_scroll); + scrolling = false; + set_physics_process_internal(false); } else { set_value(get_value() + vel); } diff --git a/scene/gui/tabs.cpp b/scene/gui/tabs.cpp index cf3113ca8c..4fe4271368 100644 --- a/scene/gui/tabs.cpp +++ b/scene/gui/tabs.cpp @@ -53,7 +53,7 @@ Size2 Tabs::get_minimum_size() const { ms.width += get_constant("hseparation"); } - ms.width += font->get_string_size(tabs[i].text).width; + ms.width += Math::ceil(font->get_string_size(tabs[i].text).width); if (tabs[i].disabled) ms.width += tab_disabled->get_minimum_size().width; @@ -547,7 +547,7 @@ void Tabs::_update_cache() { for (int i = 0; i < tabs.size(); i++) { tabs.write[i].ofs_cache = mw; tabs.write[i].size_cache = get_tab_width(i); - tabs.write[i].size_text = font->get_string_size(tabs[i].text).width; + tabs.write[i].size_text = Math::ceil(font->get_string_size(tabs[i].text).width); mw += tabs[i].size_cache; if (tabs[i].size_cache <= min_width || i == current) { size_fixed += tabs[i].size_cache; @@ -803,7 +803,7 @@ int Tabs::get_tab_width(int p_idx) const { x += get_constant("hseparation"); } - x += font->get_string_size(tabs[p_idx].text).width; + x += Math::ceil(font->get_string_size(tabs[p_idx].text).width); if (tabs[p_idx].disabled) x += tab_disabled->get_minimum_size().width; diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 7bfcd0843c..c339cf6374 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4264,6 +4264,7 @@ void TextEdit::_clear() { cursor.line_ofs = 0; cursor.wrap_ofs = 0; cursor.last_fit_x = 0; + selection.active = false; } void TextEdit::clear() { @@ -5757,6 +5758,7 @@ void TextEdit::_update_completion_candidates() { completion_base = s; Vector<float> sim_cache; bool single_quote = s.begins_with("'"); + Vector<String> completion_options_casei; for (int i = 0; i < completion_strings.size(); i++) { if (single_quote && completion_strings[i].is_quoted()) { @@ -5765,9 +5767,13 @@ void TextEdit::_update_completion_candidates() { if (completion_strings[i].begins_with(s)) { completion_options.push_back(completion_strings[i]); + } else if (completion_strings[i].to_lower().begins_with(s.to_lower())) { + completion_options_casei.push_back(completion_strings[i]); } } + completion_options.append_array(completion_options_casei); + if (completion_options.size() == 0) { for (int i = 0; i < completion_strings.size(); i++) { if (s.is_subsequence_of(completion_strings[i])) { @@ -6039,7 +6045,10 @@ void TextEdit::menu_option(int p_option) { case MENU_UNDO: { undo(); } break; - }; + case MENU_REDO: { + redo(); + } + } } void TextEdit::set_select_identifiers_on_hover(bool p_enable) { @@ -6215,6 +6224,7 @@ void TextEdit::_bind_methods() { BIND_ENUM_CONSTANT(MENU_CLEAR); BIND_ENUM_CONSTANT(MENU_SELECT_ALL); BIND_ENUM_CONSTANT(MENU_UNDO); + BIND_ENUM_CONSTANT(MENU_REDO); BIND_ENUM_CONSTANT(MENU_MAX); GLOBAL_DEF("gui/timers/text_edit_idle_detect_sec", 3); @@ -6343,6 +6353,7 @@ TextEdit::TextEdit() { menu->add_item(RTR("Clear"), MENU_CLEAR); menu->add_separator(); menu->add_item(RTR("Undo"), MENU_UNDO, KEY_MASK_CMD | KEY_Z); + menu->add_item(RTR("Redo"), MENU_REDO, KEY_MASK_CMD | KEY_MASK_SHIFT | KEY_Z); menu->connect("id_pressed", this, "menu_option"); } diff --git a/scene/gui/text_edit.h b/scene/gui/text_edit.h index 8a508a8738..b1a0b60442 100644 --- a/scene/gui/text_edit.h +++ b/scene/gui/text_edit.h @@ -444,6 +444,7 @@ public: MENU_CLEAR, MENU_SELECT_ALL, MENU_UNDO, + MENU_REDO, MENU_MAX }; |