Skip to content

Commit cdb3d70

Browse files
committed
Add a pref to make symbols with transparent regions clickable
1 parent 02bfc1e commit cdb3d70

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/JFXPreferences.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ public class JFXPreferences
2222
@Preference public static int tooltip_delay_ms;
2323
/** Tooltip duration */
2424
@Preference public static int tooltip_display_sec;
25+
/** make the transparent parts of symbols clickable */
26+
@Preference public static boolean pick_on_bounds;
2527

2628
static
2729
{

app/display/representation-javafx/src/main/java/org/csstudio/display/builder/representation/javafx/widgets/SymbolRepresentation.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import org.csstudio.display.builder.model.util.ModelThreadPool;
4242
import org.csstudio.display.builder.model.widgets.PVWidget;
4343
import org.csstudio.display.builder.model.widgets.SymbolWidget;
44+
import org.csstudio.display.builder.representation.javafx.JFXPreferences;
4445
import org.csstudio.display.builder.representation.javafx.JFXUtil;
4546
import org.csstudio.display.builder.representation.javafx.SVGHelper;
4647
import org.epics.util.array.ListNumber;
@@ -477,6 +478,7 @@ protected StackPane createJFXNode ( ) throws Exception {
477478
private void enableRunActionsOnMouseClick() {
478479
imageView.focusTraversableProperty().set(true);
479480
imageView.setStyle("-fx-cursor: hand;");
481+
imageView.setPickOnBounds(JFXPreferences.pick_on_bounds);
480482

481483
ColorAdjust[] clickEffect = { null }; // Values are wrapped in arrays as a workaround of the fact that Java doesn't allow non-final variables to be captured by closures.
482484
DropShadow[] focusEffect = { null };

app/display/representation-javafx/src/main/resources/jfx_repr_preferences.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ tooltip_display_sec=30
1717
# Note that for historic reasons tool tips are also influenced
1818
# by the property `org.csstudio.display.builder.disable_tooltips`.
1919
# When `true`, tool tips are disabled.
20+
21+
# Determines whether the mouse can interact with the bounds
22+
# of the symbol widget. If false, interaction is
23+
# limited to the visible area of the element.
24+
pick_on_bounds=false

0 commit comments

Comments
 (0)