From e1f84d4a6b45bc3fc3a42998253c71ed14c7a7ac Mon Sep 17 00:00:00 2001 From: crschnick Date: Mon, 15 Jul 2024 20:58:04 +0000 Subject: [PATCH] Rework ui size --- .../app/comp/store/DenseStoreEntryComp.java | 7 ++----- .../app/comp/store/StandardStoreEntryComp.java | 8 +++++--- .../io/xpipe/app/comp/store/StoreEntryComp.java | 8 +++----- .../app/resources/style/store-entry-comp.css | 16 ++++++++++++++++ .../io/xpipe/app/resources/style/style.css | 2 +- .../service/AbstractServiceStoreProvider.java | 3 ++- 6 files changed, 29 insertions(+), 15 deletions(-) diff --git a/app/src/main/java/io/xpipe/app/comp/store/DenseStoreEntryComp.java b/app/src/main/java/io/xpipe/app/comp/store/DenseStoreEntryComp.java index 36eecce70..0b0b5f756 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/DenseStoreEntryComp.java +++ b/app/src/main/java/io/xpipe/app/comp/store/DenseStoreEntryComp.java @@ -1,10 +1,8 @@ package io.xpipe.app.comp.store; -import io.xpipe.app.core.AppFont; import io.xpipe.app.fxcomps.Comp; import io.xpipe.app.fxcomps.augment.GrowAugment; import io.xpipe.app.fxcomps.util.PlatformThread; - import javafx.beans.binding.Bindings; import javafx.beans.property.SimpleStringProperty; import javafx.geometry.HPos; @@ -26,7 +24,6 @@ public class DenseStoreEntryComp extends StoreEntryComp { var information = new Label(); information.setGraphicTextGap(7); information.getStyleClass().add("information"); - AppFont.header(information); var state = getWrapper().getEntry().getProvider() != null ? getWrapper().getEntry().getProvider().stateDisplay(getWrapper()) @@ -76,8 +73,8 @@ public class DenseStoreEntryComp extends StoreEntryComp { var notes = new StoreNotesComp(getWrapper()).createRegion(); if (showIcon) { - var storeIcon = createIcon(30, 24); - grid.getColumnConstraints().add(new ColumnConstraints(46)); + var storeIcon = createIcon(28, 24); + grid.getColumnConstraints().add(new ColumnConstraints(38)); grid.add(storeIcon, 0, 0); GridPane.setHalignment(storeIcon, HPos.CENTER); } diff --git a/app/src/main/java/io/xpipe/app/comp/store/StandardStoreEntryComp.java b/app/src/main/java/io/xpipe/app/comp/store/StandardStoreEntryComp.java index e141a2513..074426dee 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StandardStoreEntryComp.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StandardStoreEntryComp.java @@ -5,6 +5,7 @@ import io.xpipe.app.fxcomps.Comp; import javafx.geometry.HPos; import javafx.geometry.Insets; import javafx.geometry.Pos; +import javafx.geometry.VPos; import javafx.scene.layout.*; public class StandardStoreEntryComp extends StoreEntryComp { @@ -23,17 +24,18 @@ public class StandardStoreEntryComp extends StoreEntryComp { var notes = new StoreNotesComp(getWrapper()).createRegion(); var grid = new GridPane(); - grid.setHgap(7); + grid.setHgap(6); grid.setVgap(0); - var storeIcon = createIcon(50, 40); + var storeIcon = createIcon(46, 40); grid.add(storeIcon, 0, 0, 1, 2); - grid.getColumnConstraints().add(new ColumnConstraints(66)); + grid.getColumnConstraints().add(new ColumnConstraints(56)); var nameAndNotes = new HBox(name, notes); nameAndNotes.setSpacing(1); nameAndNotes.setAlignment(Pos.CENTER_LEFT); grid.add(nameAndNotes, 1, 0); + GridPane.setValignment(nameAndNotes, VPos.CENTER); grid.add(createSummary(), 1, 1); var nameCC = new ColumnConstraints(); nameCC.setMinWidth(100); diff --git a/app/src/main/java/io/xpipe/app/comp/store/StoreEntryComp.java b/app/src/main/java/io/xpipe/app/comp/store/StoreEntryComp.java index 627af987b..8ea05c3dc 100644 --- a/app/src/main/java/io/xpipe/app/comp/store/StoreEntryComp.java +++ b/app/src/main/java/io/xpipe/app/comp/store/StoreEntryComp.java @@ -139,6 +139,7 @@ public abstract class StoreEntryComp extends SimpleComp { getWrapper().getEntry().getValidity().isUsable() ? getWrapper().getBusy().or(getWrapper().getEntry().getProvider().busy(getWrapper())) : getWrapper().getBusy()); + AppFont.normal(button); return loading.createRegion(); } @@ -155,7 +156,6 @@ public abstract class StoreEntryComp extends SimpleComp { getWrapper().getEntry().getProvider().informationString(section)) : new SimpleStringProperty()); information.getStyleClass().add("information"); - AppFont.header(information); var state = getWrapper().getEntry().getProvider() != null ? getWrapper().getEntry().getProvider().stateDisplay(getWrapper()) @@ -194,9 +194,7 @@ public abstract class StoreEntryComp extends SimpleComp { protected Comp createName() { LabelComp name = new LabelComp(getWrapper().nameProperty()); - name.apply(struc -> struc.get().setTextOverrun(OverrunStyle.CENTER_ELLIPSIS)) - .apply(struc -> struc.get().setPadding(new Insets(5, 5, 5, 0))); - name.apply(s -> AppFont.header(s.get())); + name.apply(struc -> struc.get().setTextOverrun(OverrunStyle.CENTER_ELLIPSIS)); name.styleClass("name"); return name; } @@ -243,8 +241,8 @@ public abstract class StoreEntryComp extends SimpleComp { buttons.subscribe(update); update.run(); ig.setAlignment(Pos.CENTER_RIGHT); - ig.setPadding(new Insets(5)); ig.getStyleClass().add("button-bar"); + AppFont.medium(ig); return ig; } diff --git a/app/src/main/resources/io/xpipe/app/resources/style/store-entry-comp.css b/app/src/main/resources/io/xpipe/app/resources/style/store-entry-comp.css index 10a77eb29..d14b23437 100644 --- a/app/src/main/resources/io/xpipe/app/resources/style/store-entry-comp.css +++ b/app/src/main/resources/io/xpipe/app/resources/style/store-entry-comp.css @@ -37,6 +37,14 @@ -fx-opacity: 0.5; } +.store-entry-grid .name { + -fx-padding: 2 0 0 0; +} + +.store-entry-grid.dense .name { + -fx-padding: 0 0 0 0; +} + .store-entry-grid .icon { -fx-background-color: -color-bg-overlay; -fx-background-radius: 5px; @@ -90,6 +98,14 @@ -fx-opacity: 0.2; } +.store-entry-comp .button-bar { + -fx-padding: 5; +} + +.store-entry-grid.dense .button-bar { + -fx-padding: 3; +} + .store-entry-comp .button-bar .button { -fx-padding: 6px; } diff --git a/app/src/main/resources/io/xpipe/app/resources/style/style.css b/app/src/main/resources/io/xpipe/app/resources/style/style.css index a19000a00..a964ddde4 100644 --- a/app/src/main/resources/io/xpipe/app/resources/style/style.css +++ b/app/src/main/resources/io/xpipe/app/resources/style/style.css @@ -63,7 +63,7 @@ } .toggle-switch:has-graphic { - -fx-font-size: 0.8em; + -fx-font-size: 0.75em; } .store-layout .split-pane-divider { diff --git a/ext/base/src/main/java/io/xpipe/ext/base/service/AbstractServiceStoreProvider.java b/ext/base/src/main/java/io/xpipe/ext/base/service/AbstractServiceStoreProvider.java index b0cad712a..f577849d7 100644 --- a/ext/base/src/main/java/io/xpipe/ext/base/service/AbstractServiceStoreProvider.java +++ b/ext/base/src/main/java/io/xpipe/ext/base/service/AbstractServiceStoreProvider.java @@ -1,6 +1,7 @@ package io.xpipe.ext.base.service; import io.xpipe.app.comp.base.SystemStateComp; +import io.xpipe.app.comp.store.DenseStoreEntryComp; import io.xpipe.app.comp.store.StoreEntryComp; import io.xpipe.app.comp.store.StoreEntryWrapper; import io.xpipe.app.comp.store.StoreSection; @@ -80,7 +81,7 @@ public abstract class AbstractServiceStoreProvider implements SingletonSessionSt return true; }, sec.getWrapper().getCache())); - return StoreEntryComp.create(sec, toggle, preferLarge); + return new DenseStoreEntryComp(sec, true, toggle); } @Override