Skip to content

Commit

Permalink
Moved PrimaryStage style attributes to CSS
Browse files Browse the repository at this point in the history
  • Loading branch information
salmonb committed May 28, 2024
1 parent db62b22 commit 6f01eb2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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%;
Expand Down

0 comments on commit 6f01eb2

Please sign in to comment.