From ef07edf8c3ccd20f6b54c2b1dd5c18b1675b9d64 Mon Sep 17 00:00:00 2001 From: Tobias Hagemann Date: Tue, 27 Aug 2019 16:11:24 +0200 Subject: [PATCH] made button-group into an actual button --- .../cryptomator/common/vaults/VaultStats.java | 2 +- .../ui/controls/FontAwesome5Icon.java | 1 + .../ui/mainwindow/VaultDetailController.java | 3 +- main/ui/src/main/resources/css/dark_theme.css | 40 ++++++- .../ui/src/main/resources/css/light_theme.css | 40 ++++++- .../src/main/resources/fxml/vault_detail.fxml | 100 ++++++++++-------- .../main/resources/i18n/strings.properties | 7 +- 7 files changed, 134 insertions(+), 59 deletions(-) diff --git a/main/commons/src/main/java/org/cryptomator/common/vaults/VaultStats.java b/main/commons/src/main/java/org/cryptomator/common/vaults/VaultStats.java index 824ba475b..cd87f85ab 100644 --- a/main/commons/src/main/java/org/cryptomator/common/vaults/VaultStats.java +++ b/main/commons/src/main/java/org/cryptomator/common/vaults/VaultStats.java @@ -45,7 +45,7 @@ public class VaultStats { case UNLOCKED: assert fs.get() != null; LOG.debug("start recording stats"); - updateService.start(); + updateService.restart(); break; case LOCKED: LOG.debug("stop recording stats"); diff --git a/main/ui/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java b/main/ui/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java index 3b350929f..01898e528 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java +++ b/main/ui/src/main/java/org/cryptomator/ui/controls/FontAwesome5Icon.java @@ -10,6 +10,7 @@ public enum FontAwesome5Icon { COG("\uF013"), // COGS("\uF085"), // EXCLAMATION_TRIANGLE("\uF071"), // + EYE("\uF06E"), // FOLDER_OPEN("\uF07C"), // HDD("\uF0A0"), // LOCK_ALT("\uF30D"), // diff --git a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailController.java b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailController.java index 1eb257c1d..871b696a2 100644 --- a/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailController.java +++ b/main/ui/src/main/java/org/cryptomator/ui/mainwindow/VaultDetailController.java @@ -6,7 +6,6 @@ import javafx.beans.property.ObjectProperty; import javafx.beans.property.ReadOnlyObjectProperty; import javafx.event.ActionEvent; import javafx.fxml.FXML; -import javafx.scene.input.MouseEvent; import org.cryptomator.common.vaults.Vault; import org.cryptomator.common.vaults.VaultState; import org.cryptomator.common.vaults.Volume; @@ -96,7 +95,7 @@ public class VaultDetailController implements FxController { } @FXML - public void revealAccessLocation(MouseEvent mouseEvent) { + public void revealAccessLocation(ActionEvent actionEvent) { try { vault.get().reveal(); } catch (Volume.VolumeException e) { diff --git a/main/ui/src/main/resources/css/dark_theme.css b/main/ui/src/main/resources/css/dark_theme.css index b263892ca..cac2d664a 100644 --- a/main/ui/src/main/resources/css/dark_theme.css +++ b/main/ui/src/main/resources/css/dark_theme.css @@ -36,6 +36,7 @@ CONTROL_BORDER_FOCUSED: #9E9E9E; CONTROL_BORDER_DISABLED: #515151; CONTROL_BG_NORMAL: #222; + CONTROL_BG_HOVER: #3B3B3B; CONTROL_BG_ARMED: #515151; CONTROL_BG_DISABLED: #3B3B3B; CONTROL_PRIMARY_BORDER_NORMAL: #70A11B; @@ -335,9 +336,14 @@ } .vault-detail .vault-path { + -fx-content-display: text-only; -fx-text-fill: TEXT_FILL_SECONDARY; } +.vault-detail .vault-path:hover { + -fx-content-display: right; +} + /******************************************************************************* * * * Badge * @@ -404,7 +410,6 @@ .button-group { -fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_NORMAL; -fx-background-insets: 0, 0 1px 0 1px; - -fx-padding: 1em; } .button-group.first { @@ -418,10 +423,24 @@ } .button-group:hover { - -fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_PRIMARY_LIGHT_BG_NORMAL; + -fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_HOVER; +} + +.button-group:hover:focused { + -fx-background-color: CONTROL_BORDER_FOCUSED, CONTROL_BG_HOVER; +} + +.button-group:hover:armed { + -fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_ARMED; +} + +.button-group:hover .button-group-action { + visibility: visible; + managed: true; } .button-group-labels { + -fx-padding: 0.5em 0 0.5em 0; -fx-spacing: 0.25em; } @@ -431,7 +450,10 @@ } .button-group-action { + visibility: collapse; + managed: false; -fx-text-fill: TEXT_FILL_PRIMARY; + -fx-font-family: 'Open Sans Bold'; } .button-group-separator { @@ -534,9 +556,19 @@ } .button-large { - -fx-graphic-text-gap: 6px; + -fx-graphic-text-gap: 9px; -fx-font-size: 1.25em; - -fx-padding: 0.5em 1.25em 0.5em 1.25em; + -fx-padding: 0.6em 1.25em 0.6em 1.25em; +} + +/******************************************************************************* + * * + * Buttons * + * * + ******************************************************************************/ + +.hyperlink { + -fx-text-fill: TEXT_FILL; } /******************************************************************************* diff --git a/main/ui/src/main/resources/css/light_theme.css b/main/ui/src/main/resources/css/light_theme.css index eda3fde2b..a8fd1db74 100644 --- a/main/ui/src/main/resources/css/light_theme.css +++ b/main/ui/src/main/resources/css/light_theme.css @@ -36,6 +36,7 @@ CONTROL_BORDER_FOCUSED: #9E9E9E; CONTROL_BORDER_DISABLED: #E1E1E1; CONTROL_BG_NORMAL: #FFF; + CONTROL_BG_HOVER: #F7F7F7; CONTROL_BG_ARMED: #E1E1E1; CONTROL_BG_DISABLED: #F7F7F7; CONTROL_PRIMARY_BORDER_NORMAL: #598016; @@ -335,9 +336,14 @@ } .vault-detail .vault-path { + -fx-content-display: text-only; -fx-text-fill: TEXT_FILL_SECONDARY; } +.vault-detail .vault-path:hover { + -fx-content-display: right; +} + /******************************************************************************* * * * Badge * @@ -404,7 +410,6 @@ .button-group { -fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_NORMAL; -fx-background-insets: 0, 0 1px 0 1px; - -fx-padding: 1em; } .button-group.first { @@ -418,10 +423,24 @@ } .button-group:hover { - -fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_PRIMARY_LIGHT_BG_NORMAL; + -fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_HOVER; +} + +.button-group:hover:focused { + -fx-background-color: CONTROL_BORDER_FOCUSED, CONTROL_BG_HOVER; +} + +.button-group:hover:armed { + -fx-background-color: CONTROL_BORDER_NORMAL, CONTROL_BG_ARMED; +} + +.button-group:hover .button-group-action { + visibility: visible; + managed: true; } .button-group-labels { + -fx-padding: 0.5em 0 0.5em 0; -fx-spacing: 0.25em; } @@ -431,7 +450,10 @@ } .button-group-action { + visibility: collapse; + managed: false; -fx-text-fill: TEXT_FILL_PRIMARY; + -fx-font-family: 'Open Sans Bold'; } .button-group-separator { @@ -534,9 +556,19 @@ } .button-large { - -fx-graphic-text-gap: 6px; + -fx-graphic-text-gap: 9px; -fx-font-size: 1.25em; - -fx-padding: 0.5em 1.25em 0.5em 1.25em; + -fx-padding: 0.6em 1.25em 0.6em 1.25em; +} + +/******************************************************************************* + * * + * Buttons * + * * + ******************************************************************************/ + +.hyperlink { + -fx-text-fill: TEXT_FILL; } /******************************************************************************* diff --git a/main/ui/src/main/resources/fxml/vault_detail.fxml b/main/ui/src/main/resources/fxml/vault_detail.fxml index d4fe5de95..66e700475 100644 --- a/main/ui/src/main/resources/fxml/vault_detail.fxml +++ b/main/ui/src/main/resources/fxml/vault_detail.fxml @@ -20,19 +20,9 @@ - - - - - - - - + @@ -40,12 +30,21 @@ - + + + + + + + @@ -53,48 +52,55 @@ + - - - - - - - - - - - - + + - + - - - - - -