mirror of
https://github.com/amir1376/ab-download-manager.git
synced 2025-02-20 11:43:24 +08:00
add pause/resume in header actions
This commit is contained in:
parent
7fb4c7f766
commit
fc218b3322
@ -4,7 +4,6 @@ import com.abdownloadmanager.desktop.AppComponent
|
||||
import com.abdownloadmanager.desktop.SharedConstants
|
||||
import com.abdownloadmanager.desktop.di.Di
|
||||
import com.abdownloadmanager.desktop.ui.icon.MyIcons
|
||||
import com.abdownloadmanager.desktop.ui.widget.menu.SubMenu
|
||||
import com.abdownloadmanager.desktop.utils.AppInfo
|
||||
import com.abdownloadmanager.desktop.utils.ClipboardUtil
|
||||
import ir.amirab.util.compose.action.AnAction
|
||||
@ -87,7 +86,7 @@ val startQueueGroupAction = MenuItem.SubMenu(
|
||||
}
|
||||
|
||||
|
||||
val stopAction = simpleAction("Stop All", MyIcons.stop) {
|
||||
val stopAllAction = simpleAction("Stop All", MyIcons.stop) {
|
||||
scope.launch {
|
||||
downloadSystem.stopAnything()
|
||||
}
|
||||
|
@ -332,7 +332,7 @@ class HomeComponent(
|
||||
+startQueueGroupAction
|
||||
+stopQueueGroupAction
|
||||
separator()
|
||||
+stopAction
|
||||
+stopAllAction
|
||||
separator()
|
||||
subMenu(
|
||||
title = "Remove",
|
||||
@ -370,15 +370,6 @@ class HomeComponent(
|
||||
}.filterIsInstance<MenuItem.SubMenu>()
|
||||
|
||||
|
||||
val headerActions = buildMenu {
|
||||
separator()
|
||||
+startQueueGroupAction
|
||||
+stopQueueGroupAction
|
||||
+stopAction
|
||||
separator()
|
||||
+openQueuesAction
|
||||
+gotoSettingsAction
|
||||
}
|
||||
|
||||
private val shouldShowOptions = MutableStateFlow(false)
|
||||
val downloadOptions = combineStateFlows(
|
||||
@ -663,6 +654,18 @@ class HomeComponent(
|
||||
"DELETE" to downloadActions.deleteAction
|
||||
"ctrl I" to downloadActions.openDownloadDialogAction
|
||||
}
|
||||
val headerActions = buildMenu {
|
||||
separator()
|
||||
+downloadActions.resumeAction
|
||||
+downloadActions.pauseAction
|
||||
separator()
|
||||
+startQueueGroupAction
|
||||
+stopQueueGroupAction
|
||||
+stopAllAction
|
||||
separator()
|
||||
+openQueuesAction
|
||||
+gotoSettingsAction
|
||||
}
|
||||
|
||||
companion object {
|
||||
val CATEGORIES_SIZE_RANGE = 0.dp..500.dp
|
||||
|
Loading…
x
Reference in New Issue
Block a user