mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-17 18:21:26 +00:00
add event count to viewer
This commit is contained in:
@@ -58,6 +58,7 @@ public class EventListCellController implements FxController {
|
||||
private final StringProperty eventMessage;
|
||||
private final StringProperty eventDescription;
|
||||
private final ObjectProperty<FontAwesome5Icon> eventIcon;
|
||||
private final ObservableValue<String> eventCount;
|
||||
private final ObservableValue<Boolean> vaultUnlocked;
|
||||
private final ObservableValue<String> readableTime;
|
||||
private final ObservableValue<String> readableDate;
|
||||
@@ -83,6 +84,7 @@ public class EventListCellController implements FxController {
|
||||
this.eventMessage = new SimpleStringProperty();
|
||||
this.eventDescription = new SimpleStringProperty();
|
||||
this.eventIcon = new SimpleObjectProperty<>();
|
||||
this.eventCount = ObservableUtil.mapWithDefault(event, e -> e.count() == 1? "" : "("+ e.count() +")", "");
|
||||
this.vaultUnlocked = ObservableUtil.mapWithDefault(event.flatMap(e -> e.v().unlockedProperty()), Function.identity(), false);
|
||||
this.readableTime = ObservableUtil.mapWithDefault(event, e -> LOCAL_TIME_FORMATTER.format(e.timestamp()), "");
|
||||
this.readableDate = ObservableUtil.mapWithDefault(event, e -> LOCAL_DATE_FORMATTER.format(e.timestamp()), "");
|
||||
@@ -261,6 +263,14 @@ public class EventListCellController implements FxController {
|
||||
return message.getValue();
|
||||
}
|
||||
|
||||
public ObservableValue<String> countProperty() {
|
||||
return eventCount;
|
||||
}
|
||||
|
||||
public String getCount() {
|
||||
return eventCount.getValue();
|
||||
}
|
||||
|
||||
public ObservableValue<String> descriptionProperty() {
|
||||
return description;
|
||||
}
|
||||
|
||||
@@ -321,6 +321,10 @@
|
||||
-fx-font-size: 1.0em;
|
||||
}
|
||||
|
||||
.list-cell .header-misc {
|
||||
-fx-font-size: 1.0em;
|
||||
}
|
||||
|
||||
.list-cell .detail-label {
|
||||
-fx-text-fill: TEXT_FILL_MUTED;
|
||||
-fx-font-size: 0.8em;
|
||||
|
||||
@@ -23,7 +23,10 @@
|
||||
<FontAwesome5IconView glyph="${controller.icon}" HBox.hgrow="NEVER" glyphSize="16"/>
|
||||
</VBox>
|
||||
<VBox spacing="4" HBox.hgrow="ALWAYS">
|
||||
<Label styleClass="header-label" text="${controller.message}"/>
|
||||
<HBox spacing="4">
|
||||
<Label styleClass="header-label" text="${controller.message}"/>
|
||||
<Label styleClass="header-misc" text="${controller.count}"/>
|
||||
</HBox>
|
||||
<Label text="${controller.description}"/>
|
||||
</VBox>
|
||||
<Button fx:id="eventActionsButton" contentDisplay="GRAPHIC_ONLY" onAction="#toggleEventActionsMenu" managed="${controller.actionsButtonVisible}" visible="${controller.actionsButtonVisible}">
|
||||
|
||||
Reference in New Issue
Block a user