mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-06 12:00:04 +02:00
GP-1 Fixed a few minor issues with new theming code
This commit is contained in:
parent
e657a70141
commit
4763ce6e8a
8 changed files with 31 additions and 8 deletions
|
@ -44,7 +44,6 @@ public class ThemeFileLoader {
|
|||
Application.findFilesByExtensionInApplication(".theme.properties");
|
||||
|
||||
for (ResourceFile resourceFile : themeDefaultFiles) {
|
||||
Msg.debug(this, "found theme file: " + resourceFile.getAbsolutePath());
|
||||
try {
|
||||
ThemePropertyFileReader reader = new ThemePropertyFileReader(resourceFile);
|
||||
defaults.load(reader.getDefaultValues());
|
||||
|
|
|
@ -93,7 +93,7 @@ public abstract class ThemeValue<T> implements Comparable<ThemeValue<T>> {
|
|||
// loop resolving indirect references
|
||||
while (referred != null) {
|
||||
if (referred.value != null) {
|
||||
return referred.value;
|
||||
return referred.get(values);
|
||||
}
|
||||
visitedKeys.add(referred.id);
|
||||
if (visitedKeys.contains(referred.referenceId)) {
|
||||
|
|
|
@ -123,6 +123,30 @@ public class IconValueTest {
|
|||
|
||||
@Test
|
||||
public void testParseWithOverlays() throws ParseException {
|
||||
IconValue value = IconValue.parse("icon.foo", "EMPTY_ICON{Plus2.png}");
|
||||
values.addIcon(value);
|
||||
value = IconValue.parse("icon.test",
|
||||
"images/core.png[size(25,25)]{icon.foo[move(4,4)]}");
|
||||
|
||||
assertEquals("icon.test", value.getId());
|
||||
Icon icon = value.get(values);
|
||||
|
||||
assertTrue(icon instanceof MultiIcon);
|
||||
MultiIcon multiIcon = (MultiIcon) icon;
|
||||
Icon[] icons = multiIcon.getIcons();
|
||||
assertEquals(2, icons.length);
|
||||
assertEquals(25, icons[0].getIconWidth());
|
||||
assertEquals(25, icons[0].getIconWidth());
|
||||
assertEquals(16, icons[1].getIconWidth());
|
||||
assertEquals(16, icons[1].getIconWidth());
|
||||
assertTrue(icons[1] instanceof TranslateIcon);
|
||||
TranslateIcon tIcon = (TranslateIcon) icons[1];
|
||||
Icon baseIcon = tIcon.getBaseIcon();
|
||||
assertTrue(baseIcon instanceof MultiIcon);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testParseWithModifiedOverlay() throws ParseException {
|
||||
IconValue value = IconValue.parse("icon.test",
|
||||
"images/core.png[size(25,25)]{images/flag.png[size(8,8)][move(4,4)]}");
|
||||
assertEquals("icon.test", value.getId());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue