diff options
Diffstat (limited to 'scene')
-rw-r--r-- | scene/gui/line_edit.cpp | 11 | ||||
-rw-r--r-- | scene/gui/popup_menu.cpp | 11 | ||||
-rw-r--r-- | scene/gui/popup_menu.h | 1 | ||||
-rw-r--r-- | scene/resources/sky_box.cpp | 9 |
4 files changed, 25 insertions, 7 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 8d3271ca8c..adcf86357d 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -574,8 +574,12 @@ void LineEdit::_notification(int p_what) { RID ci = get_canvas_item(); Ref<StyleBox> style = get_stylebox("normal"); - if (!is_editable()) + float disabled_alpha = 1.0; // used to set the disabled input text color + if (!is_editable()) { style = get_stylebox("read_only"); + disabled_alpha = .5; + draw_caret = false; + } Ref<Font> font = get_font("font"); @@ -622,6 +626,7 @@ void LineEdit::_notification(int p_what) { // draw placeholder color if (text.empty()) font_color.a *= placeholder_alpha; + font_color.a *= disabled_alpha; int caret_height = font->get_height() > y_area ? y_area : font->get_height(); while (true) { @@ -1191,7 +1196,9 @@ void LineEdit::menu_option(int p_option) { select_all(); } break; case MENU_UNDO: { - undo(); + if (editable) { + undo(); + } } break; } } diff --git a/scene/gui/popup_menu.cpp b/scene/gui/popup_menu.cpp index 072e90df3a..864fb3d3d5 100644 --- a/scene/gui/popup_menu.cpp +++ b/scene/gui/popup_menu.cpp @@ -696,6 +696,17 @@ String PopupMenu::get_item_text(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, items.size(), ""); return items[p_idx].text; } + +int PopupMenu::get_item_idx_from_text(const String &text) const { + + for (int idx = 0; idx < items.size(); idx++) { + if (items[idx].text == text) + return idx; + } + + return -1; +} + Ref<Texture> PopupMenu::get_item_icon(int p_idx) const { ERR_FAIL_INDEX_V(p_idx, items.size(), Ref<Texture>()); diff --git a/scene/gui/popup_menu.h b/scene/gui/popup_menu.h index a9bd8f7e50..6f1a2db363 100644 --- a/scene/gui/popup_menu.h +++ b/scene/gui/popup_menu.h @@ -132,6 +132,7 @@ public: void toggle_item_checked(int p_idx); String get_item_text(int p_idx) const; + int get_item_idx_from_text(const String &text) const; Ref<Texture> get_item_icon(int p_idx) const; bool is_item_checked(int p_idx) const; int get_item_ID(int p_idx) const; diff --git a/scene/resources/sky_box.cpp b/scene/resources/sky_box.cpp index 61aaaf8fb4..c373ad67ee 100644 --- a/scene/resources/sky_box.cpp +++ b/scene/resources/sky_box.cpp @@ -474,15 +474,14 @@ ProceduralSky::ProceduralSky() { texture = VS::get_singleton()->texture_create(); update_queued = false; - - sky_top_color = Color::hex(0x4d67e8ff); + sky_top_color = Color::hex(0x0c74f9ff); sky_horizon_color = Color::hex(0x8ed2e8ff); sky_curve = 0.25; sky_energy = 1; - ground_bottom_color = Color::hex(0x322719ff); - ground_horizon_color = Color::hex(0x543610ff); - ground_curve = 0.25; + ground_bottom_color = Color::hex(0x1a2530ff); + ground_horizon_color = Color::hex(0x7bc9f3ff); + ground_curve = 0.01; ground_energy = 1; sun_color = Color(1, 1, 1); |