Skip to content

Commit 42ff6d9

Browse files
committed
Make tooltips have a 400ms delay instead of default 1000ms
1 parent b494741 commit 42ff6d9

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
### Changes
88

9+
- Make tooltips have a 400ms delay instead of default 1000ms
10+
911
### Bugs fixed
1012

1113
## 3.9.1 (12-01-2024)

src-dbg/flow_storm/debugger/ui/utils.clj

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
[javafx.beans.value ObservableValue]
1717
[javafx.scene Node]
1818
[javafx.scene.layout HBox Priority VBox Region]
19+
[javafx.util Duration]
1920
[java.util.function Predicate]
2021
[org.kordamp.ikonli.javafx FontIcon]
2122
[javafx.collections FXCollections ObservableList]
@@ -127,6 +128,10 @@
127128
(defn icon [^String icon-name]
128129
(FontIcon. icon-name))
129130

131+
(defn- tool-tip [text]
132+
(doto (Tooltip. text)
133+
(.setShowDelay (Duration. 400))))
134+
130135
(defn button [& {:keys [label classes on-click disable tooltip]}]
131136
(let [b (Button. label)]
132137

@@ -140,15 +145,15 @@
140145
(when disable
141146
(.setDisable b true))
142147

143-
(when tooltip (.setTooltip b (Tooltip. tooltip)))
148+
(when tooltip (.setTooltip b (tool-tip tooltip)))
144149

145150
b))
146151

147152
(defn icon-button [& {:keys [icon-name classes on-click disable tooltip]}]
148153
(let [b (doto (Button.)
149154
(.setGraphic (FontIcon. icon-name)))]
150155

151-
(when tooltip (.setTooltip b (Tooltip. tooltip)))
156+
(when tooltip (.setTooltip b (tool-tip tooltip)))
152157
(when on-click
153158
(.setOnAction b (event-handler [_] (on-click))))
154159

@@ -291,7 +296,7 @@
291296
(when on-selection-changed
292297
(.setOnSelectionChanged t on-selection-changed))
293298

294-
(when tooltip (.setTooltip t (Tooltip. tooltip)))
299+
(when tooltip (.setTooltip t (tool-tip tooltip)))
295300

296301
t))
297302

0 commit comments

Comments
 (0)