mirror of
https://github.com/xpipe-io/xpipe.git
synced 2025-04-17 09:43:37 +00:00
Show script icons in browser
This commit is contained in:
parent
9318a24120
commit
ab71d178f3
1 changed files with 11 additions and 0 deletions
|
@ -6,6 +6,7 @@ import io.xpipe.app.browser.action.BrowserBranchAction;
|
|||
import io.xpipe.app.browser.action.BrowserLeafAction;
|
||||
import io.xpipe.app.browser.file.BrowserEntry;
|
||||
import io.xpipe.app.browser.file.BrowserFileSystemTabModel;
|
||||
import io.xpipe.app.comp.base.PrettyImageHelper;
|
||||
import io.xpipe.app.comp.store.StoreViewState;
|
||||
import io.xpipe.app.core.AppI18n;
|
||||
import io.xpipe.app.core.AppLayoutModel;
|
||||
|
@ -92,6 +93,11 @@ public class RunScriptAction implements BrowserAction, BrowserBranchAction {
|
|||
.map(c -> createActionForScriptHierarchy(model, c))
|
||||
.toList();
|
||||
return new BrowserBranchAction() {
|
||||
@Override
|
||||
public Node getIcon(BrowserFileSystemTabModel model, List<BrowserEntry> entries) {
|
||||
return PrettyImageHelper.ofFixedSize(hierarchy.getBase().get().getEffectiveIconFile(), 16, 16).createRegion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<? extends BrowserAction> getBranchingActions(
|
||||
BrowserFileSystemTabModel model, List<BrowserEntry> entries) {
|
||||
|
@ -110,6 +116,11 @@ public class RunScriptAction implements BrowserAction, BrowserBranchAction {
|
|||
BrowserFileSystemTabModel model, DataStoreEntryRef<SimpleScriptStore> ref) {
|
||||
return new MultiExecuteSelectionAction() {
|
||||
|
||||
@Override
|
||||
public Node getIcon(BrowserFileSystemTabModel model, List<BrowserEntry> entries) {
|
||||
return PrettyImageHelper.ofFixedSize(ref.get().getEffectiveIconFile(), 16, 16).createRegion();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObservableValue<String> getName(BrowserFileSystemTabModel model, List<BrowserEntry> entries) {
|
||||
return new SimpleStringProperty(ref.get().getName());
|
||||
|
|
Loading…
Add table
Reference in a new issue