From 9dd95e8f2776ccb763e0f42d5c601334cde22628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Ha=C3=9Fel?= Date: Sun, 16 Apr 2023 10:31:19 +0200 Subject: [PATCH] WIP --- src/main/java/de/ph87/kindermalen/CONFIG.java | 2 +- .../kindermalen/toolbox/tool/stamp/StampButtonList.java | 8 ++++---- .../de/ph87/kindermalen/util/MyGridBagConstraints.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/ph87/kindermalen/CONFIG.java b/src/main/java/de/ph87/kindermalen/CONFIG.java index 6f80ce0..ab9f2e6 100644 --- a/src/main/java/de/ph87/kindermalen/CONFIG.java +++ b/src/main/java/de/ph87/kindermalen/CONFIG.java @@ -16,7 +16,7 @@ public class CONFIG { public static final int TOOLBOX_BUTTON_SIZE = 50; - public static final int STAMP_GROUP_BUTTON_SIZE = 40; + public static final int STAMP_GROUP_BUTTON_SIZE = 35; public static final int STAMP_GROUP_BUTTON_ICON_REAL_SIZE = STAMP_GROUP_BUTTON_SIZE - STROKE_HIGHLIGHT_WIDTH * 2; diff --git a/src/main/java/de/ph87/kindermalen/toolbox/tool/stamp/StampButtonList.java b/src/main/java/de/ph87/kindermalen/toolbox/tool/stamp/StampButtonList.java index 17f8da5..c338e41 100644 --- a/src/main/java/de/ph87/kindermalen/toolbox/tool/stamp/StampButtonList.java +++ b/src/main/java/de/ph87/kindermalen/toolbox/tool/stamp/StampButtonList.java @@ -27,10 +27,10 @@ public class StampButtonList extends MyComponent { removeAll(); if (stampTool.getActiveGroup() != null) { stampTool.getActiveGroup().getStamps().stream() - .sorted(Comparator.comparing(Stamp::getFile)) - .map(stamp -> new StampButton(stampTool, stamp)) - .forEach(this::add); - setPreferredSize(new Dimension(SIDEBAR_WIDTH, getComponentCount() * STAMP_BUTTON_SIZE * STAMP_BUTTON_SIZE / SIDEBAR_WIDTH)); + .sorted(Comparator.comparing(Stamp::getFile)) + .map(stamp -> new StampButton(stampTool, stamp)) + .forEach(this::add); + setPreferredSize(new Dimension(SIDEBAR_WIDTH, ((int) Math.ceil((double) getComponentCount() * STAMP_BUTTON_SIZE / SIDEBAR_WIDTH) * STAMP_BUTTON_SIZE))); } } revalidate(); diff --git a/src/main/java/de/ph87/kindermalen/util/MyGridBagConstraints.java b/src/main/java/de/ph87/kindermalen/util/MyGridBagConstraints.java index f833765..b823494 100644 --- a/src/main/java/de/ph87/kindermalen/util/MyGridBagConstraints.java +++ b/src/main/java/de/ph87/kindermalen/util/MyGridBagConstraints.java @@ -9,7 +9,7 @@ public class MyGridBagConstraints extends GridBagConstraints { } public static MyGridBagConstraints GBC(final int x, final int y, final double wX, final double wY, final int fill) { - return new MyGridBagConstraints(x, y, 1, 1, wX, wY, PAGE_START, fill, new Insets(0, 0, 0, 0), 0, 0); + return new MyGridBagConstraints(x, y, 1, 1, wX, wY, FIRST_LINE_START, fill, new Insets(0, 0, 0, 0), 0, 0); } }