Skip to content

Commit

Permalink
Fix style
Browse files Browse the repository at this point in the history
  • Loading branch information
romainguy committed May 6, 2024
1 parent 1a4b8bc commit dae4a28
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ import javax.swing.SwingUtilities

private const val FontSizeEditingMode = 12.0f
private const val FontSizePresentationMode = 20.0f
private const val LINE_NUMBER_WIDTH = 4
private const val CODE_INDENT = 4
private const val LineNumberWidth = 4
private const val CodeIndent = 4

@Composable
private fun FrameWindowScope.KotlinExplorer(
Expand Down Expand Up @@ -261,7 +261,7 @@ private fun codeTextArea(
hasLineNumbers: Boolean = true
): CodeTextArea {
val linNumberMode = (hasLineNumbers && state.showLineNumbers).toLineNumberMode()
return CodeTextArea(state.presentationMode, CODE_INDENT, linNumberMode).apply {
return CodeTextArea(state.presentationMode, CodeIndent, linNumberMode).apply {
configureSyntaxTextArea(SyntaxConstants.SYNTAX_STYLE_NONE)
addFocusListener(focusTracker)
}
Expand Down Expand Up @@ -348,7 +348,7 @@ private fun RSyntaxTextArea.updateStyle(explorerState: ExplorerState) {
font = font.deriveFont(if (presentation) FontSizePresentationMode else FontSizeEditingMode)
}

private fun Boolean.toLineNumberMode() = if (this) FixedWidth(LINE_NUMBER_WIDTH) else None
private fun Boolean.toLineNumberMode() = if (this) FixedWidth(LineNumberWidth) else None

fun main() = application {
val explorerState = remember { ExplorerState() }
Expand Down
2 changes: 1 addition & 1 deletion src/jvmMain/kotlin/dev/romainguy/kotlin/explorer/State.kt
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class ExplorerState {
var toolPaths by mutableStateOf(createToolPaths())
var optimize by BooleanState(Optimize, true)
var presentationMode by BooleanState(Presentation, false)
var showLineNumbers by BooleanState(ShowLineNumbers, true)
var showLineNumbers by BooleanState(ShowLineNumbers, false)
var showDex by BooleanState(ShowDex, true)
var showOat by BooleanState(ShowOat, true)
var sourceCode: String = readSourceCode(toolPaths)
Expand Down

0 comments on commit dae4a28

Please sign in to comment.