You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-05 17:15:09 +00:00
Limit custom icons size in various editor widgets
This commit is contained in:
@@ -37,18 +37,6 @@
|
|||||||
#include "editor/editor_settings.h"
|
#include "editor/editor_settings.h"
|
||||||
#include "editor/editor_string_names.h"
|
#include "editor/editor_string_names.h"
|
||||||
|
|
||||||
void EditorHelpSearch::_update_icons() {
|
|
||||||
search_box->set_right_icon(results_tree->get_editor_theme_icon(SNAME("Search")));
|
|
||||||
search_box->set_clear_button_enabled(true);
|
|
||||||
search_box->add_theme_icon_override("right_icon", results_tree->get_editor_theme_icon(SNAME("Search")));
|
|
||||||
case_sensitive_button->set_icon(results_tree->get_editor_theme_icon(SNAME("MatchCase")));
|
|
||||||
hierarchy_button->set_icon(results_tree->get_editor_theme_icon(SNAME("ClassList")));
|
|
||||||
|
|
||||||
if (is_visible()) {
|
|
||||||
_update_results();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void EditorHelpSearch::_update_results() {
|
void EditorHelpSearch::_update_results() {
|
||||||
String term = search_box->get_text();
|
String term = search_box->get_text();
|
||||||
|
|
||||||
@@ -114,16 +102,24 @@ void EditorHelpSearch::_notification(int p_what) {
|
|||||||
}
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
|
|
||||||
_update_icons();
|
|
||||||
} break;
|
|
||||||
|
|
||||||
case NOTIFICATION_READY: {
|
case NOTIFICATION_READY: {
|
||||||
connect("confirmed", callable_mp(this, &EditorHelpSearch::_confirmed));
|
connect("confirmed", callable_mp(this, &EditorHelpSearch::_confirmed));
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
|
case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED:
|
||||||
case NOTIFICATION_THEME_CHANGED: {
|
case NOTIFICATION_THEME_CHANGED: {
|
||||||
_update_icons();
|
const int icon_width = get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor));
|
||||||
|
results_tree->add_theme_constant_override("icon_max_width", icon_width);
|
||||||
|
|
||||||
|
search_box->set_right_icon(get_editor_theme_icon(SNAME("Search")));
|
||||||
|
search_box->add_theme_icon_override("right_icon", get_editor_theme_icon(SNAME("Search")));
|
||||||
|
|
||||||
|
case_sensitive_button->set_icon(get_editor_theme_icon(SNAME("MatchCase")));
|
||||||
|
hierarchy_button->set_icon(get_editor_theme_icon(SNAME("ClassList")));
|
||||||
|
|
||||||
|
if (is_visible()) {
|
||||||
|
_update_results();
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case NOTIFICATION_PROCESS: {
|
case NOTIFICATION_PROCESS: {
|
||||||
@@ -204,6 +200,7 @@ EditorHelpSearch::EditorHelpSearch() {
|
|||||||
search_box = memnew(LineEdit);
|
search_box = memnew(LineEdit);
|
||||||
search_box->set_custom_minimum_size(Size2(200, 0) * EDSCALE);
|
search_box->set_custom_minimum_size(Size2(200, 0) * EDSCALE);
|
||||||
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
||||||
|
search_box->set_clear_button_enabled(true);
|
||||||
search_box->connect("gui_input", callable_mp(this, &EditorHelpSearch::_search_box_gui_input));
|
search_box->connect("gui_input", callable_mp(this, &EditorHelpSearch::_search_box_gui_input));
|
||||||
search_box->connect("text_changed", callable_mp(this, &EditorHelpSearch::_search_box_text_changed));
|
search_box->connect("text_changed", callable_mp(this, &EditorHelpSearch::_search_box_text_changed));
|
||||||
register_text_enter(search_box);
|
register_text_enter(search_box);
|
||||||
|
|||||||
@@ -67,7 +67,6 @@ class EditorHelpSearch : public ConfirmationDialog {
|
|||||||
class Runner;
|
class Runner;
|
||||||
Ref<Runner> search;
|
Ref<Runner> search;
|
||||||
|
|
||||||
void _update_icons();
|
|
||||||
void _update_results();
|
void _update_results();
|
||||||
|
|
||||||
void _search_box_gui_input(const Ref<InputEvent> &p_event);
|
void _search_box_gui_input(const Ref<InputEvent> &p_event);
|
||||||
|
|||||||
@@ -443,6 +443,9 @@ void InspectorDock::_notification(int p_what) {
|
|||||||
forward_button->set_icon(get_editor_theme_icon(SNAME("Forward")));
|
forward_button->set_icon(get_editor_theme_icon(SNAME("Forward")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const int icon_width = get_theme_constant(SNAME("class_icon_size"), EditorStringName(Editor));
|
||||||
|
history_menu->get_popup()->add_theme_constant_override("icon_max_width", icon_width);
|
||||||
|
|
||||||
history_menu->set_icon(get_editor_theme_icon(SNAME("History")));
|
history_menu->set_icon(get_editor_theme_icon(SNAME("History")));
|
||||||
object_menu->set_icon(get_editor_theme_icon(SNAME("Tools")));
|
object_menu->set_icon(get_editor_theme_icon(SNAME("Tools")));
|
||||||
search->set_right_icon(get_editor_theme_icon(SNAME("Search")));
|
search->set_right_icon(get_editor_theme_icon(SNAME("Search")));
|
||||||
|
|||||||
Reference in New Issue
Block a user