Skip to content

Commit fa3fa36

Browse files
authored
Merge pull request #3369 from UrbanBobek/runtime-zoom
Implement user defined runtime zoom factor
2 parents ee5b1d5 + 603c657 commit fa3fa36

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/Preferences.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public class Preferences
3333
@Preference public static String probe_display;
3434
/** Preference setting */
3535
public static final List<TextPatch> pv_name_patches = new ArrayList<>();
36+
/** Preference setting */
37+
@Preference public static int default_zoom_factor;
3638

3739
static
3840
{

app/display/runtime/src/main/java/org/csstudio/display/builder/runtime/app/ZoomAction.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
package org.csstudio.display.builder.runtime.app;
99

1010
import org.csstudio.display.builder.representation.javafx.JFXRepresentation;
11+
import org.csstudio.display.builder.runtime.Preferences;
1112

1213
import javafx.application.Platform;
1314
import javafx.scene.control.ComboBox;
@@ -33,6 +34,15 @@ public ZoomAction(final DisplayRuntimeInstance instance)
3334
getEditor().setText(txt);
3435
});
3536
setOnAction(event -> zoom(instance.getRepresentation()));
37+
38+
// Apply default zoom factor from settings.ini
39+
Platform.runLater(() ->
40+
{
41+
String zoom = String.format("%d %%", Preferences.default_zoom_factor);
42+
setValue(zoom);
43+
// Invoke zoom changed handler
44+
getOnAction().handle(null);
45+
});
3646
}
3747

3848
private void zoom(final JFXRepresentation representation)

app/display/runtime/src/main/resources/display_runtime_preferences.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,6 @@ update_throttle=250
4646
# When left empty, the "Probe Display"
4747
# context menu entry is disabled.
4848
probe_display=examples:/probe.bob
49+
50+
# Default zoom factor (percentage) of display runtime window
51+
default_zoom_factor=100

0 commit comments

Comments
 (0)