Make theme changes also affect components that are not in UI tree. #2

This commit is contained in:
GraxCode 2022-04-17 15:56:47 +02:00
parent eded177040
commit c803a92b01
4 changed files with 12 additions and 0 deletions

View File

@ -11,6 +11,7 @@ import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.LdcInsnNode;
import org.objectweb.asm.tree.MethodNode;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme;
import the.bytecode.club.bytecodeviewer.resources.ResourceContainer;
import the.bytecode.club.bytecodeviewer.searching.EnterKeyEvent;
import the.bytecode.club.bytecodeviewer.searching.LDCSearchTreeNodeResult;
@ -53,6 +54,7 @@ public class LDCSearch implements SearchPanel
{
searchText = new JTextField("");
searchText.addKeyListener(EnterKeyEvent.SINGLETON);
LAFTheme.registerThemeUpdate(searchText);
}
@Override
@ -63,6 +65,7 @@ public class LDCSearch implements SearchPanel
myPanel = new JPanel(new BorderLayout(16, 16));
myPanel.add(new TranslatedJLabel("Search String: ", TranslatedComponents.SEARCH_STRING), BorderLayout.WEST);
myPanel.add(searchText, BorderLayout.CENTER);
LAFTheme.registerThemeUpdate(myPanel);
}
return myPanel;

View File

@ -4,6 +4,7 @@ import org.objectweb.asm.Type;
import org.objectweb.asm.tree.AnnotationNode;
import org.objectweb.asm.tree.ClassNode;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme;
import the.bytecode.club.bytecodeviewer.resources.ResourceContainer;
import the.bytecode.club.bytecodeviewer.searching.EnterKeyEvent;
import the.bytecode.club.bytecodeviewer.searching.LDCSearchTreeNodeResult;
@ -46,6 +47,7 @@ public class MemberWithAnnotationSearch implements SearchPanel {
public MemberWithAnnotationSearch() {
annotation = new JTextField("");
annotation.addKeyListener(EnterKeyEvent.SINGLETON);
LAFTheme.registerThemeUpdate(annotation);
}
@Override
@ -54,6 +56,7 @@ public class MemberWithAnnotationSearch implements SearchPanel {
myPanel = new JPanel(new BorderLayout(16, 16));
myPanel.add(new TranslatedJLabel("Annotation name: ", TranslatedComponents.ANNOTATION_NAME), BorderLayout.WEST);
myPanel.add(annotation, BorderLayout.CENTER);
LAFTheme.registerThemeUpdate(myPanel);
}
return myPanel;

View File

@ -12,6 +12,7 @@ import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme;
import the.bytecode.club.bytecodeviewer.resources.ResourceContainer;
import the.bytecode.club.bytecodeviewer.searching.EnterKeyEvent;
import the.bytecode.club.bytecodeviewer.searching.LDCSearchTreeNodeResult;
@ -60,6 +61,7 @@ public class MethodCallSearch implements SearchPanel
mName.addKeyListener(EnterKeyEvent.SINGLETON);
mDesc = new JTextField("");
mDesc.addKeyListener(EnterKeyEvent.SINGLETON);
LAFTheme.registerThemeUpdate(mOwner, mName, mDesc);
}
public JPanel getPanel()
@ -79,6 +81,7 @@ public class MethodCallSearch implements SearchPanel
right.add(mDesc);
myPanel.add(left, BorderLayout.WEST);
myPanel.add(right, BorderLayout.CENTER);
LAFTheme.registerThemeUpdate(myPanel);
}
return myPanel;

View File

@ -9,6 +9,7 @@ import org.objectweb.asm.Type;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.MethodNode;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme;
import the.bytecode.club.bytecodeviewer.resources.ResourceContainer;
import the.bytecode.club.bytecodeviewer.searching.EnterKeyEvent;
import the.bytecode.club.bytecodeviewer.searching.LDCSearchTreeNodeResult;
@ -54,6 +55,7 @@ public class RegexSearch implements SearchPanel
{
searchText = new JTextField("");
searchText.addKeyListener(EnterKeyEvent.SINGLETON);
LAFTheme.registerThemeUpdate(searchText);
}
@Override
@ -64,6 +66,7 @@ public class RegexSearch implements SearchPanel
myPanel = new JPanel(new BorderLayout(16, 16));
myPanel.add(new TranslatedJLabel("Search Regex: ", TranslatedComponents.SEARCH_REGEX), BorderLayout.WEST);
myPanel.add(searchText, BorderLayout.CENTER);
LAFTheme.registerThemeUpdate(myPanel);
}
return myPanel;