Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ fun DesktopApp(
Box(
modifier = Modifier
.height(60.dp)
.width(16.dp)
.width(24.dp)
.align(alignment = Alignment.CenterStart)
.clip(RoundedCornerShape(100))
.clickable(onClick = globalShellViewModel::toggleSideMenu)
Expand Down
4 changes: 2 additions & 2 deletions application/composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ android {
applicationId = "io.writeopia"
minSdk = libs.versions.minSdk.get().toInt()
targetSdk = libs.versions.targetSdk.get().toInt()
versionCode = 43
versionName = "0.30.0"
versionCode = 46
versionName = "0.33.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.geometry.Offset
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.unit.dp

val LocalDragSelectionInfo = compositionLocalOf { DragSelectionInfo() }
Expand All @@ -28,6 +29,7 @@ fun DragSelectionBox(modifier: Modifier = Modifier, context: @Composable BoxScop
var initialPosition by remember { mutableStateOf(Offset.Zero) }
var finalPosition by remember { mutableStateOf(Offset.Zero) }
var state by remember { mutableStateOf(DragSelectionInfo(isDragging = false)) }
val density = LocalDensity.current

CompositionLocalProvider(LocalDragSelectionInfo provides state) {
Box(
Expand Down Expand Up @@ -76,8 +78,14 @@ fun DragSelectionBox(modifier: Modifier = Modifier, context: @Composable BoxScop
)

Box(
modifier = Modifier.offset(x = x.dp, y = y.dp)
.size(width = width.dp, height = height.dp)
modifier = Modifier.offset(
x = density.run { x.toDp() },
y = density.run { y.toDp() }
)
.size(
width = density.run { width.toDp() },
height = density.run { height.toDp() }
)
.border(width = 1.dp, color = dragBoxColor, shape = shape)
.background(
color = dragBoxColor.copy(alpha = 0.2F),
Expand Down