mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-21 23:20:23 +00:00
Fixes
This commit is contained in:
parent
69a55884af
commit
7a6ebe487f
3 changed files with 22 additions and 14 deletions
|
@ -33,12 +33,14 @@ public class ModifiedStage extends Stage {
|
||||||
|
|
||||||
private static void hookUpStage(Stage stage) {
|
private static void hookUpStage(Stage stage) {
|
||||||
applyModes(stage);
|
applyModes(stage);
|
||||||
AppPrefs.get().theme.addListener((observable, oldValue, newValue) -> {
|
if (AppPrefs.get() != null) {
|
||||||
updateStage(stage);
|
AppPrefs.get().theme.addListener((observable, oldValue, newValue) -> {
|
||||||
});
|
updateStage(stage);
|
||||||
AppPrefs.get().performanceMode().addListener((observable, oldValue, newValue) -> {
|
});
|
||||||
updateStage(stage);
|
AppPrefs.get().performanceMode().addListener((observable, oldValue, newValue) -> {
|
||||||
});
|
updateStage(stage);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void applyModes(Stage stage) {
|
private static void applyModes(Stage stage) {
|
||||||
|
|
|
@ -93,8 +93,9 @@ public class PrettyImageComp extends SimpleComp {
|
||||||
stack.getChildren().add(storeIcon);
|
stack.getChildren().add(storeIcon);
|
||||||
|
|
||||||
Consumer<String> update = val -> {
|
Consumer<String> update = val -> {
|
||||||
|
var useDark = AppPrefs.get() != null && AppPrefs.get().theme.get() != null && AppPrefs.get().theme.get().isDark();
|
||||||
var fixed = val != null
|
var fixed = val != null
|
||||||
? FileNames.getBaseName(val) + (AppPrefs.get().theme.get().isDark() ? "-dark" : "") + "."
|
? FileNames.getBaseName(val) + (useDark ? "-dark" : "") + "."
|
||||||
+ FileNames.getExtension(val)
|
+ FileNames.getExtension(val)
|
||||||
: null;
|
: null;
|
||||||
image.set(fixed);
|
image.set(fixed);
|
||||||
|
@ -107,9 +108,11 @@ public class PrettyImageComp extends SimpleComp {
|
||||||
};
|
};
|
||||||
|
|
||||||
PlatformThread.sync(value).subscribe(update);
|
PlatformThread.sync(value).subscribe(update);
|
||||||
AppPrefs.get().theme.addListener((observable, oldValue, newValue) -> {
|
if (AppPrefs.get() != null) {
|
||||||
update.accept(value.getValue());
|
AppPrefs.get().theme.addListener((observable, oldValue, newValue) -> {
|
||||||
});
|
update.accept(value.getValue());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
stack.setFocusTraversable(false);
|
stack.setFocusTraversable(false);
|
||||||
stack.setPrefWidth(width);
|
stack.setPrefWidth(width);
|
||||||
|
|
|
@ -88,17 +88,20 @@ public class PrettySvgComp extends SimpleComp {
|
||||||
}
|
}
|
||||||
|
|
||||||
Consumer<String> update = val -> {
|
Consumer<String> update = val -> {
|
||||||
|
var useDark = AppPrefs.get() != null && AppPrefs.get().theme.get() != null && AppPrefs.get().theme.get().isDark();
|
||||||
var fixed = val != null
|
var fixed = val != null
|
||||||
? FileNames.getBaseName(val) + (AppPrefs.get().theme.get().isDark() ? "-dark" : "") + "."
|
? FileNames.getBaseName(val) + (useDark ? "-dark" : "") + "."
|
||||||
+ FileNames.getExtension(val)
|
+ FileNames.getExtension(val)
|
||||||
: null;
|
: null;
|
||||||
image.set(fixed);
|
image.set(fixed);
|
||||||
};
|
};
|
||||||
|
|
||||||
syncValue.subscribe(update);
|
syncValue.subscribe(update);
|
||||||
AppPrefs.get().theme.addListener((observable, oldValue, newValue) -> {
|
if (AppPrefs.get() != null) {
|
||||||
update.accept(syncValue.getValue());
|
AppPrefs.get().theme.addListener((observable, oldValue, newValue) -> {
|
||||||
});
|
update.accept(syncValue.getValue());
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
stack.setFocusTraversable(false);
|
stack.setFocusTraversable(false);
|
||||||
stack.setPrefWidth(width);
|
stack.setPrefWidth(width);
|
||||||
|
|
Loading…
Reference in a new issue