Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pause/resume in header actions #102

Merged
merged 1 commit into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ class HomeComponent(
+startQueueGroupAction
+stopQueueGroupAction
separator()
+stopAction
+stopAllAction
separator()
subMenu(
title = "Remove",
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down