Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions editor/inspector/editor_inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1695,6 +1695,10 @@ void EditorInspectorCategory::_bind_methods() {

void EditorInspectorCategory::_notification(int p_what) {
switch (p_what) {
case NOTIFICATION_POSTINITIALIZE: {
connect(SceneStringName(theme_changed), callable_mp(this, &EditorInspectorCategory::_theme_changed));
} break;

case NOTIFICATION_ACCESSIBILITY_UPDATE: {
RID ae = get_accessibility_element();
ERR_FAIL_COND(ae.is_null());
Expand All @@ -1708,13 +1712,6 @@ void EditorInspectorCategory::_notification(int p_what) {
DisplayServer::get_singleton()->accessibility_update_add_action(ae, DisplayServer::AccessibilityAction::ACTION_SHOW_CONTEXT_MENU, callable_mp(this, &EditorInspectorCategory::_accessibility_action_menu));
} break;

case NOTIFICATION_THEME_CHANGED: {
EditorInspector::initialize_category_theme(theme_cache, this);
menu_icon_dirty = true;
_update_icon();
update_minimum_size();
} break;

case NOTIFICATION_TRANSLATION_CHANGED: {
if (is_favorite) {
label = TTR("Favorites");
Expand Down Expand Up @@ -1897,6 +1894,13 @@ void EditorInspectorCategory::_update_icon() {
}
}

void EditorInspectorCategory::_theme_changed() {
// This needs to be done via the signal, as it's fired before the minimum since is updated.
EditorInspector::initialize_category_theme(theme_cache, this);
menu_icon_dirty = true;
_update_icon();
}

void EditorInspectorCategory::gui_input(const Ref<InputEvent> &p_event) {
const Ref<InputEventMouseButton> &mb = p_event;
if (mb.is_valid() && mb->is_pressed() && mb->get_button_index() == MouseButton::RIGHT) {
Expand Down
1 change: 1 addition & 0 deletions editor/inspector/editor_inspector.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ class EditorInspectorCategory : public Control {
void _handle_menu_option(int p_option);
void _popup_context_menu(const Point2i &p_position);
void _update_icon();
void _theme_changed();

protected:
static void _bind_methods();
Expand Down