Skip to content

Commit b1910de

Browse files
committed
Welcome Screen: Initial Frame
1 parent 108f0bb commit b1910de

File tree

2 files changed

+54
-0
lines changed

2 files changed

+54
-0
lines changed
File renamed without changes.
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
package processing.app.ui
2+
3+
import androidx.compose.foundation.layout.Box
4+
import androidx.compose.foundation.layout.padding
5+
import androidx.compose.foundation.layout.sizeIn
6+
import androidx.compose.runtime.Composable
7+
import androidx.compose.ui.Modifier
8+
import androidx.compose.ui.awt.ComposePanel
9+
import androidx.compose.ui.unit.dp
10+
import com.formdev.flatlaf.util.SystemInfo
11+
import processing.app.Base
12+
import processing.app.contrib.ui.contributionsManager
13+
import processing.app.ui.theme.Locale
14+
import java.io.IOException
15+
import javax.swing.JFrame
16+
import javax.swing.SwingUtilities
17+
18+
class Welcome @Throws(IOException::class) constructor(base: Base) {
19+
init {
20+
SwingUtilities.invokeLater {
21+
22+
23+
JFrame(Locale()["menu.help.welcome"]).apply{
24+
val mac = SystemInfo.isMacFullWindowContentSupported
25+
26+
rootPane.putClientProperty("apple.awt.transparentTitleBar", mac)
27+
rootPane.putClientProperty("apple.awt.fullWindowContent", mac)
28+
29+
defaultCloseOperation = JFrame.DISPOSE_ON_CLOSE
30+
add(ComposePanel().apply {
31+
setContent {
32+
Box(modifier = Modifier.padding(top = if (mac) 22.dp else 0.dp)) {
33+
welcome()
34+
}
35+
}
36+
})
37+
38+
pack()
39+
40+
setLocationRelativeTo(null)
41+
42+
isVisible = true
43+
44+
}
45+
}
46+
}
47+
48+
@Composable
49+
fun welcome() {
50+
Box(modifier = Modifier.sizeIn(815.dp, 450.dp)){
51+
52+
}
53+
}
54+
}

0 commit comments

Comments
 (0)