summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-01 11:38:04 +0100
committerGitHub <noreply@github.com>2020-01-01 11:38:04 +0100
commit5b173c4bf179f570b2c303079c18e7bdb9938326 (patch)
tree77c78dbae83d2fa719b4553c8ebd82842c51a65d /scene/gui
parent3e649f8cba9408d7646c591a19fed6f270827602 (diff)
parentbbd5e391651a0e9c629dcce8227c6b8d53ae4b6c (diff)
Merge pull request #34654 from Calinou/colorpicker-move-preview-under-picker
Move the ColorPicker preview under the picker area
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/color_picker.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index f6312d0203..bab8d9167b 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -737,20 +737,6 @@ ColorPicker::ColorPicker() :
presets_visible = true;
screen = NULL;
- HBoxContainer *hb_smpl = memnew(HBoxContainer);
- add_child(hb_smpl);
-
- sample = memnew(TextureRect);
- hb_smpl->add_child(sample);
- sample->set_h_size_flags(SIZE_EXPAND_FILL);
- sample->connect("draw", this, "_sample_draw");
-
- btn_pick = memnew(ToolButton);
- hb_smpl->add_child(btn_pick);
- btn_pick->set_toggle_mode(true);
- btn_pick->set_tooltip(TTR("Pick a color from the screen."));
- btn_pick->connect("pressed", this, "_screen_pick_pressed");
-
HBoxContainer *hb_edit = memnew(HBoxContainer);
add_child(hb_edit);
hb_edit->set_v_size_flags(SIZE_EXPAND_FILL);
@@ -772,6 +758,20 @@ ColorPicker::ColorPicker() :
w_edit->connect("gui_input", this, "_w_input");
w_edit->connect("draw", this, "_hsv_draw", make_binds(1, w_edit));
+ HBoxContainer *hb_smpl = memnew(HBoxContainer);
+ add_child(hb_smpl);
+
+ sample = memnew(TextureRect);
+ hb_smpl->add_child(sample);
+ sample->set_h_size_flags(SIZE_EXPAND_FILL);
+ sample->connect("draw", this, "_sample_draw");
+
+ btn_pick = memnew(ToolButton);
+ hb_smpl->add_child(btn_pick);
+ btn_pick->set_toggle_mode(true);
+ btn_pick->set_tooltip(TTR("Pick a color from the editor window."));
+ btn_pick->connect("pressed", this, "_screen_pick_pressed");
+
VBoxContainer *vbl = memnew(VBoxContainer);
add_child(vbl);