Skip to content

Commit 9575479

Browse files
authored
Merge branch 'master' into markdown-properties-docs
2 parents a580a43 + 80c61ac commit 9575479

File tree

4 files changed

+85
-1
lines changed

4 files changed

+85
-1
lines changed

app/databrowser/src/main/java/org/csstudio/apputil/formula/ui/FormulaPane.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import java.util.ArrayList;
1111
import java.util.List;
1212

13+
import javafx.scene.layout.ColumnConstraints;
14+
import javafx.scene.layout.Priority;
1315
import org.csstudio.apputil.formula.Formula;
1416
import org.csstudio.apputil.formula.VariableNode;
1517
import org.csstudio.trends.databrowser3.Messages;
@@ -85,7 +87,13 @@ public FormulaPane(final String initial_formula, final List<InputItem> inputs)
8587
setHgap(5);
8688
setVgap(5);
8789

88-
90+
ColumnConstraints column1 = new ColumnConstraints();
91+
column1.setHgrow(Priority.ALWAYS);
92+
ColumnConstraints column2 = new ColumnConstraints();
93+
column2.setHgrow(Priority.NEVER);
94+
ColumnConstraints column3 = new ColumnConstraints();
95+
column3.setHgrow(Priority.NEVER);
96+
getColumnConstraints().addAll(column1, column2, column3); // each get 50% of width
8997
add(formula_txt, 0, 0, 3, 1);
9098

9199
final TableView<InputItem> input_pane = createInputs();

core/ui/src/main/java/org/phoebus/ui/Preferences.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
*******************************************************************************/
88
package org.phoebus.ui;
99

10+
import java.net.URI;
11+
import java.util.logging.Level;
12+
import java.util.logging.Logger;
13+
1014
import org.phoebus.framework.preferences.AnnotatedPreferences;
1115
import org.phoebus.framework.preferences.Preference;
1216

@@ -17,6 +21,8 @@
1721

1822
public class Preferences
1923
{
24+
public final static Logger logger = Logger.getLogger(Preferences.class.getPackageName());
25+
2026
/** splash */
2127
public static final String SPLASH = "splash";
2228
/** default_apps */
@@ -99,6 +105,8 @@ public class Preferences
99105
@Preference public static String window_title_format;
100106
/** default_window_title **/
101107
@Preference public static String default_window_title;
108+
/** Custom stylings file */
109+
@Preference public static String custom_css_styling;
102110

103111
static
104112
{
@@ -108,5 +116,19 @@ public class Preferences
108116
// (PVASettings cannot use Preferences.max_array_formatting
109117
// since the PVA library may be used standalone)
110118
System.setProperty("EPICS_PVA_MAX_ARRAY_FORMATTING", Integer.toString(max_array_formatting));
119+
120+
// Check once if the custom style sheet is accessible
121+
if (!custom_css_styling.isBlank())
122+
{
123+
try
124+
{
125+
new URI(custom_css_styling).toURL().openStream().close();
126+
}
127+
catch (Exception ex)
128+
{
129+
logger.log(Level.WARNING, custom_css_styling + " is inaccessible", ex);
130+
custom_css_styling = "";
131+
}
132+
}
111133
}
112134
}

core/ui/src/main/java/org/phoebus/ui/javafx/Styles.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
******************************************************************************/
88
package org.phoebus.ui.javafx;
99

10+
import org.phoebus.ui.Preferences;
11+
1012
import javafx.scene.Node;
1113
import javafx.scene.Scene;
1214

@@ -24,6 +26,10 @@ public static void setSceneStyle(final Scene scene)
2426
{
2527
final String css = Styles.class.getResource("csstudio.css").toExternalForm();
2628
set(scene, css);
29+
if (!Preferences.custom_css_styling.isEmpty())
30+
{
31+
set(scene, Preferences.custom_css_styling);
32+
}
2733
}
2834

2935
/** Apply style sheet to scene (but only once)

core/ui/src/main/resources/phoebus_ui_preferences.properties

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,3 +242,51 @@ alarm_area_panel_invalid_severity_background_color=255,0,255
242242

243243
alarm_area_panel_undefined_severity_text_color=192,192,192
244244
alarm_area_panel_undefined_severity_background_color=200,0,200,200
245+
246+
# When Picture- and/or Symbol widgets are present in an OPI,
247+
# zooming in under Windows using the D3D graphics library can
248+
# cause excessive VRAM usage. Setting a cache hint can work as
249+
# a workaround. Since it has been observed that the cache hints
250+
# also can cause graphical errors, the setting of a cache hint
251+
# is a configurable option, which must explicitly be set to
252+
# have effect.
253+
#
254+
# The setting defaults to the default caching behavior.
255+
#
256+
# Valid options are:
257+
# "" (the empty string) or "NONE" - The default caching behavior: caching is DISABLED, and the cache hint is set to "CacheHint.DEFAULT".
258+
# "DEFAULT" - Caching is ENABLED, and the cache hint is set to "CacheHint.DEFAULT".
259+
# "SPEED" - Based on very limited testing, this option seems to work the best as a workaround for the excessive VRAM usage.
260+
# "QUALITY"
261+
# "SCALE" - This option has been observed to cause graphical errors on several systems: rotated widgets have been observed to be translated instead of rotated.
262+
# "ROTATE"
263+
# "SCALE_AND_ROTATE"
264+
#
265+
# If an invalid option is entered, a warning is logged, and the
266+
# default caching behavior is used (i.e., caching is DISABLED,
267+
# and the cache hint is set to "CacheHint.DEFAULT").
268+
cache_hint_for_picture_and_symbol_widgets=
269+
270+
271+
# Whether or not to save user credentials to file or memory so they only have to be entered once. Note that this
272+
# applies to all scopes/applications prompting for credentials.
273+
# See also setting org.phoebus.security/secure_store_target
274+
save_credentials=false
275+
276+
# Location of the Phoebus documentation
277+
documentation_location=
278+
279+
# How to format the window title.
280+
# The string is formatted with the current active tab as argument.
281+
# The default is "CS-Studio: %s", where %s is replaced by the name of the active tab.
282+
# Setting it to just "%s" will show only the active tab.
283+
# Omitting the %s will always show a static title.
284+
# When there is no active tab, the default_window_title is used instead.
285+
window_title_format=CS-Studio: %s
286+
default_window_title=CS-Studio
287+
288+
# Custom stylings .css file allows users to override Phoebus and JavaFX
289+
# default stylings.Set the full path to the .css file
290+
# For a system file use syntax; 'file:</path/to/custom.css>'
291+
# For a file served over http use syntax: 'http://<address:port/custom.css>'
292+
custom_css_styling=

0 commit comments

Comments
 (0)