feat: remove dialog
This commit is contained in:
parent
b8296450db
commit
00a2f3946e
1 changed files with 4 additions and 17 deletions
|
@ -4,7 +4,7 @@ import androidx.compose.foundation.ExperimentalFoundationApi
|
||||||
import androidx.compose.foundation.PointerMatcher
|
import androidx.compose.foundation.PointerMatcher
|
||||||
import androidx.compose.foundation.onClick
|
import androidx.compose.foundation.onClick
|
||||||
import androidx.compose.material.Text
|
import androidx.compose.material.Text
|
||||||
import androidx.compose.runtime.*
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.input.pointer.PointerButton
|
import androidx.compose.ui.input.pointer.PointerButton
|
||||||
|
@ -12,10 +12,9 @@ import androidx.compose.ui.text.TextStyle
|
||||||
import androidx.compose.ui.unit.ExperimentalUnitApi
|
import androidx.compose.ui.unit.ExperimentalUnitApi
|
||||||
import androidx.compose.ui.unit.TextUnit
|
import androidx.compose.ui.unit.TextUnit
|
||||||
import androidx.compose.ui.unit.TextUnitType
|
import androidx.compose.ui.unit.TextUnitType
|
||||||
import xyz.atnrch.wrench.gui.filemanager.center.dialog.EntryDialog
|
|
||||||
import xyz.atnrch.wrench.registery.ACTIVE_COMPOSABLE
|
|
||||||
import xyz.atnrch.wrench.gui.style.Fonts
|
import xyz.atnrch.wrench.gui.style.Fonts
|
||||||
import xyz.atnrch.wrench.gui.style.UIColors
|
import xyz.atnrch.wrench.gui.style.UIColors
|
||||||
|
import xyz.atnrch.wrench.registery.ACTIVE_COMPOSABLE
|
||||||
import xyz.atnrch.wrench.watcher.WatcherEntry
|
import xyz.atnrch.wrench.watcher.WatcherEntry
|
||||||
|
|
||||||
@OptIn(ExperimentalUnitApi::class, ExperimentalFoundationApi::class)
|
@OptIn(ExperimentalUnitApi::class, ExperimentalFoundationApi::class)
|
||||||
|
@ -25,14 +24,12 @@ fun InputTextEntry(
|
||||||
entry: WatcherEntry,
|
entry: WatcherEntry,
|
||||||
onEntrySelected: (id: Int) -> Unit
|
onEntrySelected: (id: Int) -> Unit
|
||||||
) {
|
) {
|
||||||
var dialogState by remember { mutableStateOf(false) }
|
|
||||||
|
|
||||||
Text(
|
Text(
|
||||||
text = entry.file.absolutePath,
|
text = entry.file.absolutePath,
|
||||||
style = TextStyle(
|
style = TextStyle(
|
||||||
color = if(ACTIVE_COMPOSABLE == id) UIColors.GREEN else Color.White,
|
color = if (ACTIVE_COMPOSABLE == id) UIColors.GREEN else Color.White,
|
||||||
fontSize = TextUnit(17F, TextUnitType.Sp),
|
fontSize = TextUnit(17F, TextUnitType.Sp),
|
||||||
fontFamily = if(ACTIVE_COMPOSABLE == id) Fonts.ROBOTO_BOLD else Fonts.ROBOTO_REGULAR
|
fontFamily = if (ACTIVE_COMPOSABLE == id) Fonts.ROBOTO_BOLD else Fonts.ROBOTO_REGULAR
|
||||||
),
|
),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.onClick(
|
.onClick(
|
||||||
|
@ -42,15 +39,5 @@ fun InputTextEntry(
|
||||||
onEntrySelected.invoke(id)
|
onEntrySelected.invoke(id)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.onClick(
|
|
||||||
matcher = PointerMatcher.mouse(PointerButton.Secondary),
|
|
||||||
onClick = {
|
|
||||||
dialogState = true
|
|
||||||
}
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if (dialogState) {
|
|
||||||
EntryDialog(onStateChange = { dialogState = it })
|
|
||||||
}
|
|
||||||
}
|
}
|
Reference in a new issue