Scrollbar

This commit is contained in:
2026-02-21 19:38:19 +01:00
parent 8d8cbc8b28
commit 2f93822996
2 changed files with 7 additions and 3 deletions
@@ -19,6 +19,9 @@ public class Theme {
// Text/icons shown on accent background // Text/icons shown on accent background
public static Property<Integer> ACCENT_FG = Property.color(0xFF1A140A); public static Property<Integer> ACCENT_FG = Property.color(0xFF1A140A);
// Misc colors
public static Property<Integer> SCROLL = Property.color(0xFFE2BF7D);
// UI metrics // UI metrics
public static Property<Integer> BG_RADIUS = Property.integer(12); public static Property<Integer> BG_RADIUS = Property.integer(12);
public static Property<Integer> WIDGET_RADIUS = Property.integer(10); public static Property<Integer> WIDGET_RADIUS = Property.integer(10);
@@ -35,8 +38,11 @@ public class Theme {
config.property("Primary Foreground", PRIMARY_FG); config.property("Primary Foreground", PRIMARY_FG);
config.property("Accent", ACCENT); config.property("Accent", ACCENT);
config.property("Accent Foreground", ACCENT_FG); config.property("Accent Foreground", ACCENT_FG);
config.property("Scrollbar Color", SCROLL);
config.property("Background Radius", BG_RADIUS); config.property("Background Radius", BG_RADIUS);
config.property("Widget Radius", WIDGET_RADIUS); config.property("Widget Radius", WIDGET_RADIUS);
config.property("Font", WIDGET_RADIUS); config.property("Font", WIDGET_RADIUS);
} }
} }
@@ -11,8 +11,6 @@ import org.saturnclient.ui2.RenderScope;
import org.saturnclient.ui2.components.ElementRenderer; import org.saturnclient.ui2.components.ElementRenderer;
public class Scroll extends Element { public class Scroll extends Element {
private static Property<Integer> scrollBarColor = Property.color(-7643914);
private static Property<Integer> scrollBarRadius = Property.integer(10); private static Property<Integer> scrollBarRadius = Property.integer(10);
private static Property<Integer> scrollBarWidth = Property.integer(5); private static Property<Integer> scrollBarWidth = Property.integer(5);
private static Property<Integer> scrollBarPadding = Property.integer(5); private static Property<Integer> scrollBarPadding = Property.integer(5);
@@ -39,7 +37,7 @@ public class Scroll extends Element {
renderScope.disableScissor(); renderScope.disableScissor();
renderScope.drawRoundedRectangle(width - scrollBarWidth.value - scrollBarPadding.value, calculateScrollBarY(), renderScope.drawRoundedRectangle(width - scrollBarWidth.value - scrollBarPadding.value, calculateScrollBarY(),
scrollBarWidth.value, calculateScrollBarHeight(), scrollBarRadius.value, scrollBarColor.value); scrollBarWidth.value, calculateScrollBarHeight(), scrollBarRadius.value, Theme.SCROLL.value);
} }
@Override @Override