feat: font support
This commit is contained in:
parent
83aa75a89d
commit
e511bdac98
3 changed files with 24 additions and 14 deletions
|
@ -6,7 +6,7 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.unit.dp
|
||||
import xyz.atnrch.wrench.colors.WrenchColors
|
||||
import xyz.atnrch.wrench.ui.UIColors
|
||||
import xyz.atnrch.wrench.watcher.Watcher
|
||||
|
||||
@Composable
|
||||
|
@ -19,7 +19,7 @@ fun BottomAppBar(
|
|||
cutoutShape = MaterialTheme.shapes.small.copy(
|
||||
CornerSize(percent = 50)
|
||||
),
|
||||
backgroundColor = WrenchColors.PRIMARY,
|
||||
backgroundColor = UIColors.PRIMARY,
|
||||
modifier = Modifier.shadow(20.dp, MaterialTheme.shapes.small, true)
|
||||
) { BottomRow(watcher, state, onStateChange) }
|
||||
}
|
|
@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.size
|
|||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.material.*
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.filled.Build
|
||||
import androidx.compose.material.icons.filled.Settings
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
|
@ -12,23 +13,36 @@ import androidx.compose.ui.draw.shadow
|
|||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.RectangleShape
|
||||
import androidx.compose.ui.unit.dp
|
||||
import xyz.atnrch.wrench.colors.WrenchColors
|
||||
import xyz.atnrch.wrench.logger.Logger
|
||||
import xyz.atnrch.wrench.ui.Fonts
|
||||
import xyz.atnrch.wrench.ui.UIColors
|
||||
|
||||
@Composable
|
||||
fun TopBar() {
|
||||
TopAppBar(
|
||||
backgroundColor = WrenchColors.PRIMARY,
|
||||
backgroundColor = UIColors.PRIMARY,
|
||||
contentColor = Color.White,
|
||||
elevation = 16.dp,
|
||||
title = { Text("Wrench") },
|
||||
title = {
|
||||
Icon(
|
||||
Icons.Filled.Build,
|
||||
tint = Color.White,
|
||||
contentDescription = "Debug Settings",
|
||||
modifier = Modifier.size(18.dp)
|
||||
)
|
||||
Spacer(Modifier.width(5.dp))
|
||||
Text(
|
||||
text = "Wrench",
|
||||
fontFamily = Fonts.JOST_MEDIUM
|
||||
)
|
||||
},
|
||||
actions = {
|
||||
//.............
|
||||
// Debug Button
|
||||
//.............
|
||||
Button(
|
||||
{ Logger.debug("Empty.") },
|
||||
colors = ButtonDefaults.buttonColors(WrenchColors.STRESS, Color.White),
|
||||
colors = ButtonDefaults.buttonColors(UIColors.STRESS, Color.White),
|
||||
shape = RectangleShape,
|
||||
modifier = Modifier.shadow(20.dp, RectangleShape, true)
|
||||
) {
|
||||
|
|
|
@ -11,6 +11,7 @@ import androidx.compose.ui.unit.ExperimentalUnitApi
|
|||
import androidx.compose.ui.unit.TextUnit
|
||||
import androidx.compose.ui.unit.TextUnitType
|
||||
import xyz.atnrch.wrench.components.dialog.EntryDialog
|
||||
import xyz.atnrch.wrench.ui.Fonts
|
||||
import xyz.atnrch.wrench.watcher.WatcherEntry
|
||||
|
||||
@OptIn(ExperimentalUnitApi::class)
|
||||
|
@ -22,7 +23,8 @@ fun WatcherTextEntry(entry: WatcherEntry) {
|
|||
text = "${entry.file.absolutePath}",
|
||||
style = TextStyle(
|
||||
color = Color.Black,
|
||||
fontSize = TextUnit(15F, TextUnitType.Sp)
|
||||
fontSize = TextUnit(15F, TextUnitType.Sp),
|
||||
fontFamily = Fonts.JOST_LIGHT_ITALIC
|
||||
),
|
||||
modifier = Modifier.clickable {
|
||||
dialogState = true
|
||||
|
@ -30,12 +32,6 @@ fun WatcherTextEntry(entry: WatcherEntry) {
|
|||
)
|
||||
|
||||
if (dialogState) {
|
||||
EntryDialog(
|
||||
onCancelClick = {
|
||||
dialogState = false
|
||||
println("clicked cancel")
|
||||
},
|
||||
onStateChange = { dialogState = it }
|
||||
)
|
||||
EntryDialog(onStateChange = { dialogState = it })
|
||||
}
|
||||
}
|
Reference in a new issue