summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/rich_text_label.cpp11
-rw-r--r--scene/gui/split_container.cpp15
-rw-r--r--scene/gui/text_edit.cpp7
-rw-r--r--scene/gui/text_edit.h1
4 files changed, 20 insertions, 14 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 17de346f51..490013d813 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -765,19 +765,17 @@ void RichTextLabel::_update_scroll() {
if (exceeds) {
scroll_visible = true;
- main->first_invalid_line = 0;
scroll_w = vscroll->get_combined_minimum_size().width;
vscroll->show();
vscroll->set_anchor_and_margin(MARGIN_LEFT, ANCHOR_END, -scroll_w);
- _validate_line_caches(main);
-
} else {
-
scroll_visible = false;
- vscroll->hide();
scroll_w = 0;
- _validate_line_caches(main);
+ vscroll->hide();
}
+
+ main->first_invalid_line = 0; //invalidate ALL
+ _validate_line_caches(main);
}
}
@@ -1616,7 +1614,6 @@ void RichTextLabel::clear() {
main->lines.clear();
main->lines.resize(1);
main->first_invalid_line = 0;
- scroll_w = 0;
update();
selection.click = NULL;
selection.active = false;
diff --git a/scene/gui/split_container.cpp b/scene/gui/split_container.cpp
index 3554f04cc0..c3265d3ed5 100644
--- a/scene/gui/split_container.cpp
+++ b/scene/gui/split_container.cpp
@@ -94,12 +94,15 @@ void SplitContainer::_resort() {
}
// Compute the final middle separation
- int clamped_split_offset = CLAMP(split_offset, ms_first[axis] - no_offset_middle_sep, (get_size()[axis] - ms_second[axis] - sep) - no_offset_middle_sep);
- middle_sep = no_offset_middle_sep + clamped_split_offset;
- if (!collapsed && should_clamp_split_offset) {
- split_offset = clamped_split_offset;
- _change_notify("split_offset");
- should_clamp_split_offset = false;
+ middle_sep = no_offset_middle_sep;
+ if (!collapsed) {
+ int clamped_split_offset = CLAMP(split_offset, ms_first[axis] - no_offset_middle_sep, (get_size()[axis] - ms_second[axis] - sep) - no_offset_middle_sep);
+ middle_sep += clamped_split_offset;
+ if (should_clamp_split_offset) {
+ split_offset = clamped_split_offset;
+ _change_notify("split_offset");
+ should_clamp_split_offset = false;
+ }
}
if (vertical) {
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index 51d707c28f..c339cf6374 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -6045,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) {
@@ -6221,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);
@@ -6349,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
};