Skip to content

Commit 0afa359

Browse files
small ui fixes
1 parent 6aeec90 commit 0afa359

4 files changed

Lines changed: 105 additions & 14 deletions

File tree

writeopia_ui/config/ktlint/baseline.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,10 @@
607607
<error line="150" column="13" source="standard:backing-property-naming" />
608608
<error line="150" column="13" source="standard:backing-property-naming" />
609609
</file>
610+
<file name="src/commonMain/kotlin/io/writeopia/ui/icons/all/spotlight.kt">
611+
<error line="79" column="13" source="standard:backing-property-naming" />
612+
<error line="81" column="1" source="standard:no-consecutive-blank-lines" />
613+
</file>
610614
<file name="src/commonMain/kotlin/io/writeopia/ui/icons/all/text-select.kt">
611615
<error line="162" column="13" source="standard:backing-property-naming" />
612616
</file>

writeopia_ui/src/commonMain/kotlin/io/writeopia/ui/components/EditionScreen.kt

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ fun EditionScreen(
193193
.clickable(onClick = onHighlight)
194194
.size(iconSize)
195195
.padding(iconPadding),
196-
imageVector = WrSdkIcons.highlight,
196+
imageVector = WrSdkIcons.spotlightIcon,
197197
contentDescription = "Highlight",
198198
tint = tint
199199
)
@@ -223,6 +223,19 @@ fun EditionScreen(
223223

224224
Spacer(modifier = Modifier.width(spaceWidth))
225225

226+
Icon(
227+
modifier = Modifier
228+
.clip(clipShape)
229+
.clickable(onClick = onAddPage)
230+
.size(iconSize)
231+
.padding(iconPadding),
232+
imageVector = WrSdkIcons.linkPage,
233+
contentDescription = "Link to page",
234+
tint = tint
235+
)
236+
237+
Spacer(modifier = Modifier.width(spaceWidth))
238+
226239
Icon(
227240
modifier = Modifier
228241
.clip(clipShape)
@@ -261,18 +274,7 @@ fun EditionScreen(
261274
tint = tint
262275
)
263276

264-
Spacer(modifier = Modifier.width(spaceWidth))
265-
266-
Icon(
267-
modifier = Modifier
268-
.clip(clipShape)
269-
.clickable(onClick = onAddPage)
270-
.size(iconSize)
271-
.padding(iconPadding),
272-
imageVector = WrSdkIcons.linkPage,
273-
contentDescription = "Link to page",
274-
tint = tint
275-
)
277+
Spacer(modifier = Modifier.width(20.dp))
276278
}
277279

278280
Icon(
@@ -325,7 +327,9 @@ private fun TitleChanges(
325327
verticalAlignment = Alignment.CenterVertically
326328
) {
327329
val textAlign = TextAlign.Center
328-
val textStyle = MaterialTheme.typography.bodyMedium
330+
val textStyle = MaterialTheme.typography.bodyMedium.copy(
331+
color = MaterialTheme.colorScheme.onPrimary
332+
)
329333
val fontWeight = FontWeight.Bold
330334
val padding = PaddingValues(vertical = 10.dp)
331335

writeopia_ui/src/commonMain/kotlin/io/writeopia/ui/icons/WrSdkIcons.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import io.writeopia.ui.icons.all.SquareCheck
1313
import io.writeopia.ui.icons.all.WandSparkles
1414
import io.writeopia.ui.icons.all.aLargeSmall
1515
import io.writeopia.ui.icons.all.pencil
16+
import io.writeopia.ui.icons.all.spotlight
1617
import io.writeopia.ui.icons.all.textSelect
1718

1819
object WrSdkIcons {
@@ -42,4 +43,6 @@ object WrSdkIcons {
4243
val highlight = textSelect
4344

4445
val titleChange = aLargeSmall
46+
47+
val spotlightIcon = spotlight
4548
}
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
package io.writeopia.ui.icons.all
2+
3+
import androidx.compose.ui.graphics.Color
4+
import androidx.compose.ui.graphics.SolidColor
5+
import androidx.compose.ui.graphics.StrokeCap
6+
import androidx.compose.ui.graphics.StrokeJoin
7+
import androidx.compose.ui.graphics.vector.ImageVector
8+
import androidx.compose.ui.graphics.vector.path
9+
import androidx.compose.ui.unit.dp
10+
11+
internal val spotlight: ImageVector
12+
get() {
13+
if (_spotlight != null) return _spotlight!!
14+
15+
_spotlight = ImageVector.Builder(
16+
name = "spotlight",
17+
defaultWidth = 24.dp,
18+
defaultHeight = 24.dp,
19+
viewportWidth = 24f,
20+
viewportHeight = 24f
21+
).apply {
22+
path(
23+
stroke = SolidColor(Color.Black),
24+
strokeLineWidth = 2f,
25+
strokeLineCap = StrokeCap.Round,
26+
strokeLineJoin = StrokeJoin.Round
27+
) {
28+
moveTo(15.295f, 19.562f)
29+
lineTo(16f, 22f)
30+
}
31+
path(
32+
stroke = SolidColor(Color.Black),
33+
strokeLineWidth = 2f,
34+
strokeLineCap = StrokeCap.Round,
35+
strokeLineJoin = StrokeJoin.Round
36+
) {
37+
moveToRelative(17f, 16f)
38+
lineToRelative(3.758f, 2.098f)
39+
}
40+
path(
41+
stroke = SolidColor(Color.Black),
42+
strokeLineWidth = 2f,
43+
strokeLineCap = StrokeCap.Round,
44+
strokeLineJoin = StrokeJoin.Round
45+
) {
46+
moveToRelative(19f, 12.5f)
47+
lineToRelative(3.026f, -0.598f)
48+
}
49+
path(
50+
stroke = SolidColor(Color.Black),
51+
strokeLineWidth = 2f,
52+
strokeLineCap = StrokeCap.Round,
53+
strokeLineJoin = StrokeJoin.Round
54+
) {
55+
moveTo(7.61f, 6.3f)
56+
arcToRelative(3f, 3f, 0f, false, false, -3.92f, 1.3f)
57+
lineToRelative(-1.38f, 2.79f)
58+
arcToRelative(3f, 3f, 0f, false, false, 1.3f, 3.91f)
59+
lineToRelative(6.89f, 3.597f)
60+
arcToRelative(1f, 1f, 0f, false, false, 1.342f, -0.447f)
61+
lineToRelative(3.106f, -6.211f)
62+
arcToRelative(1f, 1f, 0f, false, false, -0.447f, -1.341f)
63+
close()
64+
}
65+
path(
66+
stroke = SolidColor(Color.Black),
67+
strokeLineWidth = 2f,
68+
strokeLineCap = StrokeCap.Round,
69+
strokeLineJoin = StrokeJoin.Round
70+
) {
71+
moveTo(8f, 9f)
72+
verticalLineTo(2f)
73+
}
74+
}.build()
75+
76+
return _spotlight!!
77+
}
78+
79+
private var _spotlight: ImageVector? = null
80+

0 commit comments

Comments
 (0)