summaryrefslogtreecommitdiff
path: root/scene
diff options
context:
space:
mode:
authorDaniel Ting <danielzting@gmail.com>2020-07-08 18:02:38 -0500
committerDaniel Ting <danielzting@gmail.com>2020-07-10 15:10:11 -0500
commit9605fc54c790b1c4364bc0eddfcdd65f979bfc21 (patch)
tree114b5d6f9f3172275b9ce2e513b0b5c29a182271 /scene
parentdcd11faad3802679a43b27155f1b6bc59aa39b60 (diff)
Fix cancel/OK button order on macOS
The macOS platform convention regarding button order is cancel on left, OK on right.
Diffstat (limited to 'scene')
-rw-r--r--scene/gui/dialogs.cpp8
-rw-r--r--scene/gui/dialogs.h4
-rw-r--r--scene/register_scene_types.cpp2
3 files changed, 7 insertions, 7 deletions
diff --git a/scene/gui/dialogs.cpp b/scene/gui/dialogs.cpp
index faef979090..9077bfa4ba 100644
--- a/scene/gui/dialogs.cpp
+++ b/scene/gui/dialogs.cpp
@@ -258,7 +258,7 @@ Button *AcceptDialog::add_cancel(const String &p_cancel) {
if (p_cancel == "") {
c = RTR("Cancel");
}
- Button *b = swap_ok_cancel ? add_button(c, true) : add_button(c);
+ Button *b = swap_cancel_ok ? add_button(c, true) : add_button(c);
b->connect("pressed", callable_mp(this, &AcceptDialog::_cancel_pressed));
return b;
}
@@ -286,9 +286,9 @@ void AcceptDialog::_bind_methods() {
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "dialog_autowrap"), "set_autowrap", "has_autowrap");
}
-bool AcceptDialog::swap_ok_cancel = false;
-void AcceptDialog::set_swap_ok_cancel(bool p_swap) {
- swap_ok_cancel = p_swap;
+bool AcceptDialog::swap_cancel_ok = false;
+void AcceptDialog::set_swap_cancel_ok(bool p_swap) {
+ swap_cancel_ok = p_swap;
}
AcceptDialog::AcceptDialog() {
diff --git a/scene/gui/dialogs.h b/scene/gui/dialogs.h
index 063090c832..de08685ce2 100644
--- a/scene/gui/dialogs.h
+++ b/scene/gui/dialogs.h
@@ -54,7 +54,7 @@ class AcceptDialog : public Window {
void _custom_action(const String &p_action);
void _update_child_rects();
- static bool swap_ok_cancel;
+ static bool swap_cancel_ok;
void _input_from_window(const Ref<InputEvent> &p_event);
void _parent_focused();
@@ -75,7 +75,7 @@ protected:
public:
Label *get_label() { return label; }
- static void set_swap_ok_cancel(bool p_swap);
+ static void set_swap_cancel_ok(bool p_swap);
void register_text_enter(Node *p_line_edit);
diff --git a/scene/register_scene_types.cpp b/scene/register_scene_types.cpp
index f40fb78056..1c91effe05 100644
--- a/scene/register_scene_types.cpp
+++ b/scene/register_scene_types.cpp
@@ -369,7 +369,7 @@ void register_scene_types() {
OS::get_singleton()->yield(); //may take time to init
- AcceptDialog::set_swap_ok_cancel(GLOBAL_DEF("gui/common/swap_ok_cancel", bool(DisplayServer::get_singleton()->get_swap_ok_cancel())));
+ AcceptDialog::set_swap_cancel_ok(GLOBAL_DEF("gui/common/swap_cancel_ok", bool(DisplayServer::get_singleton()->get_swap_cancel_ok())));
#endif
/* REGISTER 3D */