File browser visual improvements and bug fixes

This commit is contained in:
crschnick 2023-04-03 14:32:33 +00:00
parent 5b0fca5a14
commit e3b6ed2de3
6 changed files with 23 additions and 14 deletions

View file

@ -35,7 +35,7 @@ public class FileListCompEntry {
@SuppressWarnings("unchecked")
public void onMouseClick(MouseEvent t) {
if (item == null || isSynthetic()) {
if (item == null) {
return;
}
@ -45,6 +45,10 @@ public class FileListCompEntry {
return;
}
if (isSynthetic()) {
return;
}
if (t.getButton() == MouseButton.PRIMARY && t.isShiftDown()) {
var tv = ((TableView<FileSystem.FileEntry>) row.getParent().getParent().getParent().getParent());
var all = tv.getItems();

View file

@ -43,7 +43,7 @@ public class LocalFileTransferComp extends SimpleComp {
new StackComp(List.of(background)).grow(true, true).styleClass("download-background");
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"))
.apply(struc -> struc.get().setGraphic(new FontIcon("mdi2e-export")))
.hide(BindingsHelper.persist(Bindings.isEmpty(stage.getItems())))

View file

@ -76,6 +76,10 @@ final class OpenFileSystemModel {
}
public Optional<String> cd(String path) {
if (Objects.equals(path, currentPath.get())) {
return Optional.empty();
}
String newPath = null;
try {
newPath = FileSystemHelper.resolveDirectoryPath(this, path);

View file

@ -214,7 +214,7 @@ public class StoreEntryComp extends SimpleComp {
}
private Comp<?> createSettingsButton() {
var settingsButton = new IconButtonComp("mdi2v-view-headline");
var settingsButton = new IconButtonComp("mdomz-settings");
settingsButton.styleClass("settings");
settingsButton.apply(new PopupMenuAugment<>(true) {
@Override

View file

@ -17,7 +17,7 @@ import java.util.List;
public class StoreEntrySection extends Comp<CompStructure<VBox>> {
private final StoreViewSection section;
private final boolean top;
private final boolean top;
public StoreEntrySection(StoreViewSection section, boolean top) {
this.section = section;
@ -28,7 +28,7 @@ public class StoreEntrySection extends Comp<CompStructure<VBox>> {
public CompStructure<VBox> createBase() {
var root = new StoreEntryComp(section.getWrapper()).apply(struc -> HBox.setHgrow(struc.get(), Priority.ALWAYS));
var icon = Comp.of(() -> {
var padding = new FontIcon("mdal-arrow_forward_ios");
var padding = new FontIcon("mdi2c-circle-double");
padding.setIconSize(14);
var pain = new StackPane(padding);
pain.setMinWidth(20);
@ -44,8 +44,8 @@ public class StoreEntrySection extends Comp<CompStructure<VBox>> {
.getFilterString()
.map(s -> (storeEntrySection -> storeEntrySection.shouldShow(s))));
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 -> struc.get().backgroundProperty().set(Background.fill(Color.color(0, 0, 0, 0.01))));
var spacer = Comp.of(() -> {
@ -55,9 +55,11 @@ public class StoreEntrySection extends Comp<CompStructure<VBox>> {
return padding;
});
return new VerticalComp(List.of(
new HorizontalComp(topEntryList),
new HorizontalComp(List.of(spacer, content))
.apply(struc -> struc.get().setFillHeight(true))
.hide(BindingsHelper.persist(Bindings.size(section.getChildren()).isEqualTo(0))))).createStructure();
new HorizontalComp(topEntryList),
new HorizontalComp(List.of(spacer, content))
.apply(struc -> struc.get().setFillHeight(true))
.hide(BindingsHelper.persist(
Bindings.size(section.getChildren()).isEqualTo(0)))))
.createStructure();
}
}

View file

@ -1,8 +1,7 @@
.download-background {
-fx-border-color: -color-neutral-emphasis;
-fx-border-width: 1px 0 0 0;
-fx-border-color: -color-neutral-muted;
-fx-border-width: 4px 0 0 0;
-fx-padding: 1em;
-fx-background-color: -color-neutral-muted;
}
.selected-file-list {