Skip to content

Commit a5db38f

Browse files
authored
Merge pull request #8 from B077AS/dev
improved themes
2 parents a1cc3e8 + 88e3856 commit a5db38f

4 files changed

Lines changed: 29 additions & 21 deletions

File tree

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
# QueryExe
1+
<h1 align="center">
2+
<img src="src/main/resources/icon.png" alt="QueryExe icon" width="80"><br>
3+
QueryExe
4+
</h1>
25

36
<p align="center">
47
<b>A free, cross-platform desktop client for working with relational databases.</b><br>

src/main/java/com/queryexe/components/home/ConnectionsPane.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,15 @@ private void updatePagination(int targetPage) {
258258
int clampedPage = Math.min(Math.max(targetPage, 0), totalPages - 1);
259259

260260
pagination.setPageCount(totalPages);
261-
pagination.setCurrentPageIndex(clampedPage);
261+
if (pagination.getCurrentPageIndex() != clampedPage) {
262+
pagination.setCurrentPageIndex(clampedPage);
263+
} else if (currentPage != null) {
264+
// Pagination only re-invokes the page factory when the page index
265+
// itself changes, but a resize can change cardsPerRow/cardsPerColumn
266+
// while leaving the index the same (e.g. still page 1 of 1) — force
267+
// the grid to re-lay-out with the new dimensions in that case.
268+
currentPage.setCenter(visible.isEmpty() ? buildEmptyState() : buildGrid(clampedPage));
269+
}
262270
}
263271

264272
private BorderPane buildPage(int pageIndex) {

src/main/java/com/queryexe/theme/ThemeManager.java

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,18 @@
1414
/**
1515
* Applies and persists the app's accent {@link AppTheme}.
1616
*
17-
* <p>The base stylesheet's {@code -color-accent-*} tokens are purple, and
18-
* (unlike a neutral-gray UI) several background/border/selection tokens in
19-
* style.css are also purple-tinted hex literals rather than pure grays. So
20-
* switching themes isn't just swapping the accent ramp: those extra tokens
21-
* are rotated by the same hue delta as the theme's accent color, keeping
22-
* their saturation/lightness identical to the default theme and making the
23-
* result read as a hue change rather than a new palette.
17+
* <p>The base stylesheet's {@code -color-accent-*} tokens are purple, and a
18+
* couple of selection/syntax tokens in style.css are also purple-tinted hex
19+
* literals rather than pure grays. So switching themes isn't just swapping
20+
* the accent ramp: those extra tokens are rotated by the same hue delta as
21+
* the theme's accent color, keeping their saturation/lightness identical to
22+
* the default theme and making the result read as a hue change rather than
23+
* a new palette.
24+
*
25+
* <p>Backgrounds ({@code -color-bg-*}) are deliberately left out of that
26+
* rotation and stay pure neutral grays (defined once in style.css) for
27+
* every theme, so the accent color shows up in controls/borders/highlights
28+
* without tinting the app's panels.
2429
*
2530
* <p>The override is a small {@code .root{...}} rule containing only the
2631
* tokens above, encoded as a {@code data:text/css;base64,...} stylesheet
@@ -35,10 +40,6 @@ public class ThemeManager {
3540

3641
// Purple-tinted tokens in style.css that aren't part of the accent ramp
3742
// itself but still need to rotate with the chosen theme.
38-
private static final String BG_DEFAULT = "#282a36";
39-
private static final String BG_OVERLAY = "#22242f";
40-
private static final String BG_SUBTLE = "#3d3f4a";
41-
private static final String BG_INSET = "#181920";
4243
private static final String SELECTION_MUTED = "#68637c";
4344
private static final String SYNTAX_KEYWORD = "#ac80ea";
4445

@@ -125,10 +126,6 @@ private String buildOverrideBody(AppTheme theme) {
125126

126127
sb.append("-color-selection-muted:").append(ColorUtil.rotateHex(SELECTION_MUTED, hueShift)).append(';');
127128
sb.append("-color-syntax-keyword:").append(ColorUtil.rotateHex(SYNTAX_KEYWORD, hueShift)).append(';');
128-
sb.append("-color-bg-default:").append(ColorUtil.rotateHex(BG_DEFAULT, hueShift)).append(';');
129-
sb.append("-color-bg-overlay:").append(ColorUtil.rotateHex(BG_OVERLAY, hueShift)).append(';');
130-
sb.append("-color-bg-subtle:").append(ColorUtil.rotateHex(BG_SUBTLE, hueShift)).append(';');
131-
sb.append("-color-bg-inset:").append(ColorUtil.rotateHex(BG_INSET, hueShift)).append(';');
132129

133130
return sb.toString();
134131
}

src/main/resources/style.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@
6969
-color-fg-muted: #bfbfc3;
7070
-color-fg-subtle: #7e7f86;
7171
-color-fg-emphasis: #0d0e12;
72-
-color-bg-default: #282a36;
73-
-color-bg-overlay: #22242f;
74-
-color-bg-subtle: #3d3f4a;
75-
-color-bg-inset: #181920;
72+
-color-bg-default: #292e35;
73+
-color-bg-overlay: #24282d;
74+
-color-bg-subtle: #3b424c;
75+
-color-bg-inset: #191b1f;
7676
-color-border-default: #685ab3;
7777
-color-border-muted: #52468c;
7878
-color-border-subtle: #3c3366;

0 commit comments

Comments
 (0)