Questions tagged [compose-desktop]

Compose for Desktop is modern toolkit for building native declarative UI made by JetBrains. It's based on Google's Jetpack Compose

147 questions
0
votes
1 answer

How to remove margins from compose-desktop Button?

Having this: @Preview @Composable fun ButtonTest() { Button(onClick = {}, Modifier.border(1.dp, Color.Red)) { Text("test") } } produced UI looks like this: How can I remove white margins at top and bottom?
Radek Postołowicz
  • 4,506
  • 2
  • 30
  • 47
0
votes
1 answer

lateinit property not being initialized

I am building a Compose Desktop application using the IntelliJ IDE and ObjectBox version 3.3.1. I am using the following gradle settings: val objectboxVersion by extra("3.3.1") dependencies { implementation(compose.desktop.currentOs) …
Bruciew
  • 13
  • 5
0
votes
1 answer

Compose - Hoverable & clickable line

I'm trying to make a composable with a line shape. These lines will be connecting any two coordinates together, meaning it won't be a straight horizontal/vertical line, I know I can use divider for that. I can do a line in drawWithCache (compose…
Shazniq
  • 423
  • 4
  • 16
0
votes
1 answer

How to center Dialog into parent Window in compose?

In compose desktop we have Dialog and AlertDialog. If use Dialog, it has no parent and it's aligned center of the screen by default. To align it to window center we can calculate diffirence between window and dialog center point offset and get…
Exicode
  • 23
  • 6
0
votes
1 answer

How to preserve canvas state in Jetpack Compose for Desktop

I'd like to implement a simple drawing app with Compose for Desktop and the basics seem to be easy: import androidx.compose.foundation.Canvas import androidx.compose.foundation.background import…
Anton Arhipov
  • 6,479
  • 1
  • 35
  • 43
0
votes
0 answers

Distinguish between primary and secondary click

Working with composable in Kotlin. I have TreeView with Items which are already clickable, but now I need to distinguish between primary and secondary clicks (mouse buttons), but mouseclickable is experimental, so need to check it in another way to…
0
votes
1 answer

Is there a truly multiplatform testing setup for Jetbrains @Composable functions?

I'd love to be able to get a @Composable context running in the androidTest target of my common project, in order to test higher-order components that reside in commonMain, such as ContentLocalProviders and layouts. Something like: @Test fun…
0
votes
1 answer

How to hide button in Desktop Compose

I am developing an app with Desktop Compose Multi-Platform. I need to hide the button when it has been clicked. Please see below code: OutlinedButton( onClick = { // Perform an operation // Hide the button })…
SVK
  • 676
  • 1
  • 5
  • 17
0
votes
1 answer

What are minimum requirements for running Desktop Compose App on Mac OS and Windows OS

I am developing an app with Desktop Compose Multi-Platform. It will run on both Mac OS and Windows OS. The official document(Document Link) states that, in order to build .dmg and .msi executable we need at least JDK 15. I was able to build a .dmg…
SVK
  • 676
  • 1
  • 5
  • 17
0
votes
1 answer

In Compose Multiplatform, DropDownMenu is not available in commonMain?

Do I have to call it from specific platforms (in my case Android and desktop)?
0
votes
1 answer

starter program with Compose on desktop very lagging on Linux

I just started a desktop project with Intellij, built with the default generated code, ran it on Linux, and it worked. Then I added a counter variable for the button text (shown as follows), it also ran as before. But when I click on the button,…
LXJ
  • 1,180
  • 6
  • 18
0
votes
2 answers

Only first emitted value by StateFlow is being reflected in Compose UI

I am working with Compose Desktop. I have created a ViewModel class that is emitting some states as follows internal class ImportViewModel(private val dbHelper: FirestoreHelper) { private val scope = CoroutineScope(Dispatchers.Default) …
Abhishek Bansal
  • 5,197
  • 4
  • 40
  • 69
0
votes
1 answer

How to get current working dir on MacOs in compose desktop

I wanna get current working dir, in order to call some commands. I copied code from jetpack compose desktop lib's demo, but got wrong dir("/"). Could any one tell me what's the problem? thank you. (jetpack compose desktop lib:…
thecr0w
  • 2,148
  • 4
  • 33
  • 59
0
votes
0 answers

How convert AVFrame to Compose Image?

Here is the approximate code, but it doesn't display the image. This code works. But nothing is displayed. Take an example code from here The task is to make a player on ffmpeg.
0
votes
0 answers

How to change the application name in Windows PowerShell notifications?

I'm developing a desktop app using jetpack compose which uses the windows toast notification feature a lot. I use PowerShell scripts to push the toast notification using BurntToast module. The notification works fine but, every time it gets…
Ash
  • 1
  • 3
1 2 3
9
10