py
01/07/2021, 5:53 PMorangy
Glenn Martin
01/10/2021, 1:32 PMThomas
01/13/2021, 1:58 PMAlertDialog
. As you can see the code makes a couple of assumptions, that's why I call it a hack. 🙂 For example: will AppManager.windows.last().window
really always refer to the dialog? Also, upon recompositions we may get unwanted double listener registrations, so I need to make sure the listeners are set only if needed (will likely use client properties). Finally, clicking and dragging inteferes with normal Compose behavior. So, again, in this version it's a hack, yet a cool one.
if (isConfirmDialogVisible.value) {
AlertDialog(onDismissRequest = {
isConfirmDialogVisible.value = false
},
properties = DesktopDialogProperties(undecorated = true),
modifier = Modifier.border(width = 1.dp,
MaterialTheme.colors.primary),
title = {
Text(RESOURCE_BUNDLE.getString("confirm_deletion"))
},
text = {
ScrollableColumn {
val sb = StringBuilder()
selectedFiles.forEach {
sb.append(checksums[currentPos], it.name).appendLine()
}
Text(sb.toString())
}
},
dismissButton = {
Button(onClick = {
isConfirmDialogVisible.value = false
}) {
Text(RESOURCE_BUNDLE.getString("cancel"))
}
},
confirmButton = {
Button(onClick = {
isConfirmDialogVisible.value = false
selectedFiles.forEach {
df.deleteFile(checksums[currentPos], it)
}
selected.clear()
}) {
Text(RESOURCE_BUNDLE.getString("delete"))
}
})
val window = AppManager.windows.last().window
val component = window.contentPane.getComponent(0)
val adapter = object : MouseInputAdapter() {
private lateinit var initialClick: Point
override fun mousePressed(e: MouseEvent) {
initialClick = e.point
}
override fun mouseDragged(e: MouseEvent) {
val dx = e.x - initialClick.x
val dy = e.y - initialClick.y
window.setLocation(window.location.x + dx,
window.location.y + dy)
}
}
component.addMouseMotionListener(adapter)
component.addMouseListener(adapter)
}
Animesh Sahu
01/15/2021, 9:28 AMJohn O'Reilly
01/16/2021, 2:47 PMThomas
01/16/2021, 2:56 PMAshley Cadby
01/19/2021, 10:17 AMK J
01/21/2021, 11:13 PMfun main() = Window(title = "Falling Balls", size = IntSize(800, 800)) {}
so getting a NoSuchMethodError is a bit strange to me.. 🤔rnett
01/22/2021, 5:51 AMevents = WindowEvents(onOpen = { AppManager.windows.forEach { it.maximize() } })
works as long as I have one window, but there's a lag before it recomposes w/ the new size.Javier
01/23/2021, 11:13 AMButton
uses MaterialTheme
, CustomButton
uses CustomTheme
• If it is build on top of Material Theme, should it hide the material theme and widgets so the Custom
prefix should not be used?
• If it is build on top of Material Theme, and it hides the material theme, what about an use case where the user add both libraries, material and custom? should the user play with the imports?
import androidx.compose.material.Button as MaterialButton
import some.custom.package.Button as CustomButton
Colton Idle
01/24/2021, 9:46 PMxetra11
01/25/2021, 8:19 AMgbaldeck
02/04/2021, 3:09 PMtheapache64
02/04/2021, 5:47 PMArkadii Ivanov
02/04/2021, 11:15 PMKirill Grouchnikov
02/08/2021, 4:59 AMProviders
to CompositionLocalProvider
. Another is in Modifier.draggable
where onDrag
lambda is replaced with state
theapache64
02/08/2021, 1:49 PMseb
02/08/2021, 1:50 PMseb
02/08/2021, 1:53 PMBino
02/08/2021, 1:57 PMKirill Grouchnikov
02/08/2021, 1:57 PMjim
02/08/2021, 2:04 PMrsktash
02/08/2021, 2:46 PMDmitry Romanov [JB]
02/08/2021, 4:58 PMShabinder Singh
02/08/2021, 6:06 PMShabinder Singh
02/09/2021, 2:33 PMtheapache64
02/10/2021, 11:24 AMgbaldeck
02/10/2021, 4:08 PMKirill Grouchnikov
02/10/2021, 8:25 PMcom.vanniktech:gradle-maven-publish-plugin
to push your snapshot / release builds, and you've upgraded to Kotlin 1.4.30 for your multi-platform project, you need to upgrade to version 0.14.0
of the plugin. See https://github.com/vanniktech/gradle-maven-publish-plugin/issues/185