feat: create function for small bottom row
This commit is contained in:
parent
0e042026fd
commit
5c8c5ab8c5
3 changed files with 40 additions and 4 deletions
|
@ -5,7 +5,7 @@ import androidx.compose.material.BottomAppBar
|
|||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.window.WindowState
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.FileWatcherBottomRow
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.bar.NormalFileBottomRow
|
||||
import xyz.atnrch.wrench.ui.UIColors
|
||||
import xyz.atnrch.wrench.watcher.Watcher
|
||||
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||
|
@ -25,5 +25,5 @@ fun AppBottomBar(
|
|||
CornerSize(percent = 50)
|
||||
),
|
||||
backgroundColor = UIColors.DARK
|
||||
) { FileWatcherBottomRow(state, watcherManager, watcher, currentClick, outputs, onCurrentClick) }
|
||||
) { NormalFileBottomRow(state, watcherManager, watcher, currentClick, outputs, onCurrentClick) }
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package xyz.atnrch.wrench.components.filemanager.bottom.bar
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.width
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.WindowState
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.AddOutputButton
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.MoveFilesButton
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.RemoveOutputButton
|
||||
import xyz.atnrch.wrench.watcher.Watcher
|
||||
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||
import java.nio.file.Path
|
||||
|
||||
@Composable
|
||||
fun NormalFileBottomRow(
|
||||
state: WindowState,
|
||||
watcherManager: WatcherManager,
|
||||
watcher: Watcher,
|
||||
currentClick: Int,
|
||||
outputs: MutableList<Path>,
|
||||
onCurrentClick: (Int) -> Unit,
|
||||
) {
|
||||
Spacer(Modifier.width(10.dp))
|
||||
MoveFilesButton(state, watcher)
|
||||
if (currentClick != -1) {
|
||||
Spacer(Modifier.width(10.dp))
|
||||
AddOutputButton(watcherManager, outputs, currentClick)
|
||||
Spacer(Modifier.width(10.dp))
|
||||
RemoveOutputButton(watcherManager, outputs, currentClick, onCurrentClick)
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package xyz.atnrch.wrench.components.filemanager.bottom
|
||||
package xyz.atnrch.wrench.components.filemanager.bottom.bar
|
||||
|
||||
import androidx.compose.foundation.layout.Spacer
|
||||
import androidx.compose.foundation.layout.width
|
||||
|
@ -6,12 +6,15 @@ import androidx.compose.runtime.Composable
|
|||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.WindowState
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.AddOutputButton
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.MoveFilesButton
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.RemoveOutputButton
|
||||
import xyz.atnrch.wrench.watcher.Watcher
|
||||
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||
import java.nio.file.Path
|
||||
|
||||
@Composable
|
||||
fun FileWatcherBottomRow(
|
||||
fun SmallBottomRow(
|
||||
state: WindowState,
|
||||
watcherManager: WatcherManager,
|
||||
watcher: Watcher,
|
Reference in a new issue