Skip to content

Commit a29ff5f

Browse files
committed
docs(ui): remove redundant comments from TextContextMenu #453
Clean up code by deleting outdated and unnecessary documentation comments.
1 parent 7dcebee commit a29ff5f

File tree

1 file changed

+0
-31
lines changed

1 file changed

+0
-31
lines changed

mpp-ui/src/jvmMain/kotlin/cc/unitmesh/devins/ui/desktop/TextContextMenu.kt

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,9 @@ import androidx.compose.foundation.ExperimentalFoundationApi
66
import androidx.compose.foundation.text.selection.SelectionContainer
77
import androidx.compose.runtime.Composable
88
import androidx.compose.ui.Modifier
9-
import androidx.compose.ui.platform.LocalClipboardManager
10-
import androidx.compose.ui.text.AnnotatedString
119
import java.awt.Toolkit
1210
import java.awt.datatransfer.StringSelection
1311

14-
/**
15-
* 为文本内容提供右键菜单支持
16-
*
17-
* 功能:
18-
* - 复制选中的文本
19-
* - 全选文本
20-
*
21-
* 使用方式:
22-
* ```kotlin
23-
* TextWithContextMenu {
24-
* Text("可以右键复制的文本")
25-
* }
26-
* ```
27-
*/
2812
@OptIn(ExperimentalFoundationApi::class)
2913
@Composable
3014
fun TextWithContextMenu(
@@ -46,10 +30,6 @@ fun TextWithContextMenu(
4630
}
4731
}
4832

49-
/**
50-
* 复制文本到系统剪贴板
51-
* 使用 AWT Toolkit 确保跨应用复制粘贴正常工作
52-
*/
5333
fun copyToSystemClipboard(text: String) {
5434
try {
5535
val clipboard = Toolkit.getDefaultToolkit().systemClipboard
@@ -60,17 +40,6 @@ fun copyToSystemClipboard(text: String) {
6040
}
6141
}
6242

63-
/**
64-
* 为选中的文本提供复制功能的扩展函数
65-
*
66-
* 使用方式:
67-
* ```kotlin
68-
* Text(
69-
* text = "可复制的文本",
70-
* modifier = Modifier.copyableText()
71-
* )
72-
* ```
73-
*/
7443
@OptIn(ExperimentalFoundationApi::class)
7544
@Composable
7645
fun Modifier.copyableText(text: String): Modifier {

0 commit comments

Comments
 (0)