Skip to content

Commit 69c1410

Browse files
committed
updated UI of the material editor.
1 parent bd1cdbb commit 69c1410

18 files changed

Lines changed: 72 additions & 178 deletions

resources/ui/css/base.bss

16 Bytes
Binary file not shown.

resources/ui/css/base.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,8 @@
479479
-fx-padding: 0px 0px 0px 0px;
480480
-fx-label-padding: 0.0em 0.0em 0.0em 0.416667em;
481481
-fx-text-fill: -var-font-color;
482+
-fx-min-height: -var-default-field-height;
483+
-fx-min-width: -var-default-field-height;
482484
}
483485

484486
.check-box:focused {
-469 Bytes
Binary file not shown.

resources/ui/css/custom_classes.css

Lines changed: 23 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,18 @@
247247
-fx-padding: 0px;
248248
}
249249

250+
/*******************************************************************************
251+
* *
252+
* Transparent Combo Box *
253+
* *
254+
******************************************************************************/
255+
256+
.transparent-combo-box,
257+
.transparent-combo-box:editable,
258+
.transparent-combo-box:editable > .arrow-button {
259+
-fx-background-color: -fx-body-color;
260+
}
261+
250262
/*******************************************************************************
251263
* *
252264
* Transparent Spinner *
@@ -427,9 +439,6 @@
427439
}
428440

429441
.material-file-editor-param-control-name {
430-
-fx-min-height: 24px;
431-
-fx-pref-height: -fx-min-height;
432-
-fx-max-height: -fx-min-height;
433442
-fx-alignment: center-right;
434443
-fx-text-alignment: right;
435444
-fx-padding: 0px 2px 0px 0px;
@@ -457,9 +466,17 @@
457466
}
458467

459468
.material-file-editor-param-control-color-picker {
460-
-fx-min-height: 24;
461-
-fx-pref-height: -fx-min-height;
462-
-fx-max-height: -fx-min-height;
469+
}
470+
471+
472+
.material-file-editor-param-control-checkbox {
473+
-fx-alignment: center;
474+
}
475+
476+
.material-file-editor-param-control-spinner {
477+
}
478+
479+
.material-file-editor-param-control-combo-box {
463480
}
464481

465482
/*******************************************************************************
@@ -595,52 +612,6 @@
595612
-fx-max-width: -fx-min-width;
596613
}
597614

598-
/** Drawer button */
599-
600-
.drawer-button {
601-
-fx-min-height: 40;
602-
-fx-effect: null;
603-
}
604-
605-
.drawer-button:hover {
606-
-fx-body-color: -fx-button-background-hover;
607-
}
608-
609-
.drawer-button:armed {
610-
-fx-body-color: -var-button-arm-color;
611-
}
612-
613-
.drawer-button:focused {
614-
}
615-
616-
.drawer-button:selected {
617-
-fx-body-color: -fx-color-panel-900;
618-
}
619-
620-
.editor-bar-button {
621-
-fx-min-height: 32;
622-
-fx-pref-height: -fx-min-height;
623-
-fx-max-height: -fx-min-height;
624-
-fx-min-width: 32;
625-
-fx-pref-width: -fx-min-width;
626-
-fx-max-width: -fx-min-width;
627-
-fx-background-radius: 32px;
628-
}
629-
630-
.editor-bar-button:hover {
631-
-fx-body-color: transparent;
632-
}
633-
634-
.editor-bar-button:armed {
635-
-fx-body-color: -var-button-arm-color;
636-
}
637-
638-
.transparent-combo-box,
639-
.transparent-combo-box:editable,
640-
.transparent-combo-box:editable > .arrow-button {
641-
-fx-background-color: -fx-body-color;
642-
}
643-
644615
.abstract-param-control {
645616
-fx-padding: 0 0 0 0;
646617
}

resources/ui/css/custom_ids.bss

-607 Bytes
Binary file not shown.

resources/ui/css/custom_ids.css

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -159,58 +159,6 @@
159159
-fx-max-width: -fx-min-width;
160160
}
161161

162-
/*******************************************************************************
163-
* *
164-
* Material Editor *
165-
* *
166-
******************************************************************************/
167-
168-
#MaterialParamControlSpinner {
169-
-fx-min-height: 24;
170-
-fx-pref-height: -fx-min-height;
171-
-fx-max-height: -fx-min-height;
172-
}
173-
174-
#MaterialParamComboBox {
175-
-fx-min-height: 24;
176-
-fx-pref-height: -fx-min-height;
177-
-fx-max-height: -fx-min-height;
178-
}
179-
180-
#MaterialParamControlCheckbox {
181-
-fx-alignment: center;
182-
-fx-min-height: 20;
183-
-fx-pref-height: -fx-min-height;
184-
-fx-max-height: -fx-min-height;
185-
-fx-min-width: 20;
186-
-fx-pref-width: -fx-min-width;
187-
-fx-max-width: -fx-min-width;
188-
}
189-
190-
#MaterialParamControlCheckbox > .box {
191-
-fx-min-height: 16;
192-
-fx-pref-height: -fx-min-height;
193-
-fx-max-height: -fx-min-height;
194-
-fx-min-width: 16;
195-
-fx-pref-width: -fx-min-width;
196-
-fx-max-width: -fx-min-width;
197-
}
198-
199-
#MaterialParamControlCheckbox > .box > .mark {
200-
-fx-min-height: 12;
201-
-fx-pref-height: -fx-min-height;
202-
-fx-max-height: -fx-min-height;
203-
-fx-min-width: 12;
204-
-fx-pref-width: -fx-min-width;
205-
-fx-max-width: -fx-min-width;
206-
}
207-
208-
#MaterialRenderStatePolyOffsetField {
209-
-fx-min-height: 22;
210-
-fx-pref-height: -fx-min-height;
211-
-fx-max-height: -fx-min-height;
212-
}
213-
214162
/*******************************************************************************
215163
* *
216164
* Settings Dialog *

src/com/ss/editor/ui/component/editor/impl/material/MaterialFileEditor.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,8 +623,6 @@ protected void createToolbar(@NotNull final HBox container) {
623623
FXUtils.addClassTo(materialDefinitionLabel, bucketLabel, CSSClasses.FILE_EDITOR_TOOLBAR_LABEL);
624624
FXUtils.addClassTo(materialDefinitionBox, bucketComboBox, CSSClasses.FILE_EDITOR_TOOLBAR_FIELD);
625625
FXUtils.addClassTo(cubeButton, sphereButton, planeButton, lightButton, CSSClasses.FILE_EDITOR_TOOLBAR_BUTTON);
626-
FXUtils.addClassTo(materialDefinitionLabel, materialDefinitionBox, bucketLabel, bucketComboBox,
627-
CSSClasses.SPECIAL_FONT_13);
628626

629627
HBox.setMargin(cubeButton, SMALL_OFFSET);
630628
HBox.setMargin(sphereButton, SMALL_OFFSET);

src/com/ss/editor/ui/component/editor/impl/material/MaterialRenderParamsComponent.java

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
import com.ss.editor.ui.component.editor.impl.material.operation.RenderStateOperation;
1313
import com.ss.editor.ui.control.material.MaterialParamControl;
1414
import com.ss.editor.ui.css.CSSClasses;
15-
import com.ss.editor.ui.css.CSSIds;
15+
import com.ss.rlib.ui.control.input.FloatTextField;
16+
import com.ss.rlib.ui.util.FXUtils;
1617
import javafx.collections.ObservableList;
1718
import javafx.scene.control.CheckBox;
1819
import javafx.scene.control.ComboBox;
@@ -22,8 +23,6 @@
2223
import javafx.scene.layout.VBox;
2324
import org.jetbrains.annotations.NotNull;
2425
import org.jetbrains.annotations.Nullable;
25-
import com.ss.rlib.ui.control.input.FloatTextField;
26-
import com.ss.rlib.ui.util.FXUtils;
2726

2827
import java.util.function.Consumer;
2928

@@ -34,7 +33,10 @@
3433
*/
3534
public class MaterialRenderParamsComponent extends VBox {
3635

36+
@NotNull
3737
private static final ObservableList<FaceCullMode> FACE_CULL_MODES = observableArrayList(FaceCullMode.values());
38+
39+
@NotNull
3840
private static final ObservableList<BlendMode> BLEND_MODES = observableArrayList(BlendMode.values());
3941

4042
/**
@@ -146,23 +148,20 @@ private void createControls() {
146148
faceCullModeLabel.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.LABEL_PERCENT_WIDTH2));
147149

148150
faceCullModeComboBox = new ComboBox<>(FACE_CULL_MODES);
149-
faceCullModeComboBox.setId(CSSIds.MATERIAL_PARAM_CONTROL_COMBO_BOX);
150151
faceCullModeComboBox.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> processChange(newValue));
151152
faceCullModeComboBox.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.CONTROL_PERCENT_WIDTH2));
152153

153154
final Label blendModeLabel = new Label(Messages.MATERIAL_RENDER_STATE_BLEND_MODE + ":");
154155
blendModeLabel.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.LABEL_PERCENT_WIDTH2));
155156

156157
blendModeComboBox = new ComboBox<>(BLEND_MODES);
157-
blendModeComboBox.setId(CSSIds.MATERIAL_PARAM_CONTROL_COMBO_BOX);
158158
blendModeComboBox.getSelectionModel().selectedItemProperty().addListener((observable, oldValue, newValue) -> processChange(newValue));
159159
blendModeComboBox.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.CONTROL_PERCENT_WIDTH2));
160160

161161
final Label polyOffsetFactorLabel = new Label(Messages.MATERIAL_RENDER_STATE_POLY_OFFSET_FACTOR + ":");
162162
polyOffsetFactorLabel.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.LABEL_PERCENT_WIDTH2));
163163

164164
polyOffsetFactorField = new FloatTextField();
165-
polyOffsetFactorField.setId(CSSIds.MATERIAL_RENDER_STATE_POLY_OFFSET_FIELD);
166165
polyOffsetFactorField.addChangeListener((observable, oldValue, newValue) -> processChangeFactor(newValue));
167166
polyOffsetFactorField.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.CONTROL_PERCENT_WIDTH2));
168167
polyOffsetFactorField.setScrollPower(5F);
@@ -171,7 +170,6 @@ private void createControls() {
171170
polyOffsetUnitsLabel.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.LABEL_PERCENT_WIDTH2));
172171

173172
polyOffsetUnitsField = new FloatTextField();
174-
polyOffsetUnitsField.setId(CSSIds.MATERIAL_RENDER_STATE_POLY_OFFSET_FIELD);
175173
polyOffsetUnitsField.addChangeListener((observable, oldValue, newValue) -> processChangeUnits(newValue));
176174
polyOffsetUnitsField.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.CONTROL_PERCENT_WIDTH2));
177175
polyOffsetUnitsField.setScrollPower(5F);
@@ -180,31 +178,27 @@ private void createControls() {
180178
depthWriteLabel.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.LABEL_PERCENT_WIDTH2));
181179

182180
depthWriteCheckBox = new CheckBox();
183-
depthWriteCheckBox.setId(CSSIds.MATERIAL_PARAM_CONTROL_CHECKBOX);
184181
depthWriteCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> pointChangeDepthWrite(newValue));
185182
depthWriteCheckBox.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.CONTROL_PERCENT_WIDTH2));
186183

187184
final Label colorWriteLabel = new Label(Messages.MATERIAL_RENDER_STATE_COLOR_WRITE + ":");
188185
colorWriteLabel.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.LABEL_PERCENT_WIDTH2));
189186

190187
colorWriteCheckBox = new CheckBox();
191-
colorWriteCheckBox.setId(CSSIds.MATERIAL_PARAM_CONTROL_CHECKBOX);
192188
colorWriteCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> processChangeColorWrite(newValue));
193189
colorWriteCheckBox.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.CONTROL_PERCENT_WIDTH2));
194190

195191
final Label depthTestLabel = new Label(Messages.MATERIAL_RENDER_STATE_DEPTH_TEST + ":");
196192
depthTestLabel.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.LABEL_PERCENT_WIDTH2));
197193

198194
depthTestCheckBox = new CheckBox();
199-
depthTestCheckBox.setId(CSSIds.MATERIAL_PARAM_CONTROL_CHECKBOX);
200195
depthTestCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> processChangeDepthTest(newValue));
201196
depthTestCheckBox.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.CONTROL_PERCENT_WIDTH2));
202197

203198
final Label wireframeLabel = new Label(Messages.MATERIAL_RENDER_STATE_WIREFRAME + ":");
204199
wireframeLabel.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.LABEL_PERCENT_WIDTH2));
205200

206201
wireframeCheckBox = new CheckBox();
207-
wireframeCheckBox.setId(CSSIds.MATERIAL_PARAM_CONTROL_CHECKBOX);
208202
wireframeCheckBox.selectedProperty().addListener((observable, oldValue, newValue) -> processChangeWireframe(newValue));
209203
wireframeCheckBox.prefWidthProperty().bind(widthProperty().multiply(MaterialParamControl.CONTROL_PERCENT_WIDTH2));
210204

@@ -242,13 +236,19 @@ private void createControls() {
242236
FXUtils.addToPane(wireframeContainer, container);
243237
FXUtils.addToPane(container, this);
244238

239+
FXUtils.addClassesTo(faceCullModeContainer, blendModeContainer, polyOffsetFactorContainer,
240+
polyOffsetUnitsContainer, depthWriteContainer, colorWriteContainer, depthTestContainer,
241+
wireframeContainer, CSSClasses.MATERIAL_FILE_EDITOR_PARAM_CONTROL);
242+
245243
FXUtils.addClassesTo(faceCullModeLabel, blendModeLabel, polyOffsetFactorLabel, polyOffsetUnitsLabel,
246244
depthWriteLabel, colorWriteLabel, depthTestLabel, wireframeLabel,
247245
CSSClasses.MATERIAL_FILE_EDITOR_PARAM_CONTROL_NAME);
248246

249-
FXUtils.addClassesTo(faceCullModeLabel, faceCullModeComboBox, blendModeLabel, blendModeComboBox,
250-
polyOffsetFactorLabel, polyOffsetUnitsLabel, polyOffsetFactorField, polyOffsetUnitsField,
251-
depthWriteLabel, colorWriteLabel, depthTestLabel, wireframeLabel, CSSClasses.SPECIAL_FONT_13);
247+
FXUtils.addClassesTo(faceCullModeComboBox, colorWriteCheckBox, polyOffsetFactorField, polyOffsetUnitsField,
248+
CSSClasses.MATERIAL_FILE_EDITOR_PARAM_CONTROL_COMBO_BOX);
249+
250+
FXUtils.addClassesTo(depthWriteCheckBox, colorWriteCheckBox, depthTestCheckBox, wireframeCheckBox,
251+
CSSClasses.MATERIAL_FILE_EDITOR_PARAM_CONTROL_NAME);
252252
}
253253

254254
/**

src/com/ss/editor/ui/component/tab/ScrollableEditorToolComponent.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
package com.ss.editor.ui.component.tab;
22

3-
import com.ss.editor.ui.css.CSSClasses;
4-
5-
import org.jetbrains.annotations.NotNull;
6-
3+
import com.ss.rlib.ui.util.FXUtils;
74
import javafx.scene.control.ScrollPane;
85
import javafx.scene.control.SplitPane;
96
import javafx.scene.control.Tab;
107
import javafx.scene.layout.Region;
118
import javafx.scene.layout.VBox;
12-
import com.ss.rlib.ui.util.FXUtils;
9+
import org.jetbrains.annotations.NotNull;
1310

1411
/**
1512
* The component to contain editor tool components.
@@ -40,7 +37,6 @@ public void addComponent(@NotNull final Region component, @NotNull final String
4037

4138
getTabs().add(tab);
4239

43-
FXUtils.addClassTo(tab, CSSClasses.SPECIAL_FONT_14);
4440
FXUtils.bindFixedHeight(scrollPane, heightProperty());
4541
}
4642
}

src/com/ss/editor/ui/component/tab/TabToolComponent.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.ss.editor.ui.component.tab;
22

33
import com.ss.editor.ui.component.ScreenComponent;
4-
import com.ss.editor.ui.css.CSSClasses;
4+
import com.ss.rlib.ui.util.FXUtils;
55
import javafx.beans.property.BooleanProperty;
66
import javafx.beans.property.SimpleBooleanProperty;
77
import javafx.beans.value.ChangeListener;
@@ -15,7 +15,6 @@
1515
import javafx.scene.text.Text;
1616
import org.jetbrains.annotations.NotNull;
1717
import org.jetbrains.annotations.Nullable;
18-
import com.ss.rlib.ui.util.FXUtils;
1918

2019
/**
2120
* The component to contain tool components.
@@ -127,7 +126,6 @@ public void addComponent(@NotNull final Region component, @NotNull final String
127126

128127
getTabs().add(tab);
129128

130-
FXUtils.addClassTo(tab, CSSClasses.SPECIAL_FONT_14);
131129
FXUtils.bindFixedHeight(component, heightProperty());
132130
}
133131

0 commit comments

Comments
 (0)