Expose Hyperlink looked-up color variables

This commit is contained in:
mkpaz 2022-09-12 20:03:17 +04:00
parent 465f199911
commit 38a5d73a3b
2 changed files with 17 additions and 3 deletions

@ -244,9 +244,14 @@ public class TypographyPage extends AbstractPage {
var linkVisited = hyperlink("_Visited", true, false); var linkVisited = hyperlink("_Visited", true, false);
linkVisited.setMnemonicParsing(true); linkVisited.setMnemonicParsing(true);
var linkBroken = hyperlink("_Broken", true, false);
linkBroken.setStyle("-color-link-fg-visited:-color-danger-fg;");
linkBroken.setMnemonicParsing(true);
var box = new HBox(10, var box = new HBox(10,
linkNormal, linkNormal,
linkVisited, linkVisited,
linkBroken,
hyperlink("Disabled", false, true) hyperlink("Disabled", false, true)
); );
box.setAlignment(Pos.BASELINE_LEFT); box.setAlignment(Pos.BASELINE_LEFT);

@ -2,17 +2,26 @@
@use "../settings/config"as cfg; @use "../settings/config"as cfg;
$color-fg: -color-accent-fg !default;
$color-fg-visited: -color-fg-default !default;
$color-fg-armed: -color-fg-default !default;
.hyperlink { .hyperlink {
-color-link-fg: $color-fg;
-color-link-fg-visited: $color-fg-visited;
-color-link-fg-armed: $color-fg-armed;
-fx-cursor: hand; -fx-cursor: hand;
-fx-underline: true; -fx-underline: true;
-fx-text-fill: -color-accent-fg; -fx-text-fill: -color-link-fg;
&:visited { &:visited {
-fx-text-fill: -color-fg-default; -fx-text-fill: -color-link-fg-visited;
} }
&:armed { &:armed {
-fx-text-fill: -color-fg-default; -fx-text-fill: -color-link-fg-armed;
-fx-underline: false; -fx-underline: false;
} }