From 6bd6ba25900d44178003cba5c438cf192b190ec9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erik=20F=C3=B8lstad?= <erikmafo@gmail.com> Date: Sat, 7 Nov 2020 00:36:56 +0100 Subject: [PATCH] Improve styling --- .github/workflows/build.yaml | 11 ++++++++++- pom.xml | 2 +- .../btviewer/components/BigtableViewController.java | 5 ++++- src/main/resources/css/bigtable_view.css | 8 ++++++-- src/main/resources/css/cell_view.css | 6 +++--- src/main/resources/fxml/bigtable_menu_bar.fxml | 2 +- src/main/resources/fxml/cell_view.fxml | 2 +- src/main/resources/fxml/main.fxml | 6 +++++- 8 files changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 87f8312..1993284 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -1,4 +1,12 @@ -on: [push] +on: + pull_request: + branches: + - master + push: + branches: + - master + tags: + - v* jobs: build: @@ -38,6 +46,7 @@ jobs: - name: Show current dir run: ls target/release - name: Save artifact + if: startsWith(github.ref, 'refs/tags/v') uses: actions/upload-artifact@v2 with: name: ${{ matrix.installerName }} diff --git a/pom.xml b/pom.xml index 31a03fb..6782540 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ <groupId>com.erikmafo</groupId> <artifactId>bigtableviewer</artifactId> - <version>0.2.2</version> + <version>0.2.3</version> <packaging>jar</packaging> <name>bigtableviewer</name> diff --git a/src/main/java/com/erikmafo/btviewer/components/BigtableViewController.java b/src/main/java/com/erikmafo/btviewer/components/BigtableViewController.java index 5c32e91..a82354a 100644 --- a/src/main/java/com/erikmafo/btviewer/components/BigtableViewController.java +++ b/src/main/java/com/erikmafo/btviewer/components/BigtableViewController.java @@ -10,9 +10,9 @@ import javafx.beans.value.ObservableValue; import javafx.collections.ListChangeListener; import javafx.collections.ObservableList; +import javafx.css.PseudoClass; import javafx.event.ActionEvent; import javafx.fxml.FXML; -import javafx.geometry.Insets; import javafx.scene.control.*; import javafx.scene.input.*; import javafx.scene.layout.VBox; @@ -166,6 +166,9 @@ private String getCellValue(TreeTablePosition<BigtableRow, ?> position) { private TreeTableColumn<BigtableRow, String> createRowKeyColumn() { TreeTableColumn<BigtableRow, String> tableColumn = new TreeTableColumn<>(ROW_KEY); tableColumn.setCellValueFactory(param -> new ReadOnlyObjectWrapper<>(param.getValue().getValue().getRowKey())); + tableColumn.setCellValueFactory(features -> features.getValue().isLeaf() ? + new ReadOnlyStringWrapper("") : + new ReadOnlyObjectWrapper<>(features.getValue().getValue().getRowKey())); tableColumn.setCellFactory(new RowCellFactory()); return tableColumn; } diff --git a/src/main/resources/css/bigtable_view.css b/src/main/resources/css/bigtable_view.css index f8608fa..823ad8a 100644 --- a/src/main/resources/css/bigtable_view.css +++ b/src/main/resources/css/bigtable_view.css @@ -1,6 +1,4 @@ .tree-table-row-cell { - -fx-border-color: grey; - -fx-table-cell-border-color: grey; } .has-spacing { @@ -19,6 +17,12 @@ -fx-padding: 0.0em; } +.tree-table-row-cell:empty{ + -fx-background-color: #F8F9FB; + -fx-background-insets: 0, 0 0 1 0; + -fx-padding: 0.0em; +} + .tree-disclosure-node { -fx-padding: 10 5 0 5; } \ No newline at end of file diff --git a/src/main/resources/css/cell_view.css b/src/main/resources/css/cell_view.css index 79ce27b..c508287 100644 --- a/src/main/resources/css/cell_view.css +++ b/src/main/resources/css/cell_view.css @@ -1,7 +1,7 @@ .bigtable-cell-value { - -fx-padding: 5px; - -fx-border-insets: 5px; - -fx-background-insets: 5px; + -fx-padding: 2px; + -fx-border-insets: 0px; + -fx-background-insets: 0px; } .bigtable-cell-timestamp { diff --git a/src/main/resources/fxml/bigtable_menu_bar.fxml b/src/main/resources/fxml/bigtable_menu_bar.fxml index 9090863..fedfdc2 100644 --- a/src/main/resources/fxml/bigtable_menu_bar.fxml +++ b/src/main/resources/fxml/bigtable_menu_bar.fxml @@ -10,7 +10,7 @@ <menus> <Menu text="File"> <items> - <MenuItem fx:id="credentialsMenu" onAction="#onManageCredentialsAction" text="Credentials"/> + <MenuItem fx:id="credentialsMenu" onAction="#onManageCredentialsAction" text="Set credentials"/> </items> </Menu> diff --git a/src/main/resources/fxml/cell_view.fxml b/src/main/resources/fxml/cell_view.fxml index 5bc731b..1397fcc 100644 --- a/src/main/resources/fxml/cell_view.fxml +++ b/src/main/resources/fxml/cell_view.fxml @@ -16,7 +16,7 @@ <bottom> <Label fx:id="versionLabel" - BorderPane.alignment="BOTTOM_RIGHT" + BorderPane.alignment="BOTTOM_CENTER" styleClass="bigtable-cell-timestamp"/> </bottom> diff --git a/src/main/resources/fxml/main.fxml b/src/main/resources/fxml/main.fxml index c4779d2..ea33492 100644 --- a/src/main/resources/fxml/main.fxml +++ b/src/main/resources/fxml/main.fxml @@ -1,13 +1,17 @@ <?xml version="1.0" encoding="UTF-8"?> <?import javafx.scene.layout.BorderPane?> -<?import javafx.scene.layout.VBox?> +<?import javafx.geometry.Insets?> +<?import javafx.scene.layout.VBox?> <BorderPane xmlns:fx="http://javafx.com/fxml" fx:controller="com.erikmafo.btviewer.controllers.MainController" stylesheets="/css/main.css" styleClass="pane-view"> <top> <VBox> + <BorderPane.margin> + <Insets bottom="10"/> + </BorderPane.margin> <fx:include fx:id="menuBar" source="bigtable_menu_bar.fxml"/> </VBox> </top>