Questions tagged [jetbrains-compose]

Jetbrains Compose (https://www.jetbrains.com/lp/compose/) is a ui toolkit targeting jvm on desktop platforms. It is a port of Android Jetpack Compose (https://developer.android.com/jetpack/compose) which is developed by google

52 questions
50
votes
4 answers

Compose: remember() with keys vs. derivedStateOf()

What is the difference between these two approaches? val result = remember(key1, key2) { computeIt(key1, key2) } (Docs) val result by remember { derivedStateOf { computeIt(key1, key2) } } (Docs) Both avoid re-computation if neither key1 nor key2…
Felix D.
  • 786
  • 1
  • 11
  • 17
13
votes
2 answers

How to use webview in jetpack compose for desktop-App

I am writing a desktop application using desktop compose. But unable to find any suggestion on how to use web-view like in android we are supposed to use. For desktop-app, we can not use android web-view any help and suggestion will be highly…
8
votes
0 answers

GRPC in Kotlin Multiplatform (Android, Desktop)

I am creating a Jetbrains Compose Multiplatform project. But I will only need Desktop (JVM) and Android, so two JVM targets. I want to factor out the logic which needs grpc, so both Android and Desktop can use it without me having to program it…
7
votes
1 answer

Is there a way to create native-binary from Jetpack Compose Desktop app using GraalVM?

I want to create a small binary out of my Compose desktop app. Following are the options out of the box with Compose: Create native package with java runtime (great, but the size is very big) Create an Uber (fat) Jar (but it requires Java 11 to…
6
votes
1 answer

How to clear focus of BasicTextField upon clicking somewhere else in Compose Multiplatform?

I have a BasicTextField in Jetbrains Compose Multiplatform for desktop. When I click on it, the TextField gets focus and becomes editable. However, when I click somewhere else in my application, the focus is not lost and the field is still editable…
5
votes
1 answer

Determinite position (x, y) of specific system tray icon

Question I'm working on a desktop application using Jetbrains Compose, but I'm open to solutions using Swing (it's used under the hood) as well. I want to implement a feature where the application window is initially located at the system tray icon,…
4
votes
1 answer

How on earth do you reason about order of Jetpack Compose modifiers?

I get that Jetpack Compose operates from the outside in for modifiers, but what about this one? What I asked for: 8 dp padding then 2 dp border then background colour for component then 16 dp padding @Composable fun App() { …
Hakanai
  • 12,010
  • 10
  • 62
  • 132
4
votes
2 answers

How do I wrap text around an image or a composable?

How do I wrap text around an image or a composable? Something similar to FlowTextView in Jetpack Compose. I am wondering if there is a possibility to leave a certain space free so that if the text is too long it breaks a line and writing continues…
3
votes
0 answers

Facing issue while adding jetbrains-compose for iOS

Im following the template provided here by Jetbrains for adding compose to iOS and android and facing following issue: FAILURE: Build completed with 4 failures. 1: Task failed with an exception. ----------- * What went wrong: Execution failed for…
3
votes
2 answers

Unable to bring window to foreground with compose desktop

With the following code the application window can be hidden using the button and restored using a global shortcut ALT+S. Now I would like to also use the shortcut to bring the window to the foreground (if it wasn't hidden). Find below my failed…
3
votes
0 answers

Compose plugin creates only Dmg distribution

I have desktop app written with compose, I am workinkg on Mac. Everything works fine for mac builds, but I am unable to produce one for linux. dependencies { implementation(compose.desktop.linux_x64) …
rtsm
  • 41
  • 3
3
votes
1 answer

Make use of web component library in Kotlin Compose for Web

I want to tinker with Kotlin Compose for Web a bit. In some of my past web projects, I made use of some web components of the Clarity Design System (CDS). In a JavaScript or TypeScript project, you first need to install both npm packages@cds/core…
Endzeit
  • 4,810
  • 5
  • 29
  • 52
2
votes
0 answers

How to select all text inside a SelectionContainer in Jetpack Compose?

Consider a LazyColumn inside a SelectionContainer that contains some composables like this: SelectionContainer { LazyColumn { repeat(50) { n -> item { Row { Text("Some item:") Button(onClick = { println(n) })…
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 =…
2
votes
1 answer

How to make area behind transparent color not interactable/clickable in Jetpack Compose?

Consider that this composable, which acts as a "Dialog", is being drawn in front the root application: I tried to simulate this dialog by making it fit the entire screen and making its root container have a basic background(Color.Gray.copy(alpha =…
1
2 3 4