mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-25 09:00:26 +00:00
Fixes
This commit is contained in:
parent
781e1b3c84
commit
63a579cf05
5 changed files with 21 additions and 3 deletions
|
@ -43,6 +43,7 @@ public class AppTheme {
|
|||
|
||||
public static void initThemeHandlers(Stage stage) {
|
||||
Runnable r = () -> {
|
||||
stage.getScene().getRoot().getStyleClass().add(OsType.getLocal().getId());
|
||||
if (AppPrefs.get() == null) {
|
||||
var def = Theme.getDefaultLightTheme();
|
||||
stage.getScene().getRoot().getStyleClass().add(def.getCssId());
|
||||
|
|
|
@ -66,8 +66,8 @@ public class ModifiedStage extends Stage {
|
|||
}
|
||||
case OsType.MacOs macOs -> {
|
||||
var ctrl = new NativeMacOsWindowControl(stage);
|
||||
ctrl.setWindowDarkMode(AppPrefs.get().theme.getValue().isDark());
|
||||
var seamlessFrame = !AppPrefs.get().performanceMode().get() && mergeFrame();
|
||||
ctrl.setAppearance(seamlessFrame, AppPrefs.get().theme.getValue().isDark());
|
||||
stage.getScene().getRoot().pseudoClassStateChanged(PseudoClass.getPseudoClass("seamless-frame"), seamlessFrame);
|
||||
stage.getScene().getRoot().pseudoClassStateChanged(PseudoClass.getPseudoClass("separate-frame"), !seamlessFrame);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ public class NativeMacOsWindowControl {
|
|||
this.nsWindow = (long) nativeHandle;
|
||||
}
|
||||
|
||||
public void setWindowDarkMode(boolean darkMode) {
|
||||
public void setAppearance(boolean seamlessFrame, boolean darkMode) {
|
||||
if (!ModuleHelper.isImage()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
-fx-background-color: transparent;
|
||||
}
|
||||
|
||||
.root:seamless-frame {
|
||||
.root.macos:seamless-frame {
|
||||
-fx-padding: 0 0 27 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,6 +46,8 @@ public interface OsType {
|
|||
|
||||
sealed interface Local extends OsType permits OsType.Windows, OsType.Linux, OsType.MacOs {
|
||||
|
||||
String getId();
|
||||
|
||||
default Any toAny() {
|
||||
return (Any) this;
|
||||
}
|
||||
|
@ -131,6 +133,11 @@ public interface OsType {
|
|||
return "Windows";
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return "windows";
|
||||
}
|
||||
}
|
||||
|
||||
class Unix implements OsType {
|
||||
|
@ -197,6 +204,11 @@ public interface OsType {
|
|||
|
||||
final class Linux extends Unix implements OsType, Local, Any {
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return "linux";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String determineOperatingSystemName(ShellControl pc) throws Exception {
|
||||
try (CommandControl c = pc.command("lsb_release -a").start()) {
|
||||
|
@ -223,6 +235,11 @@ public interface OsType {
|
|||
|
||||
final class MacOs implements OsType, Local, Any {
|
||||
|
||||
@Override
|
||||
public String getId() {
|
||||
return "macos";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String makeFileSystemCompatible(String name) {
|
||||
// Technically the backslash is supported, but it causes all kinds of troubles, so we also exclude it
|
||||
|
|
Loading…
Reference in a new issue