Skip to content

Commit dfc2d00

Browse files
leandroBorgesFerreiraLeandro Ferreira
andauthored
Always showing edit icon for equations when on mobile (#493)
Co-authored-by: Leandro Ferreira <[email protected]>
1 parent ea9ff83 commit dfc2d00

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ dagCommand {
2121
printModulesInfo = true
2222
}
2323

24-
extra["sdkVersion"] = "0.12.0"
24+
extra["sdkVersion"] = "0.12.1"

writeopia_ui/src/commonMain/kotlin/io/writeopia/ui/drawer/content/EquationDrawer.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import io.writeopia.ui.model.DrawConfig
4646
import io.writeopia.ui.model.DrawInfo
4747

4848
class EquationDrawer(
49+
private val showEditAlways: Boolean,
4950
private val equationToImageUrl: String,
5051
private val customBackgroundColor: Color,
5152
private val config: DrawConfig,
@@ -57,7 +58,7 @@ class EquationDrawer(
5758
private val moveRequest: (Action.Move) -> Unit,
5859
private val onSelected: (Boolean, Int) -> Unit,
5960
private val receiveExternalFile: (List<ExternalFile>, Int) -> Unit,
60-
private val onEditClick: (Int) -> Unit
61+
private val onEditClick: (Int) -> Unit,
6162
) : StoryStepDrawer {
6263

6364
@Composable
@@ -147,7 +148,7 @@ class EquationDrawer(
147148
Spacer(modifier = Modifier.width(6.dp))
148149

149150
Crossfade(
150-
targetState = isHovered,
151+
targetState = isHovered || showEditAlways,
151152
label = "iconCrossFade",
152153
animationSpec = tween(durationMillis = 200)
153154
) { show ->

writeopia_ui/src/commonMain/kotlin/io/writeopia/ui/drawer/factory/CommonDrawers.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ object CommonDrawers {
248248
val loadingDrawer = LoadingDrawer()
249249

250250
val equationsDrawer = EquationDrawer(
251+
showEditAlways = !isDesktop,
251252
equationToImageUrl = equationToImageUrl ?: "",
252253
customBackgroundColor = MaterialTheme.colorScheme.surfaceVariant,
253254
dragIconWidth = dragIconWidth,

0 commit comments

Comments
 (0)