@@ -130,8 +130,7 @@ object StyleEditor {
130130 sameLine()
131131 if (button(" Revert Ref" )) g.style = ref!!
132132 sameLine()
133- helpMarker(
134- " Save/Revert in local non-persistent storage. Default Colors definition are not affected. " + " Use \" Export\" below to save them somewhere." )
133+ helpMarker(" Save/Revert in local non-persistent storage. Default Colors definition are not affected. " + " Use \" Export\" below to save them somewhere." )
135134
136135 separator()
137136
@@ -166,7 +165,7 @@ object StyleEditor {
166165 slider(" GrabRounding" , style::grabRounding, 0f , 12f , " %.0f" )
167166 slider(" TabRounding" , style::tabRounding, 0f , 12f , " %.0f" )
168167
169- separatorText(" Alignment " )
168+ separatorText(" Widgets " )
170169 slider2(" WindowTitleAlign" , style.windowTitleAlign, 0f , 1f , " %.2f" )
171170 run {
172171 val sideRef = (style.windowMenuButtonPosition.i + 1 ).mutableReference
@@ -185,10 +184,9 @@ object StyleEditor {
185184 sameLine(); helpMarker(" Alignment applies when a button is larger than its text content." )
186185 slider2(" SelectableTextAlign" , style.selectableTextAlign, 0f , 1f , " %.2f" )
187186 sameLine(); helpMarker(" Alignment applies when a selectable is larger than its text content." )
188-
189187 slider(" SeparatorTextBorderSize" , style::separatorTextBorderSize, 0f , 10f , " %.0f" )
190188 slider2(" SeparatorTextAlign" , style.separatorTextAlign, 0f , 1f , " %.2f" )
191- slider2(" SeparatorTextPadding" , style.separatorTextPadding, 0f , 40f , " %0.f " )
189+ slider2(" SeparatorTextPadding" , style.separatorTextPadding, 0f , 40f , " %.0f " )
192190 slider(" LogSliderDeadzone" , style::logSliderDeadzone, 0f , 12f , " %.0f" )
193191
194192 separatorText(" Misc" )
@@ -205,9 +203,8 @@ object StyleEditor {
205203 for (i in Col .values()) {
206204 val col = style.colors[i]
207205 val name = i.name
208- if (! outputOnlyModified || col != ref!! .colors[i]) logText(
209- " colors[Col_$name ]%s = Vec4(%.2f, %.2f, %.2f, %.2f)\n " , " " .repeat(23 - name.length), col.x,
210- col.y, col.z, col.w)
206+ if (! outputOnlyModified || col != ref!! .colors[i])
207+ logText(" colors[Col_$name ]%s = Vec4(%.2f, %.2f, %.2f, %.2f)\n " , " " .repeat(23 - name.length), col.x, col.y, col.z, col.w)
211208 }
212209 logFinish()
213210 }
@@ -222,19 +219,13 @@ object StyleEditor {
222219
223220 radioButton(" Opaque" , alphaFlags.isEmpty) { alphaFlags = none }; sameLine()
224221 radioButton(" Alpha" , alphaFlags == Cef .AlphaPreview ) { alphaFlags = Cef .AlphaPreview }; sameLine()
225- radioButton(" Both" , alphaFlags == Cef .AlphaPreviewHalf ) {
226- alphaFlags = Cef .AlphaPreviewHalf
227- }; sameLine()
222+ radioButton(" Both" , alphaFlags == Cef .AlphaPreviewHalf ) { alphaFlags = Cef .AlphaPreviewHalf }; sameLine()
228223 helpMarker("""
229224 In the color list:
230225 Left-click on color square to open color picker,
231- Right-click to open edit options menu.""" .trimIndent()
232- )
226+ Right-click to open edit options menu.""" .trimIndent())
233227
234- child(
235- " #colors" , Vec2 (), true ,
236- Wf .AlwaysVerticalScrollbar or Wf .AlwaysHorizontalScrollbar or Wf ._NavFlattened
237- ) {
228+ child(" #colors" , Vec2 (), true , Wf .AlwaysVerticalScrollbar or Wf .AlwaysHorizontalScrollbar or Wf ._NavFlattened ) {
238229 withItemWidth(- 160 ) {
239230 for (i in 0 until Col .COUNT ) {
240231 val name = Col .values()[i].name
@@ -314,7 +305,7 @@ object StyleEditor {
314305 val segmentCount = drawList._calcCircleAutoSegmentCount (rad)
315306
316307 group {
317- text(" R: %.f \n N: ${drawList._calcCircleAutoSegmentCount (rad)} " , rad)
308+ text(" R: %.0f \n N: ${drawList._calcCircleAutoSegmentCount (rad)} " , rad)
318309
319310 val canvasWidth = minWidgetWidth max (rad * 2f )
320311 val offsetX = floor(canvasWidth * 0.5f )
@@ -350,9 +341,7 @@ object StyleEditor {
350341
351342 fun debugNodeFont (font : Font ) {
352343 val name = font.configData.getOrNull(0 )?.name ? : " "
353- val fontDetailsOpened = treeNode(font,
354- " Font \\\" $name \\\"\\ n%.2f px, %.2f px, ${font.glyphs.size} glyphs, ${font.configDataCount} file(s)" ,
355- font.fontSize)
344+ val fontDetailsOpened = treeNode(font, " Font \\\" $name \\\"\\ n%.2f px ${font.glyphs.size} glyphs, ${font.configDataCount} file(s)" , font.fontSize)
356345 sameLine(); smallButton(" Set as default" ) { io.fontDefault = font }
357346 if (! fontDetailsOpened)
358347 return
@@ -374,15 +363,13 @@ object StyleEditor {
374363 |(Glimmer of hope: the atlas system should hopefully be rewritten in the future to make scaling more natural and automatic.)""" .trimMargin())
375364 text(" Ascent: ${font.ascent} , Descent: ${font.descent} , Height: ${font.ascent - font.descent} " )
376365 val cStr = ByteArray (5 )
377- text(" Fallback character: '${textCharToUtf8(cStr, font.fallbackChar.code )} ' (U+%04X)" , font.fallbackChar)
378- text(" Ellipsis character: '${textCharToUtf8(cStr, font.ellipsisChar.code )} ' (U+%04X)" , font.ellipsisChar)
366+ text(" Fallback character: '${textCharToUtf8(cStr, font.fallbackChar)} ' (U+%04X)" , font.fallbackChar.code )
367+ text(" Ellipsis character: '${textCharToUtf8(cStr, font.ellipsisChar)} ' (U+%04X)" , font.ellipsisChar.code )
379368 val side = sqrt(font.metricsTotalSurface.f).i
380369 text(" Texture Area: about ${font.metricsTotalSurface} px ~${side} x$side px" )
381370 for (c in 0 until font.configDataCount)
382371 font.configData.getOrNull(c)?.let {
383- bulletText(
384- " Input $c : '${it.name} ', Oversample: ${it.oversample} , PixelSnapH: ${it.pixelSnapH} , Offset: (%.1f,%.1f)" ,
385- it.glyphOffset.x, it.glyphOffset.y)
372+ bulletText(" Input $c : '${it.name} ', Oversample: ${it.oversample} , PixelSnapH: ${it.pixelSnapH} , Offset: (%.1f,%.1f)" , it.glyphOffset.x, it.glyphOffset.y)
386373 }
387374
388375 // Display all glyphs of the fonts in separate pages of 256 characters
@@ -409,7 +396,7 @@ object StyleEditor {
409396 val drawList = windowDrawList
410397 for (n in 0 until 256 ) {
411398 val cellP1 = Vec2 (basePos.x + (n % 16 ) * (cellSize + cellSpacing),
412- basePos.y + (n / 16 ) * (cellSize + cellSpacing))
399+ basePos.y + (n / 16 ) * (cellSize + cellSpacing))
413400 val cellP2 = Vec2 (cellP1.x + cellSize, cellP1.y + cellSize)
414401 val glyph = font.findGlyphNoFallback((base + n).c)
415402 drawList.addRect(cellP1, cellP2, COL32 (255 , 255 , 255 , if (glyph != null ) 100 else 50 )) // We use ImFont::RenderChar as a shortcut because we don't have UTF-8 conversion functions
@@ -432,7 +419,7 @@ object StyleEditor {
432419 }
433420 base + = 256
434421 }
435- treePop()
436422 }
423+ treePop()
437424 }
438425}
0 commit comments