From df5fb1ee8a1a8f1ba9da41408af27c85acdde66f Mon Sep 17 00:00:00 2001 From: Bruno Salmon Date: Sat, 11 May 2024 10:19:56 +0100 Subject: [PATCH] Simplified some background and border settings --- .../java/com/sun/javafx/scene/control/ContextMenuContent.java | 2 +- .../main/java/javafx/scene/control/skin/ContextMenuSkin.java | 2 +- .../src/main/java/javafx/scene/control/skin/TabPaneSkin.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/webfx-kit/webfx-kit-javafxcontrols-emul/src/main/java/com/sun/javafx/scene/control/ContextMenuContent.java b/webfx-kit/webfx-kit-javafxcontrols-emul/src/main/java/com/sun/javafx/scene/control/ContextMenuContent.java index 8a576b7039..969014b735 100644 --- a/webfx-kit/webfx-kit-javafxcontrols-emul/src/main/java/com/sun/javafx/scene/control/ContextMenuContent.java +++ b/webfx-kit/webfx-kit-javafxcontrols-emul/src/main/java/com/sun/javafx/scene/control/ContextMenuContent.java @@ -1175,7 +1175,7 @@ public MenuItemContainer(MenuItem item){ // WebFX hardcoded style setOnMouseEntered(e -> { - setBackground(new Background(new BackgroundFill(Color.web("#0096c9"), null, null))); + setBackground(Background.fill(Color.web("#0096c9"))); getLabel().setTextFill(Color.WHITE); }); setOnMouseExited(e -> { diff --git a/webfx-kit/webfx-kit-javafxcontrols-emul/src/main/java/javafx/scene/control/skin/ContextMenuSkin.java b/webfx-kit/webfx-kit-javafxcontrols-emul/src/main/java/javafx/scene/control/skin/ContextMenuSkin.java index ff9e92de0d..2b5542b80e 100644 --- a/webfx-kit/webfx-kit-javafxcontrols-emul/src/main/java/javafx/scene/control/skin/ContextMenuSkin.java +++ b/webfx-kit/webfx-kit-javafxcontrols-emul/src/main/java/javafx/scene/control/skin/ContextMenuSkin.java @@ -180,7 +180,7 @@ public ContextMenuSkin(final ContextMenu control) { } */ // WebFX hardcoded style - root.setBorder(new Border(new BorderStroke(Color.LIGHTGRAY, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderStroke.THIN))); + root.setBorder(Border.stroke(Color.LIGHTGRAY)); root.setPadding(new Insets(2, 0, 3 , 0)); } diff --git a/webfx-kit/webfx-kit-javafxcontrols-emul/src/main/java/javafx/scene/control/skin/TabPaneSkin.java b/webfx-kit/webfx-kit-javafxcontrols-emul/src/main/java/javafx/scene/control/skin/TabPaneSkin.java index b042e6ea12..1b482d4934 100644 --- a/webfx-kit/webfx-kit-javafxcontrols-emul/src/main/java/javafx/scene/control/skin/TabPaneSkin.java +++ b/webfx-kit/webfx-kit-javafxcontrols-emul/src/main/java/javafx/scene/control/skin/TabPaneSkin.java @@ -805,7 +805,7 @@ public TabHeaderArea() { });*/ // WebFX addition (styling tab-header-area) - headerBackground.setBackground(new Background(new BackgroundFill(Color.LIGHTGRAY, null, null))); + headerBackground.setBackground(Background.fill(Color.LIGHTGRAY)); //setBorder(new Border(new BorderStroke(Color.GRAY, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderStroke.THIN))); setPadding(new Insets(5, 0, 0, 10)); // Setting for TOP }