diff --git a/.gitignore b/.gitignore index 17e475a..c710d64 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .gradle gradle/ build -.idea \ No newline at end of file +.idea +src/main/resources/font \ No newline at end of file diff --git a/src/main/kotlin/xyz/atnrch/wrench/components/WatcherTextEntry.kt b/src/main/kotlin/xyz/atnrch/wrench/components/WatcherTextEntry.kt new file mode 100644 index 0000000..6f30551 --- /dev/null +++ b/src/main/kotlin/xyz/atnrch/wrench/components/WatcherTextEntry.kt @@ -0,0 +1,60 @@ +package xyz.atnrch.wrench.components + +import androidx.compose.foundation.clickable +import androidx.compose.foundation.layout.* +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Card +import androidx.compose.material.Text +import androidx.compose.material.TextButton +import androidx.compose.runtime.* +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.unit.ExperimentalUnitApi +import androidx.compose.ui.unit.TextUnit +import androidx.compose.ui.unit.TextUnitType +import androidx.compose.ui.unit.dp +import androidx.compose.ui.window.Dialog +import xyz.atnrch.wrench.watcher.WatcherEntry + +@OptIn(ExperimentalUnitApi::class) +@Composable +fun WatcherTextEntry(entry: WatcherEntry) { + var dialogState by remember { mutableStateOf(false) } + + Text( + text = "${entry.file.absolutePath}", + style = TextStyle( + color = Color.Black, + fontSize = TextUnit(15F, TextUnitType.Sp) + ), + modifier = Modifier.clickable { + if (dialogState) { + Dialog( + onCloseRequest = { dialogState = false }, + resizable = false, + ) { + Card( + elevation = 8.dp, + shape = RoundedCornerShape(12.dp) + ) { + // Buttons + Row( + horizontalArrangement = Arrangement.End, + modifier = Modifier.fillMaxWidth() + ) { + + TextButton(onClick = {}) { + Text(text = "Cancel") + } + Spacer(modifier = Modifier.width(4.dp)) + TextButton(onClick = {}) { + Text(text = "OK") + } + } + } + } + } + } + ) +} \ No newline at end of file diff --git a/src/main/kotlin/xyz/atnrch/wrench/components/debug/DummyTextEntry.kt b/src/main/kotlin/xyz/atnrch/wrench/components/debug/DummyTextEntry.kt new file mode 100644 index 0000000..306d8d3 --- /dev/null +++ b/src/main/kotlin/xyz/atnrch/wrench/components/debug/DummyTextEntry.kt @@ -0,0 +1,2 @@ +package xyz.atnrch.wrench.components.debug + diff --git a/src/main/kotlin/xyz/atnrch/wrench/components/dialog/EntryDialog.kt b/src/main/kotlin/xyz/atnrch/wrench/components/dialog/EntryDialog.kt new file mode 100644 index 0000000..27584f1 --- /dev/null +++ b/src/main/kotlin/xyz/atnrch/wrench/components/dialog/EntryDialog.kt @@ -0,0 +1,2 @@ +package xyz.atnrch.wrench.components.dialog +