@@ -5,8 +5,9 @@ import androidx.compose.foundation.background
55import androidx.compose.foundation.clickable
66import androidx.compose.foundation.layout.*
77import androidx.compose.foundation.shape.RoundedCornerShape
8- import androidx.compose.material.MaterialTheme
9- import androidx.compose.material.Text
8+ import androidx.compose.material3.MaterialTheme
9+ import androidx.compose.material3.Text
10+ import androidx.compose.runtime.Composable
1011import androidx.compose.ui.Alignment
1112import androidx.compose.ui.Modifier
1213import androidx.compose.ui.awt.ComposePanel
@@ -26,46 +27,46 @@ fun addSurveyToWelcomeScreen(): JComponent {
2627 return ComposePanel ().apply {
2728 setContent {
2829 PDETheme {
29- val locale = LocalLocale .current
30- Box {
31- Row (
32- modifier = Modifier
33- .width(420 .dp)
34- .padding(16 .dp)
35- .padding(bottom = 12 .dp)
36- .clip(RoundedCornerShape (12 .dp))
37- .background(MaterialTheme .colors.surface)
38- .clickable {
39- Platform .openURL(" https://survey.processing.org/" )
40- }
41- .pointerHoverIcon(
42- PointerIcon .Hand
43- )
44- ) {
45- Image (
46- painter = painterResource(" bird.svg" ),
47- contentDescription = locale[" beta.logo" ],
48- modifier = Modifier
49- .align(Alignment .CenterVertically )
50- .padding(20 .dp)
51- .size(50 .dp)
52-
53- )
54- Column (
55- modifier = Modifier .padding(12 .dp),
56- ) {
57- Text (
58- text = locale[" welcome.survey.title" ],
59- style = MaterialTheme .typography.subtitle1.copy(fontWeight = FontWeight .Bold )
60- )
61- Text (
62- text = locale[" welcome.survey.description" ],
63- )
30+ SurveyInvitation ()
31+ }
32+ }
33+ }
34+ }
6435
65- }
66- }
67- }
36+ @Composable
37+ fun SurveyInvitation () {
38+ val locale = LocalLocale .current
39+ Row (
40+ modifier = Modifier
41+ .width(420 .dp)
42+ .clip(RoundedCornerShape (12 .dp))
43+ .background(MaterialTheme .colorScheme.surfaceContainerLowest)
44+ .clickable {
45+ Platform .openURL(" https://survey.processing.org/" )
6846 }
47+ .pointerHoverIcon(
48+ PointerIcon .Hand
49+ )
50+ ) {
51+ Image (
52+ painter = painterResource(" bird.svg" ),
53+ contentDescription = locale[" beta.logo" ],
54+ modifier = Modifier
55+ .align(Alignment .CenterVertically )
56+ .padding(20 .dp)
57+ .size(50 .dp)
58+ )
59+ Column (
60+ modifier = Modifier .padding(12 .dp),
61+ ) {
62+ Text (
63+ text = locale[" welcome.survey.title" ],
64+ style = MaterialTheme .typography.titleMedium.copy(fontWeight = FontWeight .Bold )
65+ )
66+ Text (
67+ text = locale[" welcome.survey.description" ],
68+ style = MaterialTheme .typography.bodyMedium
69+ )
6970 }
7071 }
7172}
0 commit comments