Skip to content

Commit

Permalink
More status bar fixes [release] [noannounce]
Browse files Browse the repository at this point in the history
crschnick committed Mar 4, 2024
1 parent a557fcb commit ee3f5ba
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions app/src/main/java/io/xpipe/app/browser/BrowserStatusBarComp.java
Original file line number Diff line number Diff line change
@@ -63,8 +63,8 @@ private Comp<?> createProgressStatus() {
}

private Comp<?> createClipboardStatus() {
var cc = PlatformThread.sync(BrowserClipboard.currentCopyClipboard);
var ccCount = Bindings.createStringBinding(
var cc = BrowserClipboard.currentCopyClipboard;
var ccCount = (BindingsHelper.persist(Bindings.createStringBinding(
() -> {
if (cc.getValue() != null && cc.getValue().getEntries().size() > 0) {
return cc.getValue().getEntries().size() + " file"
@@ -73,25 +73,25 @@ private Comp<?> createClipboardStatus() {
return null;
}
},
cc);
cc)));
return new LabelComp(ccCount);
}

private Comp<?> createSelectionStatus() {
var selectedCount = PlatformThread.sync(Bindings.createIntegerBinding(
var selectedCount = Bindings.createIntegerBinding(
() -> {
return model.getFileList().getSelection().size();
},
model.getFileList().getSelection()));
model.getFileList().getSelection());

var allCount = PlatformThread.sync(Bindings.createIntegerBinding(
var allCount = Bindings.createIntegerBinding(
() -> {
return (int) model.getFileList().getAll().getValue().stream()
.filter(entry -> !entry.isSynthetic())
.count();
},
model.getFileList().getAll()));
var selectedComp = new LabelComp(Bindings.createStringBinding(
model.getFileList().getAll());
var selectedComp = new LabelComp(BindingsHelper.persist(Bindings.createStringBinding(
() -> {
if (selectedCount.getValue().intValue() == 0) {
return null;
@@ -100,7 +100,7 @@ private Comp<?> createSelectionStatus() {
}
},
selectedCount,
allCount));
allCount)));
return selectedComp;
}

0 comments on commit ee3f5ba

Please sign in to comment.