Skip to content

Commit 1290ab6

Browse files
committed
Make survey card clickable and remove button
Replaces the separate 'Take Survey' button with a clickable survey card that opens the survey URL. Adds pointer hover icon for better UX and updates the survey message text.
1 parent 7fee5b1 commit 1290ab6

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

app/src/processing/app/ui/WelcomeSurvey.kt

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package processing.app.ui
22

33
import androidx.compose.foundation.Image
44
import androidx.compose.foundation.background
5+
import androidx.compose.foundation.clickable
56
import androidx.compose.foundation.layout.*
67
import androidx.compose.foundation.shape.RoundedCornerShape
78
import androidx.compose.material.MaterialTheme
@@ -10,10 +11,12 @@ import androidx.compose.ui.Alignment
1011
import androidx.compose.ui.Modifier
1112
import androidx.compose.ui.awt.ComposePanel
1213
import androidx.compose.ui.draw.clip
14+
import androidx.compose.ui.input.pointer.PointerIcon
15+
import androidx.compose.ui.input.pointer.pointerHoverIcon
1316
import androidx.compose.ui.res.painterResource
1417
import androidx.compose.ui.text.font.FontWeight
1518
import androidx.compose.ui.unit.dp
16-
import processing.app.ui.WelcomeToBeta.Companion.PDEButton
19+
import processing.app.Platform
1720
import processing.app.ui.theme.LocalLocale
1821
import processing.app.ui.theme.ProcessingTheme
1922
import javax.swing.JComponent
@@ -32,6 +35,12 @@ fun addSurveyToWelcomeScreen(): JComponent {
3235
.padding(bottom = 12.dp)
3336
.clip(RoundedCornerShape(12.dp))
3437
.background(MaterialTheme.colors.surface)
38+
.clickable {
39+
Platform.openURL("https://survey.processing.org/")
40+
}
41+
.pointerHoverIcon(
42+
PointerIcon.Hand
43+
)
3544
) {
3645
Image(
3746
painter = painterResource("bird.svg"),
@@ -50,25 +59,13 @@ fun addSurveyToWelcomeScreen(): JComponent {
5059
style = MaterialTheme.typography.subtitle1.copy(fontWeight = FontWeight.Bold)
5160
)
5261
Text(
53-
text = "welcome survey message"
62+
text = "click here to take part in the survey and help us improve Processing!",
5463
)
5564

5665
}
5766
}
58-
59-
PDEButton(
60-
onClick = {
61-
62-
},
63-
modifier = Modifier
64-
.align(Alignment.BottomEnd)
65-
.padding(horizontal = 6.dp, vertical = 16.dp)
66-
) {
67-
Text(text = "Take Survey")
68-
}
6967
}
7068
}
7169
}
7270
}
73-
7471
}

0 commit comments

Comments
 (0)