diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_node.cpp | 6 | ||||
-rw-r--r-- | editor/editor_node.h | 2 | ||||
-rw-r--r-- | editor/editor_themes.cpp | 12 | ||||
-rw-r--r-- | editor/find_in_files.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_map_editor.cpp | 6 | ||||
-rw-r--r-- | editor/plugins/tiles/tile_set_atlas_source_editor.cpp | 6 |
6 files changed, 29 insertions, 9 deletions
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp index 891705da98..b4980fe074 100644 --- a/editor/editor_node.cpp +++ b/editor/editor_node.cpp @@ -562,9 +562,9 @@ void EditorNode::_notification(int p_what) { last_checked_version = editor_data.get_undo_redo().get_version(); } - // update the animation frame of the update spinner + // Update the animation frame of the update spinner. uint64_t frame = Engine::get_singleton()->get_frames_drawn(); - uint32_t tick = OS::get_singleton()->get_ticks_msec(); + uint64_t tick = OS::get_singleton()->get_ticks_msec(); if (frame != update_spinner_step_frame && (tick - update_spinner_step_msec) > (1000 / 8)) { update_spinner_step++; @@ -575,7 +575,7 @@ void EditorNode::_notification(int p_what) { update_spinner_step_msec = tick; update_spinner_step_frame = frame + 1; - // update the icon itself only when the spinner is visible + // Update the icon itself only when the spinner is visible. if (EditorSettings::get_singleton()->get("interface/editor/show_update_spinner")) { update_spinner->set_icon(gui_base->get_theme_icon("Progress" + itos(update_spinner_step + 1), SNAME("EditorIcons"))); } diff --git a/editor/editor_node.h b/editor/editor_node.h index c64bcc0460..03e5146d98 100644 --- a/editor/editor_node.h +++ b/editor/editor_node.h @@ -407,7 +407,7 @@ private: bool waiting_for_sources_changed; - uint32_t update_spinner_step_msec; + uint64_t update_spinner_step_msec; uint64_t update_spinner_step_frame; int update_spinner_step; diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index fdcc0438ae..06c39a957c 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -384,6 +384,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { const Color font_color = mono_color.lerp(base_color, 0.25); const Color font_hover_color = mono_color.lerp(base_color, 0.125); + const Color font_focus_color = mono_color.lerp(base_color, 0.125); const Color font_disabled_color = Color(mono_color.r, mono_color.g, mono_color.b, 0.3); const Color font_readonly_color = Color(mono_color.r, mono_color.g, mono_color.b, 0.65); const Color selection_color = accent_color * Color(1, 1, 1, 0.4); @@ -392,6 +393,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { Color icon_hover_color = Color(1, 1, 1) * (dark_theme ? 1.15 : 1.45); icon_hover_color.a = 1.0; + Color icon_focus_color = icon_hover_color; // Make the pressed icon color overbright because icons are not completely white on a dark theme. // On a light theme, icons are dark, so we need to modulate them with an even brighter color. Color icon_pressed_color = accent_color * (dark_theme ? 1.15 : 3.5); @@ -625,6 +627,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("font_color", "MenuButton", font_color); theme->set_color("font_hover_color", "MenuButton", font_hover_color); + theme->set_color("font_focus_color", "MenuButton", font_focus_color); theme->set_stylebox("MenuHover", "EditorStyles", style_widget_hover); @@ -637,9 +640,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("font_color", "Button", font_color); theme->set_color("font_hover_color", "Button", font_hover_color); + theme->set_color("font_focus_color", "Button", font_focus_color); theme->set_color("font_pressed_color", "Button", accent_color); theme->set_color("font_disabled_color", "Button", font_disabled_color); theme->set_color("icon_hover_color", "Button", icon_hover_color); + theme->set_color("icon_focus_color", "Button", icon_focus_color); theme->set_color("icon_pressed_color", "Button", icon_pressed_color); // OptionButton @@ -657,9 +662,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("font_color", "OptionButton", font_color); theme->set_color("font_hover_color", "OptionButton", font_hover_color); + theme->set_color("font_focus_color", "OptionButton", font_focus_color); theme->set_color("font_pressed_color", "OptionButton", accent_color); theme->set_color("font_disabled_color", "OptionButton", font_disabled_color); theme->set_color("icon_hover_color", "OptionButton", icon_hover_color); + theme->set_color("icon_focus_color", "OptionButton", icon_focus_color); theme->set_icon("arrow", "OptionButton", theme->get_icon("GuiOptionArrow", "EditorIcons")); theme->set_constant("arrow_margin", "OptionButton", widget_default_margin.x - 2 * EDSCALE); theme->set_constant("modulate_arrow", "OptionButton", true); @@ -683,9 +690,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("font_color", "CheckButton", font_color); theme->set_color("font_hover_color", "CheckButton", font_hover_color); + theme->set_color("font_focus_color", "CheckButton", font_focus_color); theme->set_color("font_pressed_color", "CheckButton", accent_color); theme->set_color("font_disabled_color", "CheckButton", font_disabled_color); theme->set_color("icon_hover_color", "CheckButton", icon_hover_color); + theme->set_color("icon_focus_color", "CheckButton", icon_focus_color); theme->set_constant("hseparation", "CheckButton", 8 * EDSCALE); theme->set_constant("check_vadjust", "CheckButton", 0 * EDSCALE); @@ -712,9 +721,11 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_color("font_color", "CheckBox", font_color); theme->set_color("font_hover_color", "CheckBox", font_hover_color); + theme->set_color("font_focus_color", "CheckBox", font_focus_color); theme->set_color("font_pressed_color", "CheckBox", accent_color); theme->set_color("font_disabled_color", "CheckBox", font_disabled_color); theme->set_color("icon_hover_color", "CheckBox", icon_hover_color); + theme->set_color("icon_focus_color", "CheckBox", icon_focus_color); theme->set_constant("hseparation", "CheckBox", 8 * EDSCALE); theme->set_constant("check_vadjust", "CheckBox", 0 * EDSCALE); @@ -1219,6 +1230,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) { theme->set_stylebox("focus", "LinkButton", style_empty); theme->set_color("font_color", "LinkButton", font_color); theme->set_color("font_hover_color", "LinkButton", font_hover_color); + theme->set_color("font_focus_color", "LinkButton", font_focus_color); theme->set_color("font_pressed_color", "LinkButton", accent_color); theme->set_color("font_disabled_color", "LinkButton", font_disabled_color); diff --git a/editor/find_in_files.cpp b/editor/find_in_files.cpp index 283496c0f1..6ed12c31ff 100644 --- a/editor/find_in_files.cpp +++ b/editor/find_in_files.cpp @@ -148,11 +148,11 @@ void FindInFiles::_process() { // This part can be moved to a thread if needed OS &os = *OS::get_singleton(); - float time_before = os.get_ticks_msec(); + uint64_t time_before = os.get_ticks_msec(); while (is_processing()) { _iterate(); - float elapsed = (os.get_ticks_msec() - time_before); - if (elapsed > 1000.0 / 120.0) { + uint64_t elapsed = (os.get_ticks_msec() - time_before); + if (elapsed > 8) { // Process again after waiting 8 ticks break; } } diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index 5b7ec6c8db..21ef94b999 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -2894,7 +2894,11 @@ void TileMapEditor::_layers_selection_button_draw() { clr = get_theme_color(SNAME("font_disabled_color")); break; default: - clr = get_theme_color(SNAME("font_color")); + if (layers_selection_button->has_focus()) { + clr = get_theme_color(SNAME("font_focus_color")); + } else { + clr = get_theme_color(SNAME("font_color")); + } } } diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index c8892bceaa..ae744f697b 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -841,7 +841,11 @@ void TileSetAtlasSourceEditor::_tile_data_editor_dropdown_button_draw() { clr = get_theme_color(SNAME("font_disabled_color")); break; default: - clr = get_theme_color(SNAME("font_color")); + if (tile_data_editor_dropdown_button->has_focus()) { + clr = get_theme_color(SNAME("font_focus_color")); + } else { + clr = get_theme_color(SNAME("font_color")); + } } } |