mirror of
https://github.com/JFormDesigner/FlatLaf.git
synced 2026-02-10 22:17:13 -06:00
Theme Editor:
- support multi-line styles in overlay color preview - minor preview improvements
This commit is contained in:
@@ -686,12 +686,14 @@ class FlatThemePreviewAll
|
|||||||
//---- scrollBar1 ----
|
//---- scrollBar1 ----
|
||||||
scrollBar1.setOrientation(Adjustable.HORIZONTAL);
|
scrollBar1.setOrientation(Adjustable.HORIZONTAL);
|
||||||
scrollBar1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-scrollbar");
|
scrollBar1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-scrollbar");
|
||||||
|
scrollBar1.setVisibleAmount(50);
|
||||||
add(scrollBar1, "cell 1 12 2 1");
|
add(scrollBar1, "cell 1 12 2 1");
|
||||||
|
|
||||||
//---- scrollBar5 ----
|
//---- scrollBar5 ----
|
||||||
scrollBar5.setOrientation(Adjustable.HORIZONTAL);
|
scrollBar5.setOrientation(Adjustable.HORIZONTAL);
|
||||||
scrollBar5.setShowButtons(true);
|
scrollBar5.setShowButtons(true);
|
||||||
scrollBar5.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-scrollbar");
|
scrollBar5.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-scrollbar");
|
||||||
|
scrollBar5.setVisibleAmount(50);
|
||||||
add(scrollBar5, "cell 1 13 2 1");
|
add(scrollBar5, "cell 1 13 2 1");
|
||||||
|
|
||||||
//---- separatorLabel ----
|
//---- separatorLabel ----
|
||||||
@@ -707,7 +709,6 @@ class FlatThemePreviewAll
|
|||||||
add(sliderLabel, "cell 0 15");
|
add(sliderLabel, "cell 0 15");
|
||||||
|
|
||||||
//---- slider1 ----
|
//---- slider1 ----
|
||||||
slider1.setValue(30);
|
|
||||||
slider1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-slider");
|
slider1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-slider");
|
||||||
add(slider1, "cell 1 15 2 1,width 100");
|
add(slider1, "cell 1 15 2 1,width 100");
|
||||||
|
|
||||||
@@ -716,7 +717,6 @@ class FlatThemePreviewAll
|
|||||||
slider3.setPaintTicks(true);
|
slider3.setPaintTicks(true);
|
||||||
slider3.setMajorTickSpacing(50);
|
slider3.setMajorTickSpacing(50);
|
||||||
slider3.setPaintLabels(true);
|
slider3.setPaintLabels(true);
|
||||||
slider3.setValue(30);
|
|
||||||
slider3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-slider");
|
slider3.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-slider");
|
||||||
slider3.addChangeListener(e -> changeProgress());
|
slider3.addChangeListener(e -> changeProgress());
|
||||||
add(slider3, "cell 1 16 2 1,width 100");
|
add(slider3, "cell 1 16 2 1,width 100");
|
||||||
@@ -726,7 +726,7 @@ class FlatThemePreviewAll
|
|||||||
add(progressBarLabel, "cell 0 17");
|
add(progressBarLabel, "cell 0 17");
|
||||||
|
|
||||||
//---- progressBar1 ----
|
//---- progressBar1 ----
|
||||||
progressBar1.setValue(60);
|
progressBar1.setValue(50);
|
||||||
progressBar1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-progressbar");
|
progressBar1.putClientProperty("FlatLaf.styleClass", "flatlaf-preview-progressbar");
|
||||||
add(progressBar1, "cell 1 17 2 1");
|
add(progressBar1, "cell 1 17 2 1");
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
JFDML JFormDesigner: "999.9.9.9.9999" Java: "1.8.0_202" encoding: "UTF-8"
|
JFDML JFormDesigner: "7.0.5.0.404" Java: "17" encoding: "UTF-8"
|
||||||
|
|
||||||
new FormModel {
|
new FormModel {
|
||||||
contentType: "form/swing"
|
contentType: "form/swing"
|
||||||
@@ -444,6 +444,7 @@ new FormModel {
|
|||||||
name: "scrollBar1"
|
name: "scrollBar1"
|
||||||
"orientation": 0
|
"orientation": 0
|
||||||
"$client.FlatLaf.styleClass": "flatlaf-preview-scrollbar"
|
"$client.FlatLaf.styleClass": "flatlaf-preview-scrollbar"
|
||||||
|
"visibleAmount": 50
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 12 2 1"
|
"value": "cell 1 12 2 1"
|
||||||
} )
|
} )
|
||||||
@@ -452,6 +453,7 @@ new FormModel {
|
|||||||
"orientation": 0
|
"orientation": 0
|
||||||
"showButtons": true
|
"showButtons": true
|
||||||
"$client.FlatLaf.styleClass": "flatlaf-preview-scrollbar"
|
"$client.FlatLaf.styleClass": "flatlaf-preview-scrollbar"
|
||||||
|
"visibleAmount": 50
|
||||||
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
}, new FormLayoutConstraints( class net.miginfocom.layout.CC ) {
|
||||||
"value": "cell 1 13 2 1"
|
"value": "cell 1 13 2 1"
|
||||||
} )
|
} )
|
||||||
@@ -475,7 +477,6 @@ new FormModel {
|
|||||||
} )
|
} )
|
||||||
add( new FormComponent( "javax.swing.JSlider" ) {
|
add( new FormComponent( "javax.swing.JSlider" ) {
|
||||||
name: "slider1"
|
name: "slider1"
|
||||||
"value": 30
|
|
||||||
"$client.FlatLaf.styleClass": "flatlaf-preview-slider"
|
"$client.FlatLaf.styleClass": "flatlaf-preview-slider"
|
||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
@@ -489,7 +490,6 @@ new FormModel {
|
|||||||
"paintTicks": true
|
"paintTicks": true
|
||||||
"majorTickSpacing": 50
|
"majorTickSpacing": 50
|
||||||
"paintLabels": true
|
"paintLabels": true
|
||||||
"value": 30
|
|
||||||
"$client.FlatLaf.styleClass": "flatlaf-preview-slider"
|
"$client.FlatLaf.styleClass": "flatlaf-preview-slider"
|
||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
@@ -506,7 +506,7 @@ new FormModel {
|
|||||||
} )
|
} )
|
||||||
add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatProgressBar" ) {
|
add( new FormComponent( "com.formdev.flatlaf.extras.components.FlatProgressBar" ) {
|
||||||
name: "progressBar1"
|
name: "progressBar1"
|
||||||
"value": 60
|
"value": 50
|
||||||
"$client.FlatLaf.styleClass": "flatlaf-preview-progressbar"
|
"$client.FlatLaf.styleClass": "flatlaf-preview-progressbar"
|
||||||
auxiliary() {
|
auxiliary() {
|
||||||
"JavaCodeGenerator.variableLocal": false
|
"JavaCodeGenerator.variableLocal": false
|
||||||
|
|||||||
@@ -117,6 +117,21 @@ class FlatThemePropertiesSupport
|
|||||||
int endOffset = textArea.getLineEndOffset( line );
|
int endOffset = textArea.getLineEndOffset( line );
|
||||||
String text = textArea.getText( startOffset, endOffset - startOffset );
|
String text = textArea.getText( startOffset, endOffset - startOffset );
|
||||||
|
|
||||||
|
// remove trailing backslash from multi-line properties usually used for styles
|
||||||
|
if( text.endsWith( "\\\n" ) )
|
||||||
|
text = text.substring( 0, text.length() - 2 ).trim();
|
||||||
|
// remove trailing semicolon from styles
|
||||||
|
if( text.endsWith( ";" ) )
|
||||||
|
text = text.substring( 0, text.length() - 1 ).trim();
|
||||||
|
|
||||||
|
// remove key starting with "[style]" so that first property name
|
||||||
|
// in CSS styled value is used as key to detect value type
|
||||||
|
if( text.startsWith( "[style]" ) ) {
|
||||||
|
int sepIndex = text.indexOf( '=' );
|
||||||
|
if( sepIndex >= 0 )
|
||||||
|
text = text.substring( sepIndex + 1 );
|
||||||
|
}
|
||||||
|
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
properties.load( new StringReader( text ) );
|
properties.load( new StringReader( text ) );
|
||||||
if( properties.isEmpty() )
|
if( properties.isEmpty() )
|
||||||
|
|||||||
@@ -122,3 +122,9 @@ Prop.7.selectionForeground = contrast($Prop.7.selectionBackground,#000,#fff)
|
|||||||
|
|
||||||
@varStyle1 = #f0f
|
@varStyle1 = #f0f
|
||||||
[style].style1 = background: @varStyle1
|
[style].style1 = background: @varStyle1
|
||||||
|
|
||||||
|
[style].style2 = background: darken(#f00,10%); \
|
||||||
|
foreground: #0f0; \
|
||||||
|
foreground: darken(@background,30%); \
|
||||||
|
toolbar.hoverBackground: fade(Actions.GreyInline,30%,lazy); \
|
||||||
|
toolbar.selectedBackground: fade(Actions.GreyInline,50%,lazy)
|
||||||
|
|||||||
Reference in New Issue
Block a user