Skip to content

Commit

Permalink
主题适配
Browse files Browse the repository at this point in the history
  • Loading branch information
YangLang116 committed Oct 8, 2024
1 parent 94da69b commit bb054a0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.xtu.plugin.flutter.window.res;

import com.intellij.ide.ui.UISettingsListener;
import com.intellij.ide.ui.LafManagerListener;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.project.DumbAware;
Expand Down Expand Up @@ -56,7 +56,7 @@ private ResRootPanel initResWindow(@NotNull Project project, @NotNull ToolWindow

private void initThemeChangedListener(@NotNull IResRootPanel rootPanel) {
MessageBus messageBus = ApplicationManager.getApplication().getMessageBus();
messageBus.connect().subscribe(UISettingsListener.TOPIC, (UISettingsListener) rootPanel::uiSettingsChanged);
messageBus.connect().subscribe(LafManagerListener.TOPIC, (LafManagerListener) lafManager -> rootPanel.lookAndFeelChanged(lafManager));
}

private void initResWindowRefresher(@NotNull Project project, @NotNull IResRootPanel rootPanel) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.xtu.plugin.flutter.window.res.core;

import com.intellij.ide.ui.UISettings;
import com.intellij.ide.ui.LafManager;
import com.xtu.plugin.flutter.window.res.sort.SortType;
import org.jetbrains.annotations.NotNull;

Expand All @@ -26,5 +26,5 @@ public interface IResRootPanel {

JComponent asComponent();

void uiSettingsChanged(@NotNull UISettings uiSettings);
void lookAndFeelChanged(@NotNull LafManager lafManager);
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.xtu.plugin.flutter.window.res.ui;

import com.intellij.ide.DataManager;
import com.intellij.ide.ui.UISettings;
import com.intellij.ide.ui.LafManager;
import com.intellij.openapi.actionSystem.DataContext;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.popup.JBPopupFactory;
Expand Down Expand Up @@ -218,7 +218,7 @@ public JComponent asComponent() {
}

@Override
public void uiSettingsChanged(@NotNull UISettings uiSettings) {
public void lookAndFeelChanged(@NotNull LafManager lafManager) {
reloadItems(this.resList);
}

Expand Down

0 comments on commit bb054a0

Please sign in to comment.