olonho
01/11/2022, 8:38 AMKebbin
01/18/2022, 12:36 PMJavier
01/19/2022, 10:46 AMeygraber
01/21/2022, 3:38 AMiosX64("uikitX64")
https://github.com/JetBrains/compose-jb/blob/master/examples/minesweeper/build.gradle.kts#L56Marcin Wisniowski
01/28/2022, 12:20 PMAbdelilah El Aissaoui
02/01/2022, 1:48 PMmanueldidonna
02/02/2022, 12:02 AMModifier.transformable
or PointerInputScope.detectTransformGestures
, but they don’t work on Desktop, I can just detect mouse events. Any solution?Michael Paus
02/02/2022, 12:52 PMFunkyMuse
02/03/2022, 8:28 AMPavle Joksovic
02/09/2022, 3:24 PMNikola Panic
02/11/2022, 4:07 PM@Composable
function that calls WindowScope functions. Here is an example of how my test is defined:
class Test {
@get:Rule
val composeRule = createComposeRule()
@OptIn(ExperimentalMaterialApi::class)
@Test
fun `test main window`() {
composeRule.setContent {
MainWindow(
mainScreen = { mainScreen() },
)
}
runBlocking {
println(composeRule.onRoot().printToString())
composeRule.onNodeWithTag(MAIN_SCREEN).assertExists()
composeRule.onNodeWithText(SOME_TEXT).assertExists()
}
}
}
@Composable
fun MainWindow(
mainScreen: @Composable () -> Unit,
) {
Window(onCloseRequest = {}) {
MaterialTheme {
mainScreen()
}
}
}
@Composable
private fun mainScreen() {
Column(Modifier.fillMaxSize().testTag(MAIN_SCREEN)) {
Text(SOME_TEXT)
}
}
const val MAIN_SCREEN = "main_screen"
const val SOME_TEXT = "Some text"
The test is failing and when I print the whole view hierarchy it just shows only one node without any children
Printing with useUnmergedTree = 'false'
Node #1 at (l=0.0, t=0.0, r=0.0, b=0.0)px
but as soon as I remove the Window
method from MainWindow
the test is passing and the view hierarchy is correct.
Printing with useUnmergedTree = 'false'
Node #1 at (l=0.0, t=0.0, r=1024.0, b=768.0)px
|-Node #2 at (l=0.0, t=0.0, r=1024.0, b=768.0)px, Tag: 'main_screen'
|-Node #3 at (l=0.0, t=0.0, r=78.0, b=19.0)px
Text = '[Some text]'
Actions = [GetTextLayoutResult]
Any ideas?Cody Mikol
02/12/2022, 7:41 PMfuhao
02/17/2022, 1:26 AMpackageName
by Chinese String. And package it, it output mojibake.
compose.desktop {
application {
mainClass = "MainKt"
nativeDistributions {
...
packageName = "测试文本 For Desktop"
...
}
}
}
How can I solve it?Trammel May
02/19/2022, 6:45 AMHumphrey
02/21/2022, 4:38 AMTorsten Wiederkehr
02/21/2022, 6:45 AMPavle Joksovic
02/21/2022, 1:27 PMDavid W
02/21/2022, 10:25 PMKebbin
02/23/2022, 12:10 PMpajatopmr
02/23/2022, 11:14 PMhfhbd
02/24/2022, 12:42 PMKirill Grouchnikov
02/25/2022, 4:37 AMEmily V
02/26/2022, 5:01 PMfun main() = application {
Window(
onCloseRequest = ::exitApplication,
title = "Core Plotter v1.0.0",
state = rememberWindowState(width = 1024.dp, height = 768.dp)
) {
val menuBarActions = MenuBarActions(this@application)
val chartLogic = ChartLogic
MaterialTheme {
WindowMenuBar(menuBarActions)
GraphScreen(chartLogic)
}
}
}
Please notice MenuBarActions (which is regular Kotlin object that has the logic actions for MenuBar item clicks) that is passed to the Composable function:
@OptIn(ExperimentalComposeUiApi::class)
@Composable
fun FrameWindowScope.WindowMenuBar(actions: MenuBarActions) = MenuBar {
Menu("File") {
Item("Open recording...", onClick = { actions.openFile(window)}, shortcut = KeyShortcut(Key.O, meta = true))
Item("Save", onClick = { }, shortcut = KeyShortcut(Key.S, meta = true))
Separator()
Item("Exit", onClick = { actions.closeWindow()}, shortcut = KeyShortcut(Key.Q, meta = true))
}
Menu("Actions") {
Item("Export", onClick = { })
}
}
I’m not too happy with passing this@application to MenuBarActions constructor. I’m doing that so I can call application.exitApplication() when “Exit” is clicked. It works but is that the correct way to handle this action?simon ballantyne
02/28/2022, 9:44 PMsimon ballantyne
02/28/2022, 9:45 PMwindows{
dirChooser = true
installationPath = "../a directory"
simon ballantyne
02/28/2022, 9:45 PM毛小川
03/02/2022, 3:12 AMDropdownMenu
?Kebbin
03/06/2022, 5:28 AMKebbin
03/06/2022, 8:10 AM毛小川
03/08/2022, 3:16 AMvender
at nativeDistributions
in build.gradle.kts
,but vender
is garbled after install.How can I specify the charset or have other solutions
(build.gradle.kts
's charset is UTF-8 , My OS's charset is GBK)