...
 
Commits (6)
......@@ -31,6 +31,7 @@
#include "editor_spin_slider.h"
#include "core/math/expression.h"
#include "core/os/input.h"
#include "editor_node.h"
#include "editor_scale.h"
String EditorSpinSlider::get_tooltip(const Point2 &p_pos) const {
......@@ -185,6 +186,19 @@ void EditorSpinSlider::_notification(int p_what) {
}
}
if (p_what == NOTIFICATION_READY) {
// Add a left margin to the stylebox to make the number align with the Label
// when it's edited. The LineEdit "focus" stylebox uses the "normal" stylebox's
// default margins.
Ref<StyleBoxFlat> stylebox =
EditorNode::get_singleton()->get_theme_base()->get_stylebox("normal", "LineEdit")->duplicate();
// EditorSpinSliders with a label have more space on the left, so add an
// higher margin to match the location where the text begins.
// The margin values below were determined by empirical testing.
stylebox->set_default_margin(MARGIN_LEFT, (get_label() != String() ? 23 : 16) * EDSCALE);
value_input->add_style_override("normal", stylebox);
}
if (p_what == NOTIFICATION_DRAW) {
updown_offset = -1;
......
......@@ -52,10 +52,9 @@ void ScriptCreateDialog::_notification(int p_what) {
language_menu->set_item_icon(i, lang_icon);
}
}
String last_lang = EditorSettings::get_singleton()->get_project_metadata("script_setup", "last_selected_language", "");
Ref<Texture2D> last_lang_icon;
if (!last_lang.empty()) {
for (int i = 0; i < language_menu->get_item_count(); i++) {
if (language_menu->get_item_text(i) == last_lang) {
language_menu->select(i);
......@@ -63,14 +62,10 @@ void ScriptCreateDialog::_notification(int p_what) {
break;
}
}
last_lang_icon = get_icon(last_lang, "EditorIcons");
} else {
last_lang_icon = language_menu->get_item_icon(default_language);
}
if (last_lang_icon.is_valid()) {
language_menu->set_icon(last_lang_icon);
language_menu->select(default_language);
}
path_button->set_icon(get_icon("Folder", "EditorIcons"));
parent_browse_button->set_icon(get_icon("Folder", "EditorIcons"));
parent_search_button->set_icon(get_icon("ClassList", "EditorIcons"));
......
......@@ -667,6 +667,7 @@ void ColorPicker::set_presets_visible(bool p_visible) {
presets_visible = p_visible;
preset_separator->set_visible(p_visible);
preset_container->set_visible(p_visible);
preset_container2->set_visible(p_visible);
}
bool ColorPicker::are_presets_visible() const {
......