mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-24 01:15:35 +00:00
Fix stage style blank screen issue
This commit is contained in:
@@ -11,7 +11,6 @@ import io.xpipe.app.prefs.AppPrefs;
|
||||
import io.xpipe.app.prefs.CloseBehaviourAlert;
|
||||
import io.xpipe.app.util.ThreadHelper;
|
||||
import io.xpipe.core.process.OsType;
|
||||
|
||||
import javafx.beans.property.BooleanProperty;
|
||||
import javafx.beans.property.SimpleBooleanProperty;
|
||||
import javafx.geometry.Rectangle2D;
|
||||
@@ -22,19 +21,17 @@ import javafx.scene.layout.Region;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.stage.Screen;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.StageStyle;
|
||||
|
||||
import lombok.Builder;
|
||||
import lombok.Getter;
|
||||
import lombok.Value;
|
||||
import lombok.extern.jackson.Jacksonized;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Path;
|
||||
import java.time.Duration;
|
||||
import java.time.Instant;
|
||||
import java.time.temporal.ChronoUnit;
|
||||
import javax.imageio.ImageIO;
|
||||
|
||||
public class AppMainWindow {
|
||||
|
||||
@@ -55,7 +52,7 @@ public class AppMainWindow {
|
||||
INSTANCE = new AppMainWindow(stage);
|
||||
var scene = new Scene(new Region(), -1, -1, false);
|
||||
scene.setFill(Color.TRANSPARENT);
|
||||
stage.initStyle(StageStyle.UNIFIED);
|
||||
ModifiedStage.prepareStage(stage);
|
||||
stage.setScene(scene);
|
||||
AppWindowHelper.setupStylesheets(stage.getScene());
|
||||
return INSTANCE;
|
||||
|
||||
@@ -64,7 +64,7 @@ public class AppWindowHelper {
|
||||
public static Stage sideWindow(
|
||||
String title, Function<Stage, Comp<?>> contentFunc, boolean bindSize, ObservableValue<Boolean> loading) {
|
||||
var stage = AppWindowBounds.centerStage();
|
||||
stage.initStyle(StageStyle.UNIFIED);
|
||||
ModifiedStage.prepareStage(stage);
|
||||
if (AppMainWindow.getInstance() != null) {
|
||||
stage.initOwner(AppMainWindow.getInstance().getStage());
|
||||
}
|
||||
@@ -190,7 +190,7 @@ public class AppWindowHelper {
|
||||
}
|
||||
alert.getDialogPane().getScene().setFill(Color.TRANSPARENT);
|
||||
var stage = (Stage) alert.getDialogPane().getScene().getWindow();
|
||||
stage.initStyle(StageStyle.UNIFIED);
|
||||
ModifiedStage.prepareStage(stage);
|
||||
addIcons(stage);
|
||||
setupStylesheets(alert.getDialogPane().getScene());
|
||||
return alert;
|
||||
|
||||
@@ -10,10 +10,12 @@ import javafx.collections.ListChangeListener;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.css.PseudoClass;
|
||||
import javafx.stage.Stage;
|
||||
import javafx.stage.StageStyle;
|
||||
import javafx.stage.Window;
|
||||
import javafx.util.Duration;
|
||||
|
||||
import lombok.SneakyThrows;
|
||||
import org.apache.commons.lang3.SystemUtils;
|
||||
|
||||
public class ModifiedStage extends Stage {
|
||||
|
||||
@@ -33,6 +35,12 @@ public class ModifiedStage extends Stage {
|
||||
});
|
||||
}
|
||||
|
||||
public static void prepareStage(Stage stage) {
|
||||
if (SystemUtils.IS_OS_WINDOWS_11) {
|
||||
stage.initStyle(StageStyle.UNIFIED);
|
||||
}
|
||||
}
|
||||
|
||||
private static void hookUpStage(Stage stage) {
|
||||
applyModes(stage);
|
||||
if (AppPrefs.get() != null) {
|
||||
|
||||
Reference in New Issue
Block a user