Skip to content

Commit a77d9f2

Browse files
guiyanakuangclaude
andauthored
✨ Add getPasteTypeExt() composable helper for PasteType (#3726)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent cea703f commit a77d9f2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

app/src/commonMain/kotlin/com/crosspaste/paste/PasteTypeExt.kt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ import androidx.compose.material.icons.outlined.Image
88
import androidx.compose.material.icons.outlined.Link
99
import androidx.compose.material.icons.outlined.Palette
1010
import androidx.compose.material.icons.outlined.TextFields
11+
import androidx.compose.runtime.Composable
1112
import androidx.compose.ui.graphics.Color
1213
import androidx.compose.ui.graphics.vector.ImageVector
14+
import com.crosspaste.ui.LocalThemeExtState
1315

1416
data class PasteTypeExt(
1517
val imageVector: ImageVector,
@@ -116,3 +118,18 @@ data class PasteTypeExt(
116118
)
117119
}
118120
}
121+
122+
@Composable
123+
fun PasteType.getPasteTypeExt(): PasteTypeExt {
124+
val themeExt = LocalThemeExtState.current
125+
return when (this) {
126+
PasteType.TEXT_TYPE -> themeExt.textPasteTypeExt
127+
PasteType.URL_TYPE -> themeExt.urlPasteTypeExt
128+
PasteType.HTML_TYPE -> themeExt.htmlPasteTypeExt
129+
PasteType.FILE_TYPE -> themeExt.filePasteTypeExt
130+
PasteType.IMAGE_TYPE -> themeExt.imagePasteTypeExt
131+
PasteType.RTF_TYPE -> themeExt.rtfPasteTypeExt
132+
PasteType.COLOR_TYPE -> themeExt.colorPasteTypeExt
133+
else -> themeExt.textPasteTypeExt
134+
}
135+
}

0 commit comments

Comments
 (0)