mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-05-03 11:20:34 +00:00
Rework
This commit is contained in:
@@ -108,7 +108,7 @@ public class AppMainWindow {
|
||||
var scene = new Scene(content, -1, -1, false);
|
||||
content.prefWidthProperty().bind(scene.widthProperty());
|
||||
content.prefHeightProperty().bind(scene.heightProperty());
|
||||
scene.setFill(Color.TRANSPARENT);
|
||||
AppWindowStyle.setSceneFill(scene);
|
||||
|
||||
stage.setScene(scene);
|
||||
if (AppPrefs.get() != null) {
|
||||
|
||||
@@ -86,7 +86,7 @@ public class AppSideWindow {
|
||||
if (AppMainWindow.get() != null && AppMainWindow.get().getStage().isShowing() && !AppMainWindow.get().getStage().isIconified()) {
|
||||
alert.initOwner(AppMainWindow.get().getStage());
|
||||
}
|
||||
alert.getDialogPane().getScene().setFill(Color.TRANSPARENT);
|
||||
AppWindowStyle.setSceneFill(alert.getDialogPane().getScene());
|
||||
var stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
||||
AppModifiedStage.prepareStage(stage);
|
||||
AppWindowStyle.addIcons(stage);
|
||||
|
||||
@@ -2,15 +2,18 @@ package io.xpipe.app.core.window;
|
||||
|
||||
import io.xpipe.app.core.*;
|
||||
import io.xpipe.app.issue.TrackEvent;
|
||||
import io.xpipe.app.prefs.AppPrefs;
|
||||
import io.xpipe.app.util.GlobalTimer;
|
||||
import io.xpipe.core.OsType;
|
||||
|
||||
import javafx.application.Platform;
|
||||
import javafx.beans.binding.Bindings;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.beans.property.SimpleObjectProperty;
|
||||
import javafx.css.PseudoClass;
|
||||
import javafx.scene.Scene;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.time.Duration;
|
||||
@@ -19,6 +22,17 @@ import java.util.List;
|
||||
|
||||
public class AppWindowStyle {
|
||||
|
||||
public static void setSceneFill(Scene scene) {
|
||||
if (OsType.ofLocal() != OsType.LINUX) {
|
||||
scene.setFill(Color.TRANSPARENT);
|
||||
return;
|
||||
}
|
||||
|
||||
scene.fillProperty().bind(Bindings.createObjectBinding(() -> {
|
||||
return AppPrefs.get() != null && AppPrefs.get().theme().getValue().isDark() ? Color.BLACK : Color.WHITE;
|
||||
}, AppPrefs.get().theme()));
|
||||
}
|
||||
|
||||
public static void addMaximizedPseudoClass(Stage stage) {
|
||||
stage.getScene().rootProperty().subscribe(root -> {
|
||||
stage.maximizedProperty().subscribe(v -> {
|
||||
|
||||
@@ -85,7 +85,7 @@ public class RemoteDesktopWindow {
|
||||
stage = new Stage();
|
||||
stage.initStyle(StageStyle.UNIFIED);
|
||||
var scene = new Scene(new Region());
|
||||
scene.setFill(Color.TRANSPARENT);
|
||||
AppWindowStyle.setSceneFill(scene);
|
||||
stage.setScene(scene);
|
||||
stage.getScene().setRoot(new RemoteDesktopDockComp().build());
|
||||
stage.setWidth(AppMainWindow.get() != null ? AppMainWindow.get().getStage().getWidth() : 1280);
|
||||
|
||||
Reference in New Issue
Block a user