summaryrefslogtreecommitdiffstats
path: root/scene/gui/color_picker.cpp
diff options
context:
space:
mode:
authorYuri Sizov <yuris@humnom.net>2023-01-19 19:14:09 +0300
committerYuri Sizov <yuris@humnom.net>2023-01-19 20:02:21 +0300
commit752402cf354a105496ed9a86038f83f56d0706fd (patch)
treeeddbf98b4692136c7d6c56e765b557236bb40afc /scene/gui/color_picker.cpp
parent14fdd28de9f1f9979cb6cffa4b715a16d406439d (diff)
downloadredot-engine-752402cf354a105496ed9a86038f83f56d0706fd.tar.gz
Clean-up, harmonize, and improve StyleBox API
- Make all margin properties follow the same naming convention (their getter and setter too). - Remove a virtual counterpart of `get_style_margin` from API. - Allow to override `get_minimum_size` from scripting and remove `get_center_size`.
Diffstat (limited to 'scene/gui/color_picker.cpp')
-rw-r--r--scene/gui/color_picker.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/color_picker.cpp b/scene/gui/color_picker.cpp
index b0261dcf23..13865c851b 100644
--- a/scene/gui/color_picker.cpp
+++ b/scene/gui/color_picker.cpp
@@ -471,7 +471,7 @@ ColorPicker::PickerShapeType ColorPicker::_get_actual_shape() const {
void ColorPicker::_reset_theme() {
Ref<StyleBoxFlat> style_box_flat(memnew(StyleBoxFlat));
- style_box_flat->set_default_margin(SIDE_TOP, 16 * get_theme_default_base_scale());
+ style_box_flat->set_content_margin(SIDE_TOP, 16 * get_theme_default_base_scale());
style_box_flat->set_bg_color(Color(0.2, 0.23, 0.31).lerp(Color(0, 0, 0, 1), 0.3).clamp());
for (int i = 0; i < SLIDER_COUNT; i++) {
sliders[i]->add_theme_icon_override("grabber", get_theme_icon(SNAME("bar_arrow"), SNAME("ColorPicker")));
@@ -890,7 +890,7 @@ void ColorPicker::set_colorize_sliders(bool p_colorize_sliders) {
alpha_slider->add_theme_style_override("slider", style_box_empty);
} else {
Ref<StyleBoxFlat> style_box_flat(memnew(StyleBoxFlat));
- style_box_flat->set_default_margin(SIDE_TOP, 16 * get_theme_default_base_scale());
+ style_box_flat->set_content_margin(SIDE_TOP, 16 * get_theme_default_base_scale());
style_box_flat->set_bg_color(Color(0.2, 0.23, 0.31).lerp(Color(0, 0, 0, 1), 0.3).clamp());
if (!slider_theme_modified) {