Skip to content

Commit

Permalink
1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
timthehehehahahoho committed Dec 26, 2022
1 parent 7c32bb9 commit 63ec98f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
13 changes: 11 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import org.jetbrains.compose.compose
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("multiplatform")
Expand All @@ -25,7 +26,7 @@ kotlin {
sourceSets {
val jvmMain by getting {
dependencies {
implementation(compose.desktop.windows_x64)
implementation(compose.desktop.currentOs)
implementation("org.jetbrains.compose.ui:ui-graphics-desktop:1.1.0")
implementation("org.jetbrains.compose.ui:ui-geometry-desktop:1.1.0")
implementation("org.jetbrains.compose.foundation:foundation-desktop:1.1.0")
Expand All @@ -36,13 +37,21 @@ kotlin {
}
}

tasks.withType<KotlinCompile>().configureEach {
kotlinOptions.freeCompilerArgs += "-opt-in=RequiresOptIn"
}

compose.desktop {
application {
mainClass = "MainKt"
nativeDistributions {
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb)
targetFormats(TargetFormat.Exe)
packageName = "pomodoro"
packageVersion = "1.0.0"

windows {
iconFile.set(File("icon.ico"))
}
}
}
}
Binary file added icon.ico
Binary file not shown.
10 changes: 6 additions & 4 deletions src/jvmMain/kotlin/Main.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
@file:OptIn(ExperimentalComposeUiApi::class)

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
Expand All @@ -17,11 +19,10 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.Modifier
import androidx.compose.ui.input.key.Key
import androidx.compose.ui.input.key.Key.Companion.Enter
import androidx.compose.ui.input.key.KeyEventType
import androidx.compose.ui.input.key.isAltPressed
import androidx.compose.ui.input.key.isCtrlPressed
import androidx.compose.ui.input.key.isMetaPressed
import androidx.compose.ui.input.key.isShiftPressed
import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.type
Expand All @@ -44,7 +45,6 @@ import shared.domain.Navigation
import tasks.presentation.TaskListScreen
import tasks.presentation.TaskListViewModel

@OptIn(ExperimentalComposeUiApi::class)
fun main() = application {
val state = remember { MainState() }
val mainViewModel = state.mainViewModel
Expand Down Expand Up @@ -72,7 +72,7 @@ fun main() = application {
shiftPressed = event.isShiftPressed,
altPressed = event.isAltPressed,
ctrlPressed = event.isCtrlPressed,
enterPressed = event.key == Key.Enter && event.type == KeyEventType.KeyDown
enterPressed = event.key == Enter && event.type == KeyEventType.KeyDown
)
if (combo.anyControlKeyPressed) {
mainViewModel.obtainKeyComboKey(combo)
Expand Down Expand Up @@ -103,6 +103,8 @@ fun main() = application {
)
}
}
} else {
exitApplication()
}
}

Expand Down

0 comments on commit 63ec98f

Please sign in to comment.