diff --git a/src/main/java/krasa/editorGroups/tabs2/impl/rounded/RoundedTabPainter.kt b/src/main/java/krasa/editorGroups/tabs2/impl/rounded/RoundedTabPainter.kt index 5657fbe..0dcdc08 100644 --- a/src/main/java/krasa/editorGroups/tabs2/impl/rounded/RoundedTabPainter.kt +++ b/src/main/java/krasa/editorGroups/tabs2/impl/rounded/RoundedTabPainter.kt @@ -4,16 +4,13 @@ import com.intellij.ui.ColorUtil import com.intellij.util.ui.JBInsets import krasa.editorGroups.tabs2.EditorGroupsTabsPosition import krasa.editorGroups.tabs2.impl.painter.EditorGroupsTabPainter -import krasa.editorGroups.tabs2.impl.themes.EditorGroupDefaultTabTheme +import krasa.editorGroups.tabs2.impl.themes.EditorGroupCustomTabTheme import krasa.editorGroups.tabs2.impl.themes.EditorGroupTabTheme -import java.awt.Color -import java.awt.Graphics2D -import java.awt.Point -import java.awt.Rectangle +import java.awt.* import java.awt.geom.RoundRectangle2D internal open class RoundedTabPainter : EditorGroupsTabPainter { - private val theme = EditorGroupDefaultTabTheme() + private val theme = EditorGroupCustomTabTheme() private val regularColors = theme.background to theme.background @@ -132,13 +129,14 @@ internal open class RoundedTabPainter : EditorGroupsTabPainter { if (fill != null) { // Paint rounded tab - g.color = fill + g.color = ColorUtil.withAlpha(fill, theme.roundTabOpacity.toDouble()) g.fill(shape) } if (draw != null) { // Paint rounded border g.color = draw + g.stroke = BasicStroke(theme.roundTabBorderWidth) g.draw(shape) } } diff --git a/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupCustomTabTheme.kt b/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupCustomTabTheme.kt index 7c52155..45956c8 100644 --- a/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupCustomTabTheme.kt +++ b/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupCustomTabTheme.kt @@ -72,4 +72,7 @@ open class EditorGroupCustomTabTheme : EditorGroupTabTheme { override val roundTabOpacity: Float get() = EditorGroupsUI.backgroundOpacity() + + override val roundTabBorderWidth: Float + get() = EditorGroupsUI.roundTabBorderWidth() } \ No newline at end of file diff --git a/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupDefaultTabTheme.kt b/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupDefaultTabTheme.kt index 2c42c56..cfdd18b 100644 --- a/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupDefaultTabTheme.kt +++ b/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupDefaultTabTheme.kt @@ -87,4 +87,7 @@ open class EditorGroupDefaultTabTheme : EditorGroupTabTheme { override val roundTabOpacity: Float get() = 0.9f + + override val roundTabBorderWidth: Float + get() = 1.0f } \ No newline at end of file diff --git a/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupTabTheme.kt b/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupTabTheme.kt index 84b9ec8..ce30f0f 100644 --- a/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupTabTheme.kt +++ b/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupTabTheme.kt @@ -55,4 +55,5 @@ interface EditorGroupTabTheme { // Islands val roundTabArc: Int val roundTabOpacity: Float? + val roundTabBorderWidth: Float? } \ No newline at end of file diff --git a/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupsUI.kt b/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupsUI.kt index c814c91..672daab 100644 --- a/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupsUI.kt +++ b/src/main/java/krasa/editorGroups/tabs2/impl/themes/EditorGroupsUI.kt @@ -107,6 +107,11 @@ object EditorGroupsUI { defaultTheme.roundTabOpacity ) + fun roundTabBorderWidth(): Float = JBUI.getFloat( + "EditorGroupsTabs.roundTabBorderWidth", + defaultTheme.roundTabBorderWidth + ) + fun font(): Font { val isCustomFont = EditorGroupsSettings.instance.isCustomFont val customFont = EditorGroupsSettings.instance.customFont