From 7a696929995aaa854f370378b255ad8c4181ebd8 Mon Sep 17 00:00:00 2001 From: Martin Beyer Date: Wed, 17 Jun 2020 11:04:36 +0200 Subject: [PATCH] Prettied up the statistics window for both Ui Themes --- .../VaultStatisticsController.java | 9 ++-- main/ui/src/main/resources/css/dark_theme.css | 44 +++++++++++-------- .../ui/src/main/resources/css/light_theme.css | 44 +++++++++++-------- .../main/resources/fxml/vault_statistics.fxml | 27 +++++------- .../main/resources/i18n/strings.properties | 2 + 5 files changed, 70 insertions(+), 56 deletions(-) diff --git a/main/ui/src/main/java/org/cryptomator/ui/vaultstatistics/VaultStatisticsController.java b/main/ui/src/main/java/org/cryptomator/ui/vaultstatistics/VaultStatisticsController.java index d76156b42..46ee16fb1 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/vaultstatistics/VaultStatisticsController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/vaultstatistics/VaultStatisticsController.java @@ -18,6 +18,7 @@ import org.cryptomator.ui.common.FxController; import org.cryptomator.ui.common.WeakBindings; import javax.inject.Inject; +import java.util.ResourceBundle; @VaultStatisticsScoped public class VaultStatisticsController implements FxController { @@ -35,17 +36,15 @@ public class VaultStatisticsController implements FxController { public LineChart lineGraph; @Inject - public VaultStatisticsController(@VaultStatisticsWindow Stage window, @VaultStatisticsWindow Vault vault) { + public VaultStatisticsController(@VaultStatisticsWindow Stage window, @VaultStatisticsWindow Vault vault, ResourceBundle resourceBundle) { this.stats = vault.getStats(); this.bpsRead = WeakBindings.bindLong(stats.bytesPerSecondReadProperty()); this.bpsWritten = WeakBindings.bindLong(stats.bytesPerSecondWrittenProperty()); this.readData = new Series<>(); - readData.setName("Read Data"); // For Legend - //TODO Add Name to strings.properties + readData.setName(resourceBundle.getString("vaultstatistics.readDataLabel")); this.writeData = new Series<>(); - writeData.setName("Write Data"); - //TODO Add Name to strings.properties + writeData.setName(resourceBundle.getString("vaultstatistics.writtenDataLabel")); this.ioAnimation = new Timeline(); //TODO Research better timer ioAnimation.getKeyFrames().add(new KeyFrame(Duration.seconds(IO_SAMPLING_INTERVAL), new IoSamplingAnimationHandler(readData, writeData))); diff --git a/main/ui/src/main/resources/css/dark_theme.css b/main/ui/src/main/resources/css/dark_theme.css index 52cf13aaa..71195116d 100644 --- a/main/ui/src/main/resources/css/dark_theme.css +++ b/main/ui/src/main/resources/css/dark_theme.css @@ -882,43 +882,51 @@ -fx-background-color: MAIN_BG; -fx-padding: 20px; } -/* -.default-color0.chart-line-symbol { -fx-background-color: #00FFFF; } -.default-color1.chart-line-symbol { -fx-background-color: #00FF00; } -*/ + /* content */ .chart-content { -fx-padding: 10px; + -fx-text-fill: TEXT_FILL; + -fx-tick-label-fill: GRAY_3; + -fx-minor-tick-visible: false } .chart-horizontal-grid-lines { - -fx-stroke: #FFFFFF; + -fx-stroke: PRIMARY_L2; } .chart-vertical-zero-line, .chart-horizontal-zero-line { - -fx-stroke: #FFFFFF; + -fx-stroke: PRIMARY_L2; } .chart-series-line { -fx-stroke-width: 2px; } .chart-alternative-row-fill { - -fx-fill: #E1E1E1; + -fx-fill: GRAY_3; -fx-stroke: transparent; -fx-stroke-width: 0; } +.axis { + -fx-tick-label-fill: TEXT_FILL; + -fx-tick-length: 20; + -fx-minor-tick-length: 10; +} +.axis-label { + -fx-text-fill: TEXT_FILL; +} +.default-color0.chart-series-line { -fx-stroke: PRIMARY; } +.default-color1.chart-series-line { -fx-stroke: RED_5 ; } -.default-color0.chart-series-line { -fx-stroke: #FF0000; } -.default-color1.chart-series-line { -fx-stroke: #00FF00 ; } +/* legend */ .chart-legend { - -fx-background-color: transparent; - -fx-padding: 20px; + -fx-text-fill: TEXT_FILL; + -fx-background-color: transparent; + -fx-padding: 0.4em; } - -.chart-legend-item-symbol{ - -fx-background-radius: 10; -} - -.chart-legend-item{ - -fx-text-fill: #FFFFFF; +.chart-line-symbol { + -fx-background-radius: 5px; + -fx-padding: 5px; } +.default-color0.chart-line-symbol { -fx-background-color: PRIMARY; } +.default-color1.chart-line-symbol { -fx-background-color: RED_5; } diff --git a/main/ui/src/main/resources/css/light_theme.css b/main/ui/src/main/resources/css/light_theme.css index 3ba377a95..855e48ec0 100644 --- a/main/ui/src/main/resources/css/light_theme.css +++ b/main/ui/src/main/resources/css/light_theme.css @@ -881,43 +881,51 @@ -fx-background-color: MAIN_BG; -fx-padding: 20px; } -/* -.default-color0.chart-line-symbol { -fx-background-color: #00FFFF; } -.default-color1.chart-line-symbol { -fx-background-color: #00FF00; } -*/ + /* content */ .chart-content { -fx-padding: 10px; + -fx-text-fill: TEXT_FILL; + -fx-tick-label-fill: GRAY_3; + -fx-minor-tick-visible: false } .chart-horizontal-grid-lines { - -fx-stroke: #000000; + -fx-stroke: PRIMARY_D2; } .chart-vertical-zero-line, .chart-horizontal-zero-line { - -fx-stroke: #000000; + -fx-stroke: PRIMARY_D2; } .chart-series-line { -fx-stroke-width: 2px; } .chart-alternative-row-fill { - -fx-fill: #E1E1E1; + -fx-fill: GRAY_8; -fx-stroke: transparent; -fx-stroke-width: 0; } +.axis { + -fx-tick-label-fill: TEXT_FILL; + -fx-tick-length: 20; + -fx-minor-tick-length: 10; +} +.axis-label { + -fx-text-fill: TEXT_FILL; +} +.default-color0.chart-series-line { -fx-stroke: PRIMARY; } +.default-color1.chart-series-line { -fx-stroke: RED_5 ; } -.default-color0.chart-series-line { -fx-stroke: #FF0000; } -.default-color1.chart-series-line { -fx-stroke: #00FF00 ; } +/* legend */ .chart-legend { - -fx-background-color: transparent; - -fx-padding: 20px; + -fx-text-fill: TEXT_FILL; + -fx-background-color: transparent; + -fx-padding: 0.4em; } - -.chart-legend-item-symbol{ - -fx-background-radius: 10; -} - -.chart-legend-item{ - -fx-text-fill: #000000; +.chart-line-symbol { + -fx-background-radius: 5px; + -fx-padding: 5px; } +.default-color0.chart-line-symbol { -fx-background-color: PRIMARY; } +.default-color1.chart-line-symbol { -fx-background-color: RED_5; } diff --git a/main/ui/src/main/resources/fxml/vault_statistics.fxml b/main/ui/src/main/resources/fxml/vault_statistics.fxml index 207950297..5de2d45e6 100644 --- a/main/ui/src/main/resources/fxml/vault_statistics.fxml +++ b/main/ui/src/main/resources/fxml/vault_statistics.fxml @@ -12,21 +12,8 @@ fx:controller="org.cryptomator.ui.vaultstatistics.VaultStatisticsController" prefHeight="400.0" prefWidth="600.0"> - - - - - - - + @@ -37,4 +24,14 @@ + + + + diff --git a/main/ui/src/main/resources/i18n/strings.properties b/main/ui/src/main/resources/i18n/strings.properties index 9c26942c6..0f1cee1cf 100644 --- a/main/ui/src/main/resources/i18n/strings.properties +++ b/main/ui/src/main/resources/i18n/strings.properties @@ -165,6 +165,8 @@ vaultstatistics.title=Statistics for %s vaultstatistics.xAxisTimeLabel=Seconds vaultstatistics.yAxisThroughputLabel=Throughput in KiB/s vaultstatistics.throughputTitle=Read and Writes +vaultstatistics.readDataLabel=Read Data +vaultstatistics.writtenDataLabel=Written Data # Main Window main.closeBtn.tooltip=Close