From 6f01eb2c07fed42a09dbbb9fd44281a216ee7685 Mon Sep 17 00:00:00 2001 From: Bruno Salmon Date: Tue, 28 May 2024 20:03:34 +0100 Subject: [PATCH] Moved PrimaryStage style attributes to CSS --- .../gwtj2cl/shared/GwtJ2clPrimaryStagePeer.java | 6 ------ .../webfx/css/webfx-kit-javafxgraphics-web@main.css | 12 ++++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/webfx-kit/webfx-kit-javafxgraphics-peers-gwt-j2cl/src/main/java/dev/webfx/kit/mapper/peers/javafxgraphics/gwtj2cl/shared/GwtJ2clPrimaryStagePeer.java b/webfx-kit/webfx-kit-javafxgraphics-peers-gwt-j2cl/src/main/java/dev/webfx/kit/mapper/peers/javafxgraphics/gwtj2cl/shared/GwtJ2clPrimaryStagePeer.java index e2c4e0182..131e1f2c8 100644 --- a/webfx-kit/webfx-kit-javafxgraphics-peers-gwt-j2cl/src/main/java/dev/webfx/kit/mapper/peers/javafxgraphics/gwtj2cl/shared/GwtJ2clPrimaryStagePeer.java +++ b/webfx-kit/webfx-kit-javafxgraphics-peers-gwt-j2cl/src/main/java/dev/webfx/kit/mapper/peers/javafxgraphics/gwtj2cl/shared/GwtJ2clPrimaryStagePeer.java @@ -32,12 +32,6 @@ public final class GwtJ2clPrimaryStagePeer extends StagePeerBase { public GwtJ2clPrimaryStagePeer(Stage stage) { super(stage); - // Disabling browser horizontal and vertical scroll bars - HtmlUtil.setStyleAttribute(document.documentElement, "overflow", "hidden"); - // Removing the default margin around the body, so it fills the whole browser tab - HtmlUtil.setStyleAttribute(document.body, "margin", "0"); - // Disabling default text selection (as in JavaFX) to avoid nasty selection graphical elements (buttons etc...) - HtmlUtil.setStyleAttribute(document.body, "user-select", "none"); // Considering the current window size changedWindowSize(); // And subsequent changes in the future diff --git a/webfx-kit/webfx-kit-javafxgraphics-peers-gwt-j2cl/src/main/webfx/css/webfx-kit-javafxgraphics-web@main.css b/webfx-kit/webfx-kit-javafxgraphics-peers-gwt-j2cl/src/main/webfx/css/webfx-kit-javafxgraphics-web@main.css index e2b66667a..c10bf5d7d 100644 --- a/webfx-kit/webfx-kit-javafxgraphics-peers-gwt-j2cl/src/main/webfx/css/webfx-kit-javafxgraphics-web@main.css +++ b/webfx-kit/webfx-kit-javafxgraphics-peers-gwt-j2cl/src/main/webfx/css/webfx-kit-javafxgraphics-web@main.css @@ -1,3 +1,15 @@ +/* Mocking some basic JavaFX behaviours */ +body { + overflow: hidden; /* Disabling browser horizontal and vertical scroll bars */ + margin: 0; /* Removing the default margin around the body */ + /* Disabling user selection by default */ + -webkit-touch-callout: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + /* Making disabled nodes semi-transparent */ .disabled { opacity: 50%;