Skip to content

Commit e3f343a

Browse files
committed
Style ComboBox elements.
1 parent bfd4d90 commit e3f343a

File tree

4 files changed

+32
-10
lines changed

4 files changed

+32
-10
lines changed

src/main/java/com/sankdev/App.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public class App extends Application {
4040
public static final String PRIMARY_VIEW = "primary";
4141
public static final String EDIT_ITEM_VIEW = "editItem";
4242
public static final int PRIMARY_WIDTH = 550;
43-
public static final int PRIMARY_HEIGHT = 350;
43+
public static final int PRIMARY_HEIGHT = 450;
4444

4545
private static final ResourceBundle theGuiResourceBundle = ResourceBundle.getBundle(
4646
"com.sankdev.multilang.GuiResourceBundle", Locale.getDefault());

src/main/resources/com/sankdev/css/base.css

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ Naming notes:
44
"-light-color" means the light color theme.*/
55
.root {
66
base-dark-color: #3c3f41;
7+
base-darker-color: #303334;
78
border-light-color: #c7c7c7;
89
button-dark-color: #494949;
910
button-hover-dark-color: #7c7c7c;
1011
table-row-dark-color: #494949;
1112
table-row-light-color: #505050;
1213
table-row-selected-color: #3c3f41;
1314
scrollbar-dark-color: #7c7c7c;
14-
text-filed-background-color: #656565;
15+
text-field-background-color: #656565;
1516
text-fill-light-color: #d3d3d3;
1617
text-fill-highlighted-color: #ffffff;
1718
-fx-font-size: 11px;
@@ -64,10 +65,8 @@ Naming notes:
6465
/* 2. Headers */
6566
/* The table header column background spanning the whole table width. */
6667
.table-view .column-header-background{
67-
-fx-background-color: base-dark-color;
68+
-fx-background-color: base-darker-color;
6869
-fx-background-radius: 3px 3px 0px 0px;
69-
-fx-background-insets: 0 3 0 3;
70-
-fx-padding: 3px 0 3px 0;
7170
}
7271

7372
/* Individual column headers on top of the table header column background. */
@@ -159,7 +158,7 @@ Naming notes:
159158
}
160159

161160
.text-field {
162-
-fx-background-color: text-filed-background-color;
161+
-fx-background-color: text-field-background-color;
163162
-fx-text-fill: text-fill-light-color;
164163
}
165164

@@ -168,4 +167,22 @@ Naming notes:
168167
-fx-font-weight: bold;
169168
}
170169

170+
.combo-box .list-cell {
171+
-fx-background-color: text-field-background-color;
172+
-fx-text-fill: text-fill-light-color;
173+
}
174+
175+
.combo-box .list-view .list-cell {
176+
-fx-background-color: text-field-background-color;
177+
-fx-text-fill: text-fill-light-color;
178+
}
179+
180+
.combo-box-base .arrow-button {
181+
-fx-background-color: text-field-background-color;
182+
}
183+
184+
.combo-box-base .arrow {
185+
-fx-background-color: base-darker-color;
186+
}
187+
171188

src/main/resources/com/sankdev/editItem.fxml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,11 @@
1515
<Label styleClass="form-header" text="%editItemText"/>
1616
<VBox>
1717
<Label text="%itemTypeLabel" />
18-
<ComboBox fx:id="itemType">
18+
<ComboBox fx:id="itemType" prefWidth="200">
1919
</ComboBox>
20+
<padding>
21+
<Insets top="20.0" bottom="30.0"/>
22+
</padding>
2023
</VBox>
2124
<HBox styleClass="h-box">
2225
<VBox styleClass="v-box">
@@ -39,7 +42,7 @@
3942
<!-- Diploma -->
4043
<VBox>
4144
<Label text="%itemDegreeLevelLabel" />
42-
<ComboBox fx:id="itemDegreeLevel">
45+
<ComboBox fx:id="itemDegreeLevel" prefWidth="200">
4346
</ComboBox>
4447
</VBox>
4548
<!-- Publication -->

src/main/resources/com/sankdev/primary.fxml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
<?import javafx.scene.layout.HBox?>
66
<?import javafx.scene.control.TableView?>
77
<?import javafx.scene.control.TableColumn?>
8+
<?import javafx.geometry.Insets?>
89
<BorderPane fx:id="primaryBorderPane" xmlns="http://javafx.com/javafx/16-ea+2" xmlns:fx="http://javafx.com/fxml/1"
910
styleClass="border-pane" fx:controller="com.sankdev.controller.PrimarySceneController"
1011
stylesheets="@css/base.css"
1112
>
1213
<top>
1314
<HBox styleClass="h-box" xmlns:fx="http://javafx.com/fxml">
14-
<children>
1515
<Button fx:id="addButton" text="%addButton" onAction="#onAdd">
1616
</Button>
1717
<Button fx:id="editButton" text="%editButton" onAction="#onEdit">
@@ -22,7 +22,9 @@
2222
</Button>
2323
<Button fx:id="loadButton" text="%loadButton" onAction="#readPortfolio">
2424
</Button>
25-
</children>
25+
<padding>
26+
<Insets bottom="20.0"/>
27+
</padding>
2628
</HBox>
2729
</top>
2830
<center>

0 commit comments

Comments
 (0)