summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
Diffstat (limited to 'scene')
-rw-r--r--scene/2d/canvas_group.cpp1
-rw-r--r--scene/gui/line_edit.cpp2
-rw-r--r--scene/gui/popup_menu.cpp19
-rw-r--r--scene/gui/text_edit.cpp2
4 files changed, 9 insertions, 15 deletions
diff --git a/scene/2d/canvas_group.cpp b/scene/2d/canvas_group.cpp
index 0e0aecf224..0f0e583ea7 100644
--- a/scene/2d/canvas_group.cpp
+++ b/scene/2d/canvas_group.cpp
@@ -84,4 +84,5 @@ CanvasGroup::CanvasGroup() {
set_fit_margin(10.0); //sets things
}
CanvasGroup::~CanvasGroup() {
+ RS::get_singleton()->canvas_item_set_canvas_group_mode(get_canvas_item(), RS::CANVAS_GROUP_MODE_DISABLED);
}
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 39ea6ed87b..5f0bb453f3 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -584,7 +584,7 @@ void LineEdit::_gui_input(Ref<InputEvent> p_event) {
if (handled) {
accept_event();
- } else if (!k->get_command() || (k->get_command() && k->get_alt())) {
+ } else if (!k->get_command()) {
if (k->get_unicode() >= 32 && k->get_keycode() != KEY_DELETE) {
if (editable) {
selection_delete();
diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp
index ecb5ac0ffc..e777e6c26b 100644
--- a/scene/gui/popup_menu.cpp
+++ b/scene/gui/popup_menu.cpp
@@ -72,9 +72,7 @@ Size2 PopupMenu::_get_contents_minimum_size() const {
}
size.width += items[i].text_buf->get_size().x;
- if (i > 0) {
- size.height += vseparation;
- }
+ size.height += vseparation;
if (items[i].accel || (items[i].shortcut.is_valid() && items[i].shortcut->is_valid())) {
int accel_w = hseparation * 2;
@@ -152,9 +150,7 @@ int PopupMenu::_get_mouse_over(const Point2 &p_over) const {
}
for (int i = 0; i < items.size(); i++) {
- if (i > 0) {
- ofs.y += vseparation;
- }
+ ofs.y += i > 0 ? vseparation : (float)vseparation / 2;
ofs.y += MAX(items[i].get_icon_size().height, items[i].text_buf->get_size().y);
@@ -506,10 +502,8 @@ void PopupMenu::_draw_items() {
// Loop through all items and draw each.
for (int i = 0; i < items.size(); i++) {
- // If not the first item, add the separation space between items.
- if (i > 0) {
- ofs.y += vseparation;
- }
+ // For the first item only add half a separation. For all other items, add a whole separation to the offset.
+ ofs.y += i > 0 ? vseparation : (float)vseparation / 2;
_shape_item(i);
@@ -519,9 +513,9 @@ void PopupMenu::_draw_items() {
if (i == mouse_over) {
if (rtl) {
- hover->draw(ci, Rect2(item_ofs + Point2(-hseparation + scroll_width, -vseparation / 2), Size2(display_width + hseparation * 2, h + vseparation)));
+ hover->draw(ci, Rect2(item_ofs + Point2(scroll_width, -vseparation / 2), Size2(display_width, h + vseparation)));
} else {
- hover->draw(ci, Rect2(item_ofs + Point2(-hseparation, -vseparation / 2), Size2(display_width + hseparation * 2, h + vseparation)));
+ hover->draw(ci, Rect2(item_ofs + Point2(0, -vseparation / 2), Size2(display_width, h + vseparation)));
}
}
@@ -1636,7 +1630,6 @@ void PopupMenu::_bind_methods() {
void PopupMenu::popup(const Rect2 &p_bounds) {
moved = Vector2();
popup_time_msec = OS::get_singleton()->get_ticks_msec();
- set_as_minsize();
Popup::popup(p_bounds);
}
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp
index f54e5d1dd7..75b875ff0b 100644
--- a/scene/gui/text_edit.cpp
+++ b/scene/gui/text_edit.cpp
@@ -3619,7 +3619,7 @@ void TextEdit::_gui_input(const Ref<InputEvent> &p_gui_input) {
return;
}
- if (!keycode_handled && (!k->get_command() || (k->get_command() && k->get_alt()))) { // For German keyboards.
+ if (!keycode_handled && !k->get_command()) { // For German keyboards.
if (k->get_unicode() >= 32) {
if (readonly) {