This commit is contained in:
crschnick 2024-06-19 18:08:24 +00:00
parent 9e98004a71
commit bf4c8d8f5b
4 changed files with 15 additions and 4 deletions

View file

@ -35,7 +35,7 @@ public abstract class PlatformMode extends OperationMode {
AppStyle.init();
AppImages.init();
AppLayoutModel.init();
ModifiedStage.hook();
ModifiedStage.init();
TrackEvent.info("Finished essential component initialization before platform");
TrackEvent.info("Launching application ...");

View file

@ -13,7 +13,7 @@ public class ModifiedStage extends Stage {
@SneakyThrows
@SuppressWarnings("unchecked")
public static void hook() {
public static void init() {
var windowsField = Window.class.getDeclaredField("windows");
windowsField.setAccessible(true);
ObservableList<Window> list = (ObservableList<Window>) windowsField.get(null);
@ -32,9 +32,18 @@ public class ModifiedStage extends Stage {
return;
}
if (AppPrefs.get() == null) {
return;
}
var ctrl = new NativeWinWindowControl(stage);
ctrl.setWindowAttribute(DmwaWindowAttribute.DWMWA_USE_IMMERSIVE_DARK_MODE.getValue(), AppPrefs.get().theme.getValue().isDark());
var backdrop = ctrl.setWindowBackdrop(DwmSystemBackDropType.MICA_ALT);
boolean backdrop;
if (AppPrefs.get().performanceMode().get()) {
backdrop = false;
} else {
backdrop = ctrl.setWindowBackdrop(DwmSystemBackDropType.MICA_ALT);
}
stage.getScene().getRoot().pseudoClassStateChanged(PseudoClass.getPseudoClass("seamless-frame"), backdrop);
stage.getScene().getRoot().pseudoClassStateChanged(PseudoClass.getPseudoClass("separate-frame"), !backdrop);
}

View file

@ -1,6 +1,6 @@
.scroll-bar:vertical {
-fx-pref-width: 0.3em;
-fx-padding: 0.3em 0 0.3em 0;
-fx-padding: 0.4em 0 0.3em 0;
-fx-background-color: transparent;
}

View file

@ -18,6 +18,8 @@
}
.root:seamless-frame .background {
-fx-background-insets: 5 0 0 0;
-fx-border-insets: 5 0 0 0;
-fx-background-radius: 0 10 0 0;
-fx-border-radius: 0 10 0 0;
-fx-border-width: 1 1 0 0;