Skip to content

Commit

Permalink
Fixes #172: TreeTableView - Collapse/Expand arrow color is wrong on D…
Browse files Browse the repository at this point in the history
…ARK Style
  • Loading branch information
p-dukke committed Sep 29, 2020
1 parent ec875f2 commit f454bc4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

public class TreeTableViewSample extends Application {

private static final Style STYLE = Style.DARK;
private static final Style STARTING_STYLE = Style.DARK;

List<Employee> employees = Arrays.asList(
new Employee("Ethan Williams", "[email protected]", "25", "Manager", "San Francisco"),
Expand Down Expand Up @@ -47,8 +47,7 @@ public static void main(String[] args) {

@Override
public void start(Stage stage) {
Style startingStyle = Style.LIGHT;
JMetro jMetro = new JMetro(startingStyle);
JMetro jMetro = new JMetro(STARTING_STYLE);

System.setProperty("prism.lcdtext", "false");

Expand Down Expand Up @@ -111,15 +110,11 @@ public void start(Stage stage) {
controlsHBox.setSpacing(10);

CheckBox cellSelectionCheckBox = new CheckBox("Cell Selection");
cellSelectionCheckBox.setOnAction(event -> {
treeTableView.getSelectionModel().setCellSelectionEnabled(cellSelectionCheckBox.isSelected());
});
cellSelectionCheckBox.setOnAction(event -> treeTableView.getSelectionModel().setCellSelectionEnabled(cellSelectionCheckBox.isSelected()));
cellSelectionCheckBox.setSelected(treeTableView.getSelectionModel().isCellSelectionEnabled());

CheckBox tableButtonCheckBox = new CheckBox("Table Menu Button");
tableButtonCheckBox.setOnAction(event -> {
treeTableView.setTableMenuButtonVisible(tableButtonCheckBox.isSelected());
});
tableButtonCheckBox.setOnAction(event -> treeTableView.setTableMenuButtonVisible(tableButtonCheckBox.isSelected()));
tableButtonCheckBox.setSelected(treeTableView.isTableMenuButtonVisible());

CheckBox alternatingRowColors = new CheckBox("Alternating Row Colors");
Expand Down Expand Up @@ -147,7 +142,7 @@ public void start(Stage stage) {

ComboBox<Style> jmetroStyleComboBox = new ComboBox<>();
jmetroStyleComboBox.getItems().addAll(Style.DARK, Style.LIGHT);
jmetroStyleComboBox.setValue(startingStyle);
jmetroStyleComboBox.setValue(STARTING_STYLE);
jmetroStyleComboBox.valueProperty().addListener(observable -> jMetro.setStyle(jmetroStyleComboBox.getValue()));

controlsHBox.getChildren().addAll(jmetroStyleComboBox, cellSelectionCheckBox, tableButtonCheckBox, alternatingRowColors, columnGridLines);
Expand Down
4 changes: 4 additions & 0 deletions jmetro/src/main/resources/jfxtras/styles/jmetro/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1884,6 +1884,10 @@ TextField {
-fx-background-color: transparent;
}

.tree-table-view > .virtual-flow > .clipped-container > .sheet > .tree-table-row-cell > .tree-disclosure-node > .arrow {
-fx-background-color: collapse_expand_arrow_color;
}

.tree-table-cell {
-fx-padding: 0.5em 0 0.5em 0.333333em; /* 6 0 6 4 */
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,7 @@ Text {
table_text_color: #fff;
table_text_selected_color: #fff;

collapse_expand_arrow_color: table_text_color;
sort_arrow_color: table_text_color;

table_column_vline_color: #3e3e3e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ Text {
table_text_color: #111;
table_text_selected_color: #111;

collapse_expand_arrow_color: table_text_color;
sort_arrow_color: table_text_color;

table_column_vline_color: #e6e6e6;
Expand Down

0 comments on commit f454bc4

Please sign in to comment.