diff --git a/plugin-playground/src/main/kotlin/KondoKit/ScrollablePanel.kt b/plugin-playground/src/main/kotlin/KondoKit/ScrollablePanel.kt index c190c1a..0e772b9 100644 --- a/plugin-playground/src/main/kotlin/KondoKit/ScrollablePanel.kt +++ b/plugin-playground/src/main/kotlin/KondoKit/ScrollablePanel.kt @@ -18,6 +18,7 @@ class ScrollablePanel(private val content: JPanel) : JPanel() { private var scrollbarY = 0 private var showScrollbar = false private var draggingScrollPill = false + private var lastSize = 0 // Define a buffer for the view height (extra space for smoother scrolling) private val viewBuffer = -30 @@ -69,6 +70,8 @@ class ScrollablePanel(private val content: JPanel) : JPanel() { Timer().schedule(object : TimerTask() { override fun run() { updateScrollbar() + if(lastSize != content.preferredSize.height.coerceAtLeast(frame.height + viewBuffer)) + handleResize() } }, 0, 1000) @@ -85,9 +88,10 @@ class ScrollablePanel(private val content: JPanel) : JPanel() { // Ensure the ScrollablePanel resizes with the frame bounds = Rectangle(0, 0, 242, frame.height) - // Dynamically update content bounds and scrollbar on frame resize with buffer - content.bounds = Rectangle(0, 0, 242, content.preferredSize.height.coerceAtLeast(frame.height + viewBuffer)) - showScrollbar = content.height > frame.height + // Dynamically update content bounds and scrollbar on frame resize with buffer + lastSize = content.preferredSize.height.coerceAtLeast(frame.height + viewBuffer) + content.bounds = Rectangle(0, 0, 242, lastSize) + showScrollbar = content.height > frame.height currentOffsetY = 0 diff --git a/plugin-playground/src/main/kotlin/KondoKit/Themes.kt b/plugin-playground/src/main/kotlin/KondoKit/Themes.kt index fc64103..1b7988d 100644 --- a/plugin-playground/src/main/kotlin/KondoKit/Themes.kt +++ b/plugin-playground/src/main/kotlin/KondoKit/Themes.kt @@ -60,7 +60,7 @@ object Themes { ThemeType.SARADOMIN -> Theme( widgetColor = Color(62, 53, 41), titleBarColor = Color(111, 93, 69).darker(), - viewBackgroundColor = Color(111, 93, 69), + viewBackgroundColor = Color(101, 85, 63), primaryColor = Color(180, 150, 120), secondaryColor = Color(230, 210, 190), popupBackground = Color(70, 56, 42),