1919package com.movtery.zalithlauncher.ui.screens.content.versions.elements
2020
2121import android.content.Context
22- import androidx.compose.foundation.basicMarquee
2322import androidx.compose.foundation.layout.Arrangement
2423import androidx.compose.foundation.layout.BoxWithConstraints
2524import androidx.compose.foundation.layout.Column
26- import androidx.compose.foundation.layout.IntrinsicSize
2725import androidx.compose.foundation.layout.PaddingValues
2826import androidx.compose.foundation.layout.Row
2927import androidx.compose.foundation.layout.Spacer
3028import androidx.compose.foundation.layout.fillMaxHeight
3129import androidx.compose.foundation.layout.fillMaxWidth
32- import androidx.compose.foundation.layout.height
3330import androidx.compose.foundation.layout.heightIn
3431import androidx.compose.foundation.layout.padding
3532import androidx.compose.foundation.layout.size
@@ -47,7 +44,6 @@ import androidx.compose.material3.FilledTonalButton
4744import androidx.compose.material3.MaterialTheme
4845import androidx.compose.material3.Surface
4946import androidx.compose.material3.Text
50- import androidx.compose.material3.VerticalDivider
5147import androidx.compose.runtime.Composable
5248import androidx.compose.runtime.getValue
5349import androidx.compose.ui.Alignment
@@ -369,54 +365,47 @@ private fun ModsUpdateEntryItem(
369365 shape = shape,
370366 color = color,
371367 contentColor = contentColor,
368+ onClick = {
369+ entry.updateSelected(! selected)
370+ },
372371 ) {
373372 Row (
374- modifier = Modifier .padding(8 .dp),
375- horizontalArrangement = Arrangement .spacedBy(8 .dp),
376373 verticalAlignment = Alignment .CenterVertically
377374 ) {
378- AssetsIcon (
379- modifier = Modifier .clip(shape = RoundedCornerShape (10 .dp)),
380- size = 34 .dp,
381- iconUrl = data.project.iconUrl
382- )
383-
384- Column (
385- modifier = Modifier .weight(1f )
375+ Row (
376+ modifier = Modifier
377+ .weight(1f )
378+ .padding(8 .dp),
379+ horizontalArrangement = Arrangement .spacedBy(8 .dp),
380+ verticalAlignment = Alignment .CenterVertically
386381 ) {
387- val title = data.project.title
388- val displayTitle = data.mcMod?.getMcmodTitle(title, context) ? : title
389- Text (
390- modifier = Modifier .basicMarquee(iterations = Int .MAX_VALUE ),
391- text = displayTitle,
392- style = MaterialTheme .typography.titleSmall,
393- maxLines = 1
382+ AssetsIcon (
383+ modifier = Modifier .clip(shape = RoundedCornerShape (12 .dp)),
384+ size = 52 .dp,
385+ iconUrl = data.project.iconUrl
394386 )
395387
396- // 新旧版本对比
397- Row (
398- modifier = Modifier
399- .height(IntrinsicSize .Min )
400- .fillMaxWidth(),
401- horizontalArrangement = Arrangement .spacedBy(8 .dp)
388+ Column (
389+ modifier = Modifier .weight(1f )
402390 ) {
391+ val title = data.project.title
392+ val displayTitle = data.mcMod?.getMcmodTitle(title, context) ? : title
393+ MarqueeText (
394+ modifier = Modifier .fillMaxWidth(),
395+ text = displayTitle,
396+ style = MaterialTheme .typography.titleSmall,
397+ )
403398 // 旧版本
404399 MarqueeText (
405- modifier = Modifier .weight( 1f ),
400+ modifier = Modifier .fillMaxWidth( ),
406401 text = data.currentVersion ? : " ???" , // 未知
407402 style = MaterialTheme .typography.labelSmall.copy(
408403 textDecoration = TextDecoration .LineThrough
409404 )
410405 )
411- VerticalDivider (
412- modifier = Modifier
413- .fillMaxHeight()
414- .padding(vertical = 2 .dp),
415- color = MaterialTheme .colorScheme.onSurface.copy(alpha = 0.3f )
416- )
417406 // 新版本
418407 MarqueeText (
419- modifier = Modifier .weight( 1f ),
408+ modifier = Modifier .fillMaxWidth( ),
420409 text = newVersion.platformVersion(),
421410 style = MaterialTheme .typography.labelSmall
422411 )
0 commit comments