11package shop.itbug.flutterx.window.vm
22
3- import androidx.compose.foundation.layout.Arrangement
4- import androidx.compose.foundation.layout.Column
5- import androidx.compose.foundation.layout.Row
6- import androidx.compose.foundation.layout.fillMaxSize
3+ import androidx.compose.foundation.background
4+ import androidx.compose.foundation.border
5+ import androidx.compose.foundation.layout.*
76import androidx.compose.runtime.*
87import androidx.compose.ui.Alignment
98import androidx.compose.ui.Modifier
109import androidx.compose.ui.unit.dp
10+ import androidx.compose.ui.window.Popup
1111import com.intellij.ide.BrowserUtil
1212import com.intellij.openapi.project.Project
13+ import icons.MyImages
1314import org.jetbrains.jewel.foundation.theme.JewelTheme
15+ import org.jetbrains.jewel.ui.component.Icon
1416import org.jetbrains.jewel.ui.component.Link
1517import org.jetbrains.jewel.ui.component.Text
1618import shop.itbug.flutterx.common.dart.FlutterAppInstance
@@ -27,6 +29,7 @@ import java.net.URI
2729@Composable
2830fun FlutterAppsTabComponent (project : Project , body : @Composable (app: FlutterAppInstance ) -> Unit ) {
2931 var tabIndex by remember { mutableIntStateOf(0 ) }
32+ var showRewardPopup by remember { mutableStateOf(false ) }
3033 val flutterAppList by FlutterXVMService .getInstance(project).runningApps.collectAsState()
3134 val isEnableFuture = FlutterXVMService .getInstance(project).isEnableFuture.collectAsState().value
3235 val showRewardAction = PluginConfig .getState(project).showRewardAction
@@ -64,9 +67,27 @@ If you are running on a real device, please make sure the device is connected to
6467 })
6568
6669 if (showRewardAction) {
67- Link (PluginBundle .get(" reward" ) + " (wechat)" , onClick = {
68- BrowserUtil .browse(URI .create(" https://itbug.shop/static/ds.68eb4cac.jpg" ))
69- })
70+ Box {
71+ Link (PluginBundle .get(" reward" ) + " (WeChat)" , onClick = {
72+ showRewardPopup = ! showRewardPopup
73+ })
74+
75+ if (showRewardPopup) {
76+ Popup (onDismissRequest = { showRewardPopup = false }) {
77+ Box (
78+ modifier = Modifier .background(JewelTheme .globalColors.panelBackground)
79+ .border(1 .dp, JewelTheme .globalColors.borders.normal)
80+ .padding(12 .dp)
81+ ) {
82+ Icon (
83+ MyImages .wxDs,
84+ modifier = Modifier .size(200 .dp),
85+ contentDescription = " 微信打赏"
86+ )
87+ }
88+ }
89+ }
90+ }
7091 }
7192
7293 if (showRewardAction) {
0 commit comments