Style rework

This commit is contained in:
crschnick
2025-02-02 06:00:50 +00:00
parent 947d1cd707
commit e845a4e97c
9 changed files with 20 additions and 8 deletions
@@ -63,7 +63,7 @@ public class BrowserFileChooserSessionComp extends DialogComp {
});
var comp = new BrowserFileChooserSessionComp(stage, model);
comp.apply(struc -> struc.get().setPrefSize(1200, 700))
.apply(struc -> AppFontSizes.base(struc.get()))
.apply(struc -> AppFontSizes.sm(struc.get()))
.styleClass("browser")
.styleClass("chooser");
return comp;
@@ -12,6 +12,7 @@ import io.xpipe.app.comp.base.LoadingOverlayComp;
import io.xpipe.app.comp.base.StackComp;
import io.xpipe.app.comp.base.VerticalComp;
import io.xpipe.app.comp.store.StoreEntryWrapper;
import io.xpipe.app.core.AppFontSizes;
import io.xpipe.app.core.AppLayoutModel;
import io.xpipe.app.ext.ShellStore;
import io.xpipe.app.util.BindingsHelper;
@@ -99,7 +100,8 @@ public class BrowserFullSessionComp extends SimpleComp {
});
});
splitPane.styleClass("browser");
return splitPane.createRegion();
var r = splitPane.createRegion();
return r;
}
private Comp<CompStructure<VBox>> createLeftSide() {
@@ -4,6 +4,7 @@ import io.xpipe.app.comp.Comp;
import io.xpipe.app.comp.CompStructure;
import io.xpipe.app.comp.SimpleComp;
import io.xpipe.app.comp.store.*;
import io.xpipe.app.core.AppFontSizes;
import io.xpipe.app.storage.DataStoreEntry;
import io.xpipe.app.util.PlatformThread;
@@ -86,6 +87,7 @@ public final class BrowserConnectionListComp extends SimpleComp {
var r = section.vgrow().createRegion();
r.getStyleClass().add("bookmark-list");
AppFontSizes.sm(r);
return r;
}
@@ -2,6 +2,7 @@ package io.xpipe.app.browser.file;
import io.xpipe.app.browser.action.BrowserAction;
import io.xpipe.app.comp.SimpleComp;
import io.xpipe.app.core.AppFontSizes;
import io.xpipe.app.core.AppI18n;
import io.xpipe.app.util.*;
import io.xpipe.core.process.OsType;
@@ -125,7 +126,7 @@ public final class BrowserFileListComp extends SimpleComp {
fileList.setComparator(table.getComparator());
return true;
});
table.setFixedCellSize(32.0);
table.setFixedCellSize(30.0);
prepareColumnVisibility(table, ownerCol, filenameCol);
prepareTableScrollFix(table);
@@ -135,6 +136,8 @@ public final class BrowserFileListComp extends SimpleComp {
prepareTableChanges(table, filenameCol, mtimeCol, modeCol, ownerCol);
prepareTypedSelectionModel(table);
AppFontSizes.sm(table);
return table;
}
@@ -291,7 +294,7 @@ public final class BrowserFileListComp extends SimpleComp {
});
fileList.getSelection().addListener((ListChangeListener<? super BrowserEntry>) c -> {
var existing = new HashSet<>(fileList.getSelection());
var existing = new HashSet<>(table.getSelectionModel().getSelectedItems());
var toApply = new HashSet<>(c.getList());
if (existing.equals(toApply)) {
return;
@@ -60,6 +60,7 @@ public class BrowserFileSelectionListComp extends SimpleComp {
.createRegion();
var t = nameTransformation.apply(entry);
var l = new Label(t.getValue(), image);
l.setGraphicTextGap(6);
l.setTextOverrun(OverrunStyle.CENTER_ELLIPSIS);
t.addListener((observable, oldValue, newValue) -> {
PlatformThread.runLaterIfNeeded(() -> {
@@ -115,7 +115,9 @@ public class BrowserQuickAccessContextMenu extends ContextMenu {
var dirs = browserEntries.stream()
.filter(e -> e.getRawFileEntry().getKind() == FileKind.DIRECTORY)
.toList();
if (dirs.size() == 1) {
// Expand subdir if only one
// Note that if we have a link to the directory itself, we shouldn't do it, otherwise we are stuck in a loop
if (dirs.size() == 1 && !dirs.getFirst().getRawFileEntry().getPath().equals(entry.getRawFileEntry().getPath())) {
updateMenuItems((Menu) menus.get(dirs.getFirst()), dirs.getFirst(), true);
}
newItems.addAll(menus.values());
@@ -194,6 +194,8 @@ public class BrowserTransferComp extends SimpleComp {
});
});
return stack.styleClass("transfer").createRegion();
var r = stack.styleClass("transfer").createRegion();
AppFontSizes.sm(r);
return r;
}
}
@@ -39,7 +39,7 @@ public class AppFontSizes {
apply(node, AppFontSizes::getXxl);
}
private static void apply(Node node, Function<AppFontSizes, String> function) {
public static void apply(Node node, Function<AppFontSizes, String> function) {
if (AppPrefs.get() == null) {
setFont(node, function.apply(getDefault()));
return;
@@ -302,7 +302,7 @@
-fx-background-color: -color-accent-subtle;
}
.browser .table-row-cell:selected, .browser .table-row-cell:hover:selected, .root:key-navigation .browser .table-row-cell:focused:selected {
.browser .table-row-cell:selected, .browser .table-row-cell:hover:selected, .root:key-navigation .browser .table-view:focus-within .table-row-cell:focused:selected {
-fx-background-color: -color-success-subtle;
}