mirror of
https://github.com/amir1376/ab-download-manager.git
synced 2025-02-20 11:43:24 +08:00
refactor IComposeSystemTray
This commit is contained in:
parent
6e6247ff32
commit
ef869a2851
@ -146,7 +146,7 @@ private fun ApplicationScope.SystemTray(
|
||||
IComposeSystemTray.Instance.ComposeSystemTray(
|
||||
icon = MyIcons.appIcon,
|
||||
onClick = showDownloadList,
|
||||
title = AppInfo.displayName.asStringSource(),
|
||||
tooltip = AppInfo.displayName.asStringSource(),
|
||||
menu = remember {
|
||||
buildMenu {
|
||||
+showDownloadList
|
||||
|
@ -10,7 +10,7 @@ interface IComposeSystemTray {
|
||||
@Composable
|
||||
fun ComposeSystemTray(
|
||||
icon: IconSource,
|
||||
title: StringSource,
|
||||
tooltip: StringSource,
|
||||
menu: List<MenuItem>,
|
||||
onClick: () -> Unit,
|
||||
)
|
||||
|
@ -19,7 +19,7 @@ class ComposeSystemTrayForLinux : IComposeSystemTray {
|
||||
@Composable
|
||||
override fun ComposeSystemTray(
|
||||
icon: IconSource,
|
||||
title: StringSource,
|
||||
tooltip: StringSource,
|
||||
menu: List<MenuItem>,
|
||||
onClick: () -> Unit
|
||||
) {
|
||||
@ -36,7 +36,7 @@ class ComposeSystemTrayForLinux : IComposeSystemTray {
|
||||
GlobalLayoutDirection,
|
||||
)
|
||||
}
|
||||
val tooltipString = title.rememberString()
|
||||
val tooltipString = tooltip.rememberString()
|
||||
|
||||
LaunchedEffect(awtImage) {
|
||||
systemTray.setImage(awtImage)
|
||||
|
@ -19,14 +19,14 @@ class ComposeSystemTrayForWindows : IComposeSystemTray {
|
||||
@Composable
|
||||
override fun ComposeSystemTray(
|
||||
icon: IconSource,
|
||||
title: StringSource,
|
||||
tooltip: StringSource,
|
||||
menu: List<MenuItem>,
|
||||
onClick: () -> Unit,
|
||||
) {
|
||||
var popUpPosition by remember { mutableStateOf(null as DpOffset?) }
|
||||
val closeOptions = { popUpPosition = null }
|
||||
AwtTray(
|
||||
tooltip = title.rememberString(),
|
||||
tooltip = tooltip.rememberString(),
|
||||
icon = icon.rememberPainter(),
|
||||
onClick = onClick,
|
||||
onRightClick = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user