replace static icon in vault detail screen by statusView

This commit is contained in:
Armin Schrenk 2021-06-30 13:50:06 +02:00
parent 91162d3d8f
commit b256670bcc
No known key found for this signature in database
GPG Key ID: 8F2992163CBBA7FC
4 changed files with 32 additions and 1 deletions

View File

@ -33,6 +33,12 @@ public class FontAwesome5StatusView extends Label {
animatedSpinner.glyphSizeProperty().bind(glyphSize);
EasyBind.subscribe(glyphProperty(), this::spinnerOrIcon);
EasyBind.subscribe(glyphSize, this::shrinkToGlyphSize);
}
private void shrinkToGlyphSize(Number newValue) {
double sizeInPx = newValue.doubleValue() * 1.333;
setMaxSize(sizeInPx, sizeInPx);
}
private void spinnerOrIcon(FontAwesome5Icon icon) {

View File

@ -804,6 +804,18 @@
-fx-scale-shape: false;
}
/**
statusView
**/
.status-view-white .glyph-icon {
-fx-fill: white;
}
.status-view-white .progress-indicator .segment {
-fx-background-color: white;
}
/*******************************************************************************
* *
* ProgressIndicator *

View File

@ -802,6 +802,18 @@
-fx-scale-shape: false;
}
/**
statusView
**/
.status-view-white .glyph-icon {
-fx-fill: white;
}
.status-view-white .progress-indicator .segment {
-fx-background-color: white;
}
/*******************************************************************************
* *
* ProgressIndicator *

View File

@ -10,6 +10,7 @@
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.shape.Circle?>
<?import org.cryptomator.ui.controls.FontAwesome5StatusView?>
<VBox xmlns:fx="http://javafx.com/fxml"
xmlns="http://javafx.com/javafx"
fx:controller="org.cryptomator.ui.mainwindow.VaultDetailController"
@ -22,7 +23,7 @@
<HBox spacing="12" visible="${controller.anyVaultSelected}" managed="${controller.anyVaultSelected}">
<StackPane alignment="CENTER">
<Circle styleClass="glyph-icon-primary" radius="16"/>
<FontAwesome5IconView styleClass="glyph-icon-white" glyph="${controller.glyph}" HBox.hgrow="NEVER" glyphSize="16"/>
<FontAwesome5StatusView styleClass="status-view-white" glyph="${controller.glyph}" glyphSize="16"/>
</StackPane>
<VBox spacing="4" HBox.hgrow="ALWAYS">
<HBox spacing="12">