Redesign client settings
ClientSettings replaces ConfigEditor: a section list on the left (General, UI Style, Animations) and the chosen section's settings on the right, each with a Reset for that section. UI Style shows four theme presets, the theme colors as a two-column grid, then the radii and font. New pieces: SectionNav, ThemePresetCard, ColorGrid and Theme.PRESETS. Theme keeps its config like AnimationConfig does, Divider can be vertical, and PropertyList's section titles are public. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
package org.saturnclient.config;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.saturnclient.config.property.ColorProperty;
|
||||
import org.saturnclient.config.property.IntProperty;
|
||||
import org.saturnclient.config.property.Property;
|
||||
import org.saturnclient.config.property.SelectProperty;
|
||||
|
||||
public class Theme {
|
||||
public static ConfigManager config;
|
||||
|
||||
// Main UI background (slightly warm dark to match Saturn tone)
|
||||
public static final ColorProperty BACKGROUND = Property.color(0xFF12100D);
|
||||
|
||||
@@ -34,8 +38,37 @@ public class Theme {
|
||||
// Font
|
||||
public static final SelectProperty FONT = Property.font(2);
|
||||
|
||||
/**
|
||||
* A full set of theme colors that can be applied in one go.
|
||||
*/
|
||||
public record Preset(String name, int background, int foreground, int primary, int primaryFg, int accent,
|
||||
int accentFg, int scroll) {
|
||||
|
||||
public void apply() {
|
||||
BACKGROUND.value = background;
|
||||
FOREGROUND.value = foreground;
|
||||
PRIMARY.value = primary;
|
||||
PRIMARY_FG.value = primaryFg;
|
||||
ACCENT.value = accent;
|
||||
ACCENT_FG.value = accentFg;
|
||||
SCROLL.value = scroll;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return BACKGROUND.value == background && FOREGROUND.value == foreground && PRIMARY.value == primary
|
||||
&& PRIMARY_FG.value == primaryFg && ACCENT.value == accent && ACCENT_FG.value == accentFg
|
||||
&& SCROLL.value == scroll;
|
||||
}
|
||||
}
|
||||
|
||||
public static final List<Preset> PRESETS = List.of(
|
||||
new Preset("Saturn", 0xFF12100D, 0xFFF2E6D2, 0xFF1C1915, 0xFFEAD9B8, 0xFFE2BF7D, 0xFF1A140A, 0xFFE2BF7D),
|
||||
new Preset("Midnight", 0xFF0E1117, 0xFFE4EAF5, 0xFF171C26, 0xFFC9D4E8, 0xFF8FB3FF, 0xFF0A1224, 0xFF8FB3FF),
|
||||
new Preset("Amethyst", 0xFF120F17, 0xFFEDE4F7, 0xFF1C1724, 0xFFD8C9EB, 0xFFC79BFF, 0xFF1A0F2A, 0xFFC79BFF),
|
||||
new Preset("Emerald", 0xFF0D1210, 0xFFE2F2EA, 0xFF16201B, 0xFFC4E0D2, 0xFF7FD1A8, 0xFF0A1F15, 0xFF7FD1A8));
|
||||
|
||||
public static void init(ConfigManager parent) {
|
||||
ConfigManager config = new ConfigManager(parent, "UI Style");
|
||||
config = new ConfigManager(parent, "UI Style");
|
||||
config.property("Background", BACKGROUND);
|
||||
config.property("Foreground", FOREGROUND);
|
||||
config.property("Primary", PRIMARY);
|
||||
|
||||
Reference in New Issue
Block a user