diff --git a/sampler/src/main/java/atlantafx/sampler/page/ExampleBox.java b/sampler/src/main/java/atlantafx/sampler/page/ExampleBox.java index 1363fc9..4b08ea8 100644 --- a/sampler/src/main/java/atlantafx/sampler/page/ExampleBox.java +++ b/sampler/src/main/java/atlantafx/sampler/page/ExampleBox.java @@ -11,17 +11,15 @@ import javafx.beans.property.SimpleObjectProperty; import javafx.css.PseudoClass; import javafx.geometry.Insets; import javafx.geometry.Pos; +import javafx.scene.Cursor; import javafx.scene.Node; import javafx.scene.control.Button; import javafx.scene.control.Label; -import javafx.scene.control.Tooltip; import javafx.scene.input.Clipboard; import javafx.scene.input.ClipboardContent; import javafx.scene.layout.HBox; import javafx.scene.layout.VBox; import org.jetbrains.annotations.Nullable; -import org.kordamp.ikonli.javafx.FontIcon; -import org.kordamp.ikonli.material2.Material2OutlinedAL; // This widget emulates TabPane behavior, because TabPane itself doesn't work as it should: // https://bugs.openjdk.org/browse/JDK-8145490 @@ -44,9 +42,9 @@ public class ExampleBox extends VBox { var previewTab = createTabLabel("Preview"); var codeTab = createTabLabel("Code"); - var copyBtn = new Button("", new FontIcon(Material2OutlinedAL.CODE)); - copyBtn.getStyleClass().addAll(Styles.BUTTON_CIRCLE, Styles.FLAT, Styles.SMALL); - copyBtn.setTooltip(new Tooltip("Copy source code")); + var copyBtn = new Button("copy source code"); + copyBtn.setCursor(Cursor.HAND); + copyBtn.getStyleClass().addAll(Styles.FLAT, Styles.SMALL); stateToggle = new ToggleSwitch(); HBox.setMargin(stateToggle, new Insets(0, 0, 0, 10)); diff --git a/sampler/src/main/resources/atlantafx/sampler/assets/styles/scss/layout/_page.scss b/sampler/src/main/resources/atlantafx/sampler/assets/styles/scss/layout/_page.scss index 4e83ee6..a22b351 100644 --- a/sampler/src/main/resources/atlantafx/sampler/assets/styles/scss/layout/_page.scss +++ b/sampler/src/main/resources/atlantafx/sampler/assets/styles/scss/layout/_page.scss @@ -29,9 +29,18 @@ } .snippet { + -fx-border-radius: 8px; + -fx-border-color: transparent; + -fx-border-width: 3px; + + &:hover { + -fx-border-color: -color-accent-muted; + } + >TextFlow { -fx-padding: 10px; -fx-background-color: -color-bg-inset; + -fx-background-radius: 8px; -fx-font-family: monospace; }