Skip to content

Commit

Permalink
Merge pull request #102 from amir1376/feature/add-pause-resume-action…
Browse files Browse the repository at this point in the history
…s-in-header

add pause/resume in header actions
  • Loading branch information
amir1376 authored Oct 10, 2024
2 parents 7fb4c7f + fc218b3 commit acb8747
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
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

0 comments on commit acb8747

Please sign in to comment.