Skip to content

Commit

Permalink
- UI tweaks
Browse files Browse the repository at this point in the history
- roll back Feather icons, not ready for wasm target

Signed-off-by: samoylenkodmitry <samoylenkodmitry@gmail.com>
  • Loading branch information
samoylenkodmitry committed May 30, 2024
1 parent bb1019b commit 604822d
Show file tree
Hide file tree
Showing 5 changed files with 211 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ kotlin {
implementation(compose.components.resources)
implementation(compose.components.uiToolingPreview)
implementation(projects.shared)
implementation(libs.composeIcons.feather)
// todo implementation(libs.composeIcons.feather)
implementation(libs.lifecycle.viewmodel.compose)
implementation(libs.ktor.client.core)
implementation(libs.ktor.client.json)
Expand Down
10 changes: 3 additions & 7 deletions composeApp/src/commonMain/kotlin/ComposeApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@ import androidx.compose.ui.text.style.TextDecoration
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.lifecycle.ViewModel
import compose.icons.FeatherIcons
import compose.icons.feathericons.Clipboard
import compose.icons.feathericons.Delete
import compose.icons.feathericons.UserMinus
import kotlinx.coroutines.*
import kotlinx.datetime.Instant
import kotlinx.datetime.TimeZone
Expand Down Expand Up @@ -280,7 +276,7 @@ private fun ColumnScope.ResultNewUrlCard(
private fun ButtonDelete(onClick: () -> Unit) {
IconButton(onClick = onClick) {
Icon(
FeatherIcons.Delete,
Theme.Icons.Delete,
contentDescription = "Delete",
modifier = Modifier.size(16.dp),
)
Expand All @@ -293,7 +289,7 @@ private fun ButtonCopyToClipboard(textToCopy: String) {
IconButton(onClick = {
clipboardManager.setText(buildAnnotatedString { append(textToCopy) })
}) {
Icon(FeatherIcons.Clipboard, contentDescription = "Copy")
Icon(Theme.Icons.Clipboard, contentDescription = "Copy")
}
}

Expand Down Expand Up @@ -326,7 +322,7 @@ private fun ButtonLogout(
}
}, modifier = modifier) {
Icon(
FeatherIcons.UserMinus,
Theme.Icons.UserMinus,
contentDescription = "Logout",
modifier =
Modifier.graphicsLayer {
Expand Down
204 changes: 204 additions & 0 deletions composeApp/src/commonMain/kotlin/Theme.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.PathFillType.Companion.NonZero
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.StrokeCap.Companion.Round
import androidx.compose.ui.graphics.StrokeJoin
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.ImageVector.Builder
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.unit.dp

object Theme {
object Icons {
public val Clipboard: ImageVector
get() {
if (clipboard != null) {
return clipboard!!
}
clipboard =
Builder(
name = "Clipboard",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f,
).apply {
path(
fill = SolidColor(Color(0x00000000)),
stroke = SolidColor(Color(0xFF000000)),
strokeLineWidth = 2.0f,
strokeLineCap = Round,
strokeLineJoin =
StrokeJoin.Companion.Round,
strokeLineMiter = 4.0f,
pathFillType = NonZero,
) {
moveTo(16.0f, 4.0f)
horizontalLineToRelative(2.0f)
arcToRelative(2.0f, 2.0f, 0.0f, false, true, 2.0f, 2.0f)
verticalLineToRelative(14.0f)
arcToRelative(2.0f, 2.0f, 0.0f, false, true, -2.0f, 2.0f)
horizontalLineTo(6.0f)
arcToRelative(2.0f, 2.0f, 0.0f, false, true, -2.0f, -2.0f)
verticalLineTo(6.0f)
arcToRelative(2.0f, 2.0f, 0.0f, false, true, 2.0f, -2.0f)
horizontalLineToRelative(2.0f)
}
path(
fill = SolidColor(Color(0x00000000)),
stroke = SolidColor(Color(0xFF000000)),
strokeLineWidth = 2.0f,
strokeLineCap = Round,
strokeLineJoin =
StrokeJoin.Companion.Round,
strokeLineMiter = 4.0f,
pathFillType = NonZero,
) {
moveTo(9.0f, 2.0f)
lineTo(15.0f, 2.0f)
arcTo(1.0f, 1.0f, 0.0f, false, true, 16.0f, 3.0f)
lineTo(16.0f, 5.0f)
arcTo(1.0f, 1.0f, 0.0f, false, true, 15.0f, 6.0f)
lineTo(9.0f, 6.0f)
arcTo(1.0f, 1.0f, 0.0f, false, true, 8.0f, 5.0f)
lineTo(8.0f, 3.0f)
arcTo(1.0f, 1.0f, 0.0f, false, true, 9.0f, 2.0f)
close()
}
}
.build()
return clipboard!!
}

private var clipboard: ImageVector? = null
public val UserMinus: ImageVector
get() {
if (userMinus != null) {
return userMinus!!
}
userMinus =
Builder(
name = "UserMinus",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f,
).apply {
path(
fill = SolidColor(Color(0x00000000)),
stroke = SolidColor(Color(0xFF000000)),
strokeLineWidth = 2.0f,
strokeLineCap = Round,
strokeLineJoin =
StrokeJoin.Companion.Round,
strokeLineMiter = 4.0f,
pathFillType = NonZero,
) {
moveTo(16.0f, 21.0f)
verticalLineToRelative(-2.0f)
arcToRelative(4.0f, 4.0f, 0.0f, false, false, -4.0f, -4.0f)
horizontalLineTo(5.0f)
arcToRelative(4.0f, 4.0f, 0.0f, false, false, -4.0f, 4.0f)
verticalLineToRelative(2.0f)
}
path(
fill = SolidColor(Color(0x00000000)),
stroke = SolidColor(Color(0xFF000000)),
strokeLineWidth = 2.0f,
strokeLineCap = Round,
strokeLineJoin =
StrokeJoin.Companion.Round,
strokeLineMiter = 4.0f,
pathFillType = NonZero,
) {
moveTo(8.5f, 7.0f)
moveToRelative(-4.0f, 0.0f)
arcToRelative(4.0f, 4.0f, 0.0f, true, true, 8.0f, 0.0f)
arcToRelative(4.0f, 4.0f, 0.0f, true, true, -8.0f, 0.0f)
}
path(
fill = SolidColor(Color(0x00000000)),
stroke = SolidColor(Color(0xFF000000)),
strokeLineWidth = 2.0f,
strokeLineCap = Round,
strokeLineJoin =
StrokeJoin.Companion.Round,
strokeLineMiter = 4.0f,
pathFillType = NonZero,
) {
moveTo(23.0f, 11.0f)
lineTo(17.0f, 11.0f)
}
}
.build()
return userMinus!!
}

private var userMinus: ImageVector? = null
public val Delete: ImageVector
get() {
if (delete != null) {
return delete!!
}
delete =
Builder(
name = "Delete",
defaultWidth = 24.0.dp,
defaultHeight = 24.0.dp,
viewportWidth = 24.0f,
viewportHeight = 24.0f,
).apply {
path(
fill = SolidColor(Color(0x00000000)),
stroke = SolidColor(Color(0xFF000000)),
strokeLineWidth = 2.0f,
strokeLineCap = Round,
strokeLineJoin =
StrokeJoin.Companion.Round,
strokeLineMiter = 4.0f,
pathFillType = NonZero,
) {
moveTo(21.0f, 4.0f)
horizontalLineTo(8.0f)
lineToRelative(-7.0f, 8.0f)
lineToRelative(7.0f, 8.0f)
horizontalLineToRelative(13.0f)
arcToRelative(2.0f, 2.0f, 0.0f, false, false, 2.0f, -2.0f)
verticalLineTo(6.0f)
arcToRelative(2.0f, 2.0f, 0.0f, false, false, -2.0f, -2.0f)
close()
}
path(
fill = SolidColor(Color(0x00000000)),
stroke = SolidColor(Color(0xFF000000)),
strokeLineWidth = 2.0f,
strokeLineCap = Round,
strokeLineJoin =
StrokeJoin.Companion.Round,
strokeLineMiter = 4.0f,
pathFillType = NonZero,
) {
moveTo(18.0f, 9.0f)
lineTo(12.0f, 15.0f)
}
path(
fill = SolidColor(Color(0x00000000)),
stroke = SolidColor(Color(0xFF000000)),
strokeLineWidth = 2.0f,
strokeLineCap = Round,
strokeLineJoin =
StrokeJoin.Companion.Round,
strokeLineMiter = 4.0f,
pathFillType = NonZero,
) {
moveTo(12.0f, 9.0f)
lineTo(18.0f, 15.0f)
}
}
.build()
return delete!!
}

private var delete: ImageVector? = null
}
}
2 changes: 1 addition & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash
# --- Configuration ---
RELEASE_TAG="v_0.0.1.00" # Update with desired release tag
RELEASE_TAG="v_0.0.1.01" # Update with desired release tag
# (https://github.com/samoylenkodmitry/shrtlin/releases)
FRONTEND_ARTIFACT_NAME="frontend-web.zip"
BACKEND_ARTIFACT_NAME="server-1.0.0.jar"
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ slf4j = "1.7.32"
kotlinx-date-time = "0.5.0"
okio = "3.9.0" # for sha256, todo consider lighter options
multiplatform-settings = "1.1.1" # APACHE-2.0 https://github.com/russhwolf/multiplatform-settings
composeIcons = "1.1.0" # MIT https://github.com/DevSrSouza/compose-icons
# todo support wasm composeIcons = "1.1.0" # MIT https://github.com/DevSrSouza/compose-icons

[libraries]
composeIcons-feather = { module = "br.com.devsrsouza.compose.icons:feather", version.ref = "composeIcons" }
# composeIcons-feather = { module = "br.com.devsrsouza.compose.icons:feather", version.ref = "composeIcons" }
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlinxCoroutinesCore" }
multiplatform-settings = { module = "com.russhwolf:multiplatform-settings", version.ref = "multiplatform-settings" }
multiplatform-settings-no-arg = { module = "com.russhwolf:multiplatform-settings-no-arg", version.ref = "multiplatform-settings" }
Expand Down

0 comments on commit 604822d

Please sign in to comment.