@@ -64,19 +64,13 @@ private fun DefaultTabShowcase() {
64
64
content = { tabState ->
65
65
val iconProvider = rememberResourcePainterProvider(AllIconsKeys .Actions .Find )
66
66
val icon by iconProvider.getPainter(Stateful (tabState))
67
- SimpleTabContent (
68
- label = " Default Tab $id " ,
69
- state = tabState,
70
- icon = icon,
71
- )
67
+ SimpleTabContent (label = " Default Tab $id " , state = tabState, icon = icon)
72
68
},
73
69
onClose = {
74
70
tabIds = tabIds.toMutableList().apply { removeAt(index) }
75
71
if (selectedTabIndex >= index) {
76
72
val maxPossibleIndex = max(0 , tabIds.lastIndex)
77
- selectedTabIndex =
78
- (selectedTabIndex - 1 )
79
- .coerceIn(0 .. maxPossibleIndex)
73
+ selectedTabIndex = (selectedTabIndex - 1 ).coerceIn(0 .. maxPossibleIndex)
80
74
}
81
75
},
82
76
onClick = { selectedTabIndex = index },
@@ -88,10 +82,7 @@ private fun DefaultTabShowcase() {
88
82
val insertionIndex = (selectedTabIndex + 1 ).coerceIn(0 .. tabIds.size)
89
83
val nextTabId = maxId + 1
90
84
91
- tabIds =
92
- tabIds
93
- .toMutableList()
94
- .apply { add(insertionIndex, nextTabId) }
85
+ tabIds = tabIds.toMutableList().apply { add(insertionIndex, nextTabId) }
95
86
selectedTabIndex = insertionIndex
96
87
}
97
88
}
@@ -125,24 +116,20 @@ private fun EditorTabShowcase() {
125
116
)
126
117
Box (
127
118
modifier =
128
- Modifier
129
- .size(12 .dp)
130
- .thenIf(tabState.isHovered) {
131
- drawWithCache {
132
- onDrawBehind {
133
- drawCircle(color = Color .Magenta .copy(alpha = .4f ), radius = 6 .dp.toPx())
134
- }
119
+ Modifier .size(12 .dp).thenIf(tabState.isHovered) {
120
+ drawWithCache {
121
+ onDrawBehind {
122
+ drawCircle(color = Color .Magenta .copy(alpha = .4f ), radius = 6 .dp.toPx())
135
123
}
136
- },
124
+ }
125
+ },
137
126
)
138
127
},
139
128
onClose = {
140
129
tabIds = tabIds.toMutableList().apply { removeAt(index) }
141
130
if (selectedTabIndex >= index) {
142
131
val maxPossibleIndex = max(0 , tabIds.lastIndex)
143
- selectedTabIndex =
144
- (selectedTabIndex - 1 )
145
- .coerceIn(0 .. maxPossibleIndex)
132
+ selectedTabIndex = (selectedTabIndex - 1 ).coerceIn(0 .. maxPossibleIndex)
146
133
}
147
134
},
148
135
onClick = { selectedTabIndex = index },
@@ -154,10 +141,7 @@ private fun EditorTabShowcase() {
154
141
val insertionIndex = (selectedTabIndex + 1 ).coerceIn(0 .. tabIds.size)
155
142
val nextTabId = maxId + 1
156
143
157
- tabIds =
158
- tabIds
159
- .toMutableList()
160
- .apply { add(insertionIndex, nextTabId) }
144
+ tabIds = tabIds.toMutableList().apply { add(insertionIndex, nextTabId) }
161
145
selectedTabIndex = insertionIndex
162
146
}
163
147
}
@@ -171,15 +155,8 @@ private fun TabStripWithAddButton(
171
155
Row (verticalAlignment = Alignment .CenterVertically ) {
172
156
TabStrip (tabs, style, modifier = Modifier .weight(1f ))
173
157
174
- IconButton (
175
- onClick = onAddClick,
176
- modifier = Modifier .size(JewelTheme .defaultTabStyle.metrics.tabHeight),
177
- ) {
178
- Icon (
179
- resource = " expui/general/add.svg" ,
180
- contentDescription = " Add a tab" ,
181
- StandaloneSampleIcons ::class .java,
182
- )
158
+ IconButton (onClick = onAddClick, modifier = Modifier .size(JewelTheme .defaultTabStyle.metrics.tabHeight)) {
159
+ Icon (key = AllIconsKeys .General .Add , contentDescription = " Add a tab" )
183
160
}
184
161
}
185
162
}
0 commit comments