mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-11-22 15:40:23 +00:00
File browser visual improvements and bug fixes
This commit is contained in:
parent
5b0fca5a14
commit
e3b6ed2de3
6 changed files with 23 additions and 14 deletions
|
@ -35,7 +35,7 @@ public class FileListCompEntry {
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void onMouseClick(MouseEvent t) {
|
public void onMouseClick(MouseEvent t) {
|
||||||
if (item == null || isSynthetic()) {
|
if (item == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,6 +45,10 @@ public class FileListCompEntry {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isSynthetic()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (t.getButton() == MouseButton.PRIMARY && t.isShiftDown()) {
|
if (t.getButton() == MouseButton.PRIMARY && t.isShiftDown()) {
|
||||||
var tv = ((TableView<FileSystem.FileEntry>) row.getParent().getParent().getParent().getParent());
|
var tv = ((TableView<FileSystem.FileEntry>) row.getParent().getParent().getParent().getParent());
|
||||||
var all = tv.getItems();
|
var all = tv.getItems();
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class LocalFileTransferComp extends SimpleComp {
|
||||||
new StackComp(List.of(background)).grow(true, true).styleClass("download-background");
|
new StackComp(List.of(background)).grow(true, true).styleClass("download-background");
|
||||||
|
|
||||||
var binding = BindingsHelper.mappedContentBinding(stage.getItems(), item -> item.getFileEntry());
|
var binding = BindingsHelper.mappedContentBinding(stage.getItems(), item -> item.getFileEntry());
|
||||||
var list = new SelectedFileListComp(binding).apply(struc -> struc.get().setMinHeight(200)).grow(false, true);
|
var list = new SelectedFileListComp(binding).apply(struc -> struc.get().setMinHeight(150)).grow(false, true);
|
||||||
var dragNotice = new LabelComp(AppI18n.observable("dragFiles"))
|
var dragNotice = new LabelComp(AppI18n.observable("dragFiles"))
|
||||||
.apply(struc -> struc.get().setGraphic(new FontIcon("mdi2e-export")))
|
.apply(struc -> struc.get().setGraphic(new FontIcon("mdi2e-export")))
|
||||||
.hide(BindingsHelper.persist(Bindings.isEmpty(stage.getItems())))
|
.hide(BindingsHelper.persist(Bindings.isEmpty(stage.getItems())))
|
||||||
|
|
|
@ -76,6 +76,10 @@ final class OpenFileSystemModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Optional<String> cd(String path) {
|
public Optional<String> cd(String path) {
|
||||||
|
if (Objects.equals(path, currentPath.get())) {
|
||||||
|
return Optional.empty();
|
||||||
|
}
|
||||||
|
|
||||||
String newPath = null;
|
String newPath = null;
|
||||||
try {
|
try {
|
||||||
newPath = FileSystemHelper.resolveDirectoryPath(this, path);
|
newPath = FileSystemHelper.resolveDirectoryPath(this, path);
|
||||||
|
|
|
@ -214,7 +214,7 @@ public class StoreEntryComp extends SimpleComp {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Comp<?> createSettingsButton() {
|
private Comp<?> createSettingsButton() {
|
||||||
var settingsButton = new IconButtonComp("mdi2v-view-headline");
|
var settingsButton = new IconButtonComp("mdomz-settings");
|
||||||
settingsButton.styleClass("settings");
|
settingsButton.styleClass("settings");
|
||||||
settingsButton.apply(new PopupMenuAugment<>(true) {
|
settingsButton.apply(new PopupMenuAugment<>(true) {
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -17,7 +17,7 @@ import java.util.List;
|
||||||
public class StoreEntrySection extends Comp<CompStructure<VBox>> {
|
public class StoreEntrySection extends Comp<CompStructure<VBox>> {
|
||||||
|
|
||||||
private final StoreViewSection section;
|
private final StoreViewSection section;
|
||||||
private final boolean top;
|
private final boolean top;
|
||||||
|
|
||||||
public StoreEntrySection(StoreViewSection section, boolean top) {
|
public StoreEntrySection(StoreViewSection section, boolean top) {
|
||||||
this.section = section;
|
this.section = section;
|
||||||
|
@ -28,7 +28,7 @@ public class StoreEntrySection extends Comp<CompStructure<VBox>> {
|
||||||
public CompStructure<VBox> createBase() {
|
public CompStructure<VBox> createBase() {
|
||||||
var root = new StoreEntryComp(section.getWrapper()).apply(struc -> HBox.setHgrow(struc.get(), Priority.ALWAYS));
|
var root = new StoreEntryComp(section.getWrapper()).apply(struc -> HBox.setHgrow(struc.get(), Priority.ALWAYS));
|
||||||
var icon = Comp.of(() -> {
|
var icon = Comp.of(() -> {
|
||||||
var padding = new FontIcon("mdal-arrow_forward_ios");
|
var padding = new FontIcon("mdi2c-circle-double");
|
||||||
padding.setIconSize(14);
|
padding.setIconSize(14);
|
||||||
var pain = new StackPane(padding);
|
var pain = new StackPane(padding);
|
||||||
pain.setMinWidth(20);
|
pain.setMinWidth(20);
|
||||||
|
@ -44,8 +44,8 @@ public class StoreEntrySection extends Comp<CompStructure<VBox>> {
|
||||||
.getFilterString()
|
.getFilterString()
|
||||||
.map(s -> (storeEntrySection -> storeEntrySection.shouldShow(s))));
|
.map(s -> (storeEntrySection -> storeEntrySection.shouldShow(s))));
|
||||||
var content = new ListBoxViewComp<>(shown, all, (StoreViewSection e) -> {
|
var content = new ListBoxViewComp<>(shown, all, (StoreViewSection e) -> {
|
||||||
return new StoreEntrySection(e, false).apply(GrowAugment.create(true, false));
|
return new StoreEntrySection(e, false).apply(GrowAugment.create(true, false));
|
||||||
})
|
})
|
||||||
.apply(struc -> HBox.setHgrow(struc.get(), Priority.ALWAYS))
|
.apply(struc -> HBox.setHgrow(struc.get(), Priority.ALWAYS))
|
||||||
.apply(struc -> struc.get().backgroundProperty().set(Background.fill(Color.color(0, 0, 0, 0.01))));
|
.apply(struc -> struc.get().backgroundProperty().set(Background.fill(Color.color(0, 0, 0, 0.01))));
|
||||||
var spacer = Comp.of(() -> {
|
var spacer = Comp.of(() -> {
|
||||||
|
@ -55,9 +55,11 @@ public class StoreEntrySection extends Comp<CompStructure<VBox>> {
|
||||||
return padding;
|
return padding;
|
||||||
});
|
});
|
||||||
return new VerticalComp(List.of(
|
return new VerticalComp(List.of(
|
||||||
new HorizontalComp(topEntryList),
|
new HorizontalComp(topEntryList),
|
||||||
new HorizontalComp(List.of(spacer, content))
|
new HorizontalComp(List.of(spacer, content))
|
||||||
.apply(struc -> struc.get().setFillHeight(true))
|
.apply(struc -> struc.get().setFillHeight(true))
|
||||||
.hide(BindingsHelper.persist(Bindings.size(section.getChildren()).isEqualTo(0))))).createStructure();
|
.hide(BindingsHelper.persist(
|
||||||
|
Bindings.size(section.getChildren()).isEqualTo(0)))))
|
||||||
|
.createStructure();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
.download-background {
|
.download-background {
|
||||||
-fx-border-color: -color-neutral-emphasis;
|
-fx-border-color: -color-neutral-muted;
|
||||||
-fx-border-width: 1px 0 0 0;
|
-fx-border-width: 4px 0 0 0;
|
||||||
-fx-padding: 1em;
|
-fx-padding: 1em;
|
||||||
-fx-background-color: -color-neutral-muted;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.selected-file-list {
|
.selected-file-list {
|
||||||
|
|
Loading…
Reference in a new issue