Compose for Desktop is modern toolkit for building native declarative UI made by JetBrains. It's based on Google's Jetpack Compose
Questions tagged [compose-desktop]
147 questions
3
votes
1 answer
Jetpack Compose : How to move up the floatingActionButton for snackbar?
I am trying to make the floating action button move up to make room for the Snackbar to appear, which is the
normal behavior when using android xml UI files.
It looks like its not implemented in Scafford.
Please find below my code so far on Compose…

u2gilles
- 6,888
- 7
- 51
- 75
3
votes
1 answer
Gradle can't resolve androidx.ui:ui-tooling dependency by google() repository
I want to use the @Preview annotation in my brand new Jetpack Compose for Desktop project. However gradle is just not getting it done to fetch the dependecy for that.
my build.gradle.kts:
import org.jetbrains.compose.compose
import…

xetra11
- 7,671
- 14
- 84
- 159
2
votes
0 answers
How to implement zooming with a mouse wheel in Jetpack Compose Desktop?
I have a desktop application in which i want to implement zooming and panning behaviour, like in this question, but without scrollbars. However, i don't know how to allow the user to wheel-zoom on an exact point. I'm using Kotlin Compose…

Andrew
- 21
- 2
2
votes
1 answer
Make Text Selectable using the Mouse
I want to make the Text selectable using the mouse similar to the TextField.
SelectionContainer {
Text(
text = "Some very long text which can be selected by Mouse Left Press and drag to the right.",
maxLines = 1,
textAlign =…

vovahost
- 34,185
- 17
- 113
- 116
2
votes
0 answers
Implementing drag and drop in Jetpack Compose - how to render dragged content at the cursor?
There's something I'm trying to get working in Jetpack Compose, specifically for the desktop version of my app.
I have drag and drop somewhat working inside the app, and I have a view of what's being dragged when you're inside the app. But the way…

Hakanai
- 12,010
- 10
- 62
- 132
2
votes
2 answers
Am I able to switch views using Kotlin Compose for Desktop Applications (and how)?
(After looking for an answer all of yesterday, I have decided to ask this question as I could not find it anywhere else.)
I have a small example app that I want to use in order to test the way that Compose works for Desktop Applications.
I have been…

BoydyBoydy
- 159
- 1
- 9
2
votes
1 answer
Drag Composable only inside given boundries with Jetpack Compose
so I have a black box (rectangle) inside another box (boundary) and the rectangle is set as draggable
But now I can drag the rectangle around the whole window, but I want that if the rectangle "leaves" the boundary it should disappear behind it.
Is…

c_phil
- 123
- 6
2
votes
0 answers
Dialog boxes cannot be tested in Jetpack Compose Desktop
Problem
Dialog composables seem to be untestable in Jetpack Compose on the Desktop platform. Any action triggered from the test that adds a Dialog to the composition seems to immediately close the box again (when running the test, the dialog box…

Mindstormer619
- 2,706
- 1
- 16
- 16
2
votes
1 answer
How to keep focus on an element after recompose?
I have a custom component in my Compose Desktop app, which can have the focus:
val focusRequester = remember { FocusRequester() }
var focused by remember { mutableStateOf(false) }
Row(modifier.fillMaxWidth()
.focusRequester(focusRequester)
…

Jorn
- 20,612
- 18
- 79
- 126
2
votes
2 answers
How to nicely init state from database in Jetpack Compose?
I have a Jetpack Compose (desktop) app with a database, and I want to show some UI based on data from the db:
val data = remember { mutableStateListOf() }
Column {
data.forEach { /* make UI */ }
}
My question is, at which point should I…

Jorn
- 20,612
- 18
- 79
- 126
2
votes
2 answers
Unable to design UI Layout in Desktop for Compose
I am developing UI Layout for an app based on Compose for Desktop
It consist of few check boxes.
But there is no functionality in Compose for Desktop to align views to each other.
In Android, we can use the Constraint Layout for view alignment and…

SVK
- 676
- 1
- 5
- 17
2
votes
0 answers
Add native binary to jetpack compose package
My Jetpack Compose Desktop app depends on a proprietary executable that I would like to include in the Debian package.
The closest I'm getting is adding the file as a resource, but that will not set the executable flag.
Is there another way of…

Robert
- 6,855
- 4
- 35
- 43
2
votes
1 answer
using android libraries for desktop, compose desktop
In the example for the compose-desktop it got
import androidx.compose.material.Button
import androidx.compose.material.Text
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import…

Arthur
- 318
- 1
- 4
- 11
2
votes
0 answers
Kotlin Compose Desktop, can I drag a file path from my application to a third-party application?
If I create a Windows/Linux desktop application using Kotlin Compose Desktop, can I drag a file (i.e., the file path) from my application into another application? I could do it in C# (WinForms) relatively with the following two lines of code:
var…

Damn Vegetables
- 11,484
- 13
- 80
- 135
2
votes
1 answer
Adding Coil dependency in Compose Desktop project
I got this error when I adding coil dependency to Compose Desktop project.
Compose version: 1.0.0
Kotlin version: 1.5.31
Error:
Execution failed for task ':compileKotlin'.
> Could not resolve all files for configuration ':compileClasspath'.
>…

beigirad
- 4,986
- 2
- 29
- 52