Nuru Nabiyev
11/11/2023, 8:49 AMZoff
11/11/2023, 10:35 AMTom Truyen
11/11/2023, 4:25 PM@Composable
fun TextFieldWithDropdown(
modifier: Modifier = Modifier,
value: String,
onValueChange: (String) -> Unit,
options: List<String>,
onOptionClick: (String) -> Unit,
) {
val density = LocalDensity.current
var text by remember {
mutableStateOf(value)
}
var expanded by remember(options) { mutableStateOf(options.isNotEmpty()) }
var anchorSize by remember {
mutableStateOf(DpSize.Zero)
}
Box(modifier) {
TextField(
modifier = Modifier
.fillMaxWidth()
.onGloballyPositioned {
anchorSize = with(density) {
DpSize(
width = it.size.width.toDp(),
height = it.size.height.toDp()
)
}
}
.onFocusChanged { focusState ->
if (!focusState.isFocused) {
expanded = false
}
},
singleLine = true,
value = text,
onValueChange = {
text = it
onValueChange(it)
},
colors = TextFieldDefaults.textFieldColors(
backgroundColor = MaterialTheme.colors.surface,
textColor = MaterialTheme.colors.onSurface,
cursorColor = MaterialTheme.colors.onSurface,
),
)
DropdownMenu(
modifier = Modifier
.width(anchorSize.width),
offset = DpOffset(0.dp, Dimens.normal),
focusable = false,
expanded = expanded,
onDismissRequest = { expanded = false }
) {
options.forEach { text ->
DropdownMenuItem(
onClick = {
onOptionClick(text)
}
) {
Text(text = text)
}
}
}
}
}
Oskar
11/13/2023, 11:38 AMmacOS {
jvmArgs(
"-Dapple.awt.application.appearance=system"
)
}
Is there some equivalent setting to also make it work on Windows?
Or maybe some other way to set it in code?alexfacciorusso
11/13/2023, 1:22 PMzt
11/13/2023, 5:04 PMLucas
11/14/2023, 3:54 PMjQrgen
11/15/2023, 3:07 AMZoff
11/15/2023, 7:52 AMeygraber
11/15/2023, 7:17 PMDragos Rachieru
11/16/2023, 11:12 AMeygraber
11/17/2023, 7:34 PMZoff
11/18/2023, 8:48 AMAbdullah Musa
11/18/2023, 12:28 PMVideoFrames
.
How can I achieve this?Md Sadique Inam
11/20/2023, 9:45 AMTakeshi Hagikura
11/20/2023, 3:19 PMZoff
11/20/2023, 7:08 PMNuru Nabiyev
11/20/2023, 9:05 PMonPointerEvent(PointerEventType._*Press*_)
and onPointerEvent(PointerEventType._*Release*_)
are triggered in different elements? I am trying to draw arrows from one place (ImageView) to another (also ImageView), but as you can see in the logs: the same initial element release is registered, instead of another.Zoff
11/21/2023, 9:31 AMMarcin Wisniowski
11/21/2023, 3:09 PMonPointerEvent(PointerEventType.Release)
modifier, and an onClick
modifier on the same element, which closes the window. The click release event is never delivered, regardless of the modifier order (the window closes before the event is delivered). How can I properly ensure that I get the click release event?Tihomir Bozic
11/21/2023, 8:34 PMHamba
11/22/2023, 2:37 PMHamba
11/22/2023, 5:06 PMUIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())
It doesnt look that great by defaultAhmed Mourad
11/22/2023, 10:06 PMMarcin Wisniowski
11/23/2023, 1:27 AMWindow
? I want my window to be resizeable, but squishing it into a tiny square is not useful, so I'd like to set a reasonable minimum. If the minimum size could just be based on minimum measurements of the Compose layout, that would be even greater.Hamba
11/23/2023, 6:52 AMHamba
11/24/2023, 4:44 AMHamba
11/24/2023, 7:41 AMStan van der Bend
11/24/2023, 11:46 AMStefan Oltmann
11/24/2023, 12:50 PMThis build is using a beta version of Xcode and can't be submitted
. The version is the same I use for iOS. I followed the instructions on https://github.com/JetBrains/compose-multiplatform/tree/master/tutorials/Signing_and_notarization_on_macOS.
Does anyone have an idea what could be wrong?