diff --git a/plugin-playground/src/main/kotlin/KondoKit/views/XPTrackerView.kt b/plugin-playground/src/main/kotlin/KondoKit/views/XPTrackerView.kt index 7685b60..38c9a33 100644 --- a/plugin-playground/src/main/kotlin/KondoKit/views/XPTrackerView.kt +++ b/plugin-playground/src/main/kotlin/KondoKit/views/XPTrackerView.kt @@ -163,7 +163,8 @@ object XPTrackerView : View, OnUpdateCallback, OnXPUpdateCallback { xpWidget = createXPWidget(skillId, previousXpSnapshot) xpWidgets[skillId] = xpWidget - val wrapped = wrappedWidget(xpWidget.container) + // Create new widget + val wrapped = wrappedWidget(xpWidget.container, padding = 0, innerPadding = 6) val popupMenu = removeXPWidgetMenu(wrapped, skillId) wrapped.attachPopupMenu(popupMenu, includeChildren = true) @@ -383,7 +384,7 @@ object XPTrackerView : View, OnUpdateCallback, OnXPUpdateCallback { fun createXPWidget(skillId: Int, previousXp: Int): XPWidget { val widgetPanel = WidgetPanel( widgetWidth = ViewConstants.DEFAULT_WIDGET_SIZE.width, - widgetHeight = ViewConstants.DEFAULT_WIDGET_SIZE.height, + widgetHeight = 56, addDefaultPadding = false ) @@ -435,7 +436,7 @@ object XPTrackerView : View, OnUpdateCallback, OnXPUpdateCallback { ) } - fun wrappedWidget(component: Component, padding: Int = 7): Container { + fun wrappedWidget(component: Component, padding: Int = 7, innerPadding: Int = 0): Container { val outerPanelSize = Dimension( component.preferredSize.width + 2 * padding, component.preferredSize.height + 2 * padding @@ -447,6 +448,9 @@ object XPTrackerView : View, OnUpdateCallback, OnXPUpdateCallback { val innerPanel = JPanel(BorderLayout()).apply { background = WIDGET_COLOR setFixedSize(component.preferredSize) + if (innerPadding > 0) { + border = BorderFactory.createEmptyBorder(innerPadding, innerPadding, innerPadding, innerPadding) + } add(component, BorderLayout.CENTER) } val gbc = GridBagConstraints().apply {