feat: only show icons in minmode
This commit is contained in:
parent
18a4a75a86
commit
f142743f4c
6 changed files with 23 additions and 51 deletions
|
@ -4,8 +4,7 @@ import androidx.compose.foundation.shape.CornerSize
|
|||
import androidx.compose.material.BottomAppBar
|
||||
import androidx.compose.material.MaterialTheme
|
||||
import androidx.compose.runtime.Composable
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.bar.NormalFileBottomRow
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.bar.SmallFileBottomRow
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.FileBottomRow
|
||||
import xyz.atnrch.wrench.ui.UIColors
|
||||
import xyz.atnrch.wrench.watcher.Watcher
|
||||
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||
|
@ -26,9 +25,6 @@ fun AppBottomBar(
|
|||
),
|
||||
backgroundColor = UIColors.DARK
|
||||
) {
|
||||
if (minMode)
|
||||
NormalFileBottomRow(watcherManager, watcher, currentClick, outputs, onCurrentClick)
|
||||
else
|
||||
SmallFileBottomRow(watcherManager, watcher, currentClick, outputs, onCurrentClick)
|
||||
FileBottomRow(minMode, watcherManager, watcher, currentClick, outputs, onCurrentClick)
|
||||
}
|
||||
}
|
|
@ -25,6 +25,7 @@ import java.nio.file.Path
|
|||
|
||||
@Composable
|
||||
fun AddOutputButton(
|
||||
minMode: Boolean,
|
||||
watcherManager: WatcherManager,
|
||||
outputs: MutableList<Path>,
|
||||
currentClick: Int
|
||||
|
@ -58,7 +59,9 @@ fun AddOutputButton(
|
|||
contentDescription = "Add output",
|
||||
modifier = Modifier.size(22.dp)
|
||||
)
|
||||
if(!minMode) {
|
||||
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
|
||||
Text("Add output...")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,19 +1,17 @@
|
|||
package xyz.atnrch.wrench.components.filemanager.bottom.bar
|
||||
package xyz.atnrch.wrench.components.filemanager.bottom
|
||||
|
||||
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 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(
|
||||
fun FileBottomRow(
|
||||
minMode: Boolean,
|
||||
watcherManager: WatcherManager,
|
||||
watcher: Watcher,
|
||||
currentClick: Int,
|
||||
|
@ -21,11 +19,11 @@ fun NormalFileBottomRow(
|
|||
onCurrentClick: (Int) -> Unit,
|
||||
) {
|
||||
Spacer(Modifier.width(10.dp))
|
||||
MoveFilesButton(watcher)
|
||||
MoveFilesButton(minMode, watcher)
|
||||
if (currentClick != -1) {
|
||||
Spacer(Modifier.width(10.dp))
|
||||
AddOutputButton(watcherManager, outputs, currentClick)
|
||||
AddOutputButton(minMode, watcherManager, outputs, currentClick)
|
||||
Spacer(Modifier.width(10.dp))
|
||||
RemoveOutputButton(watcherManager, outputs, currentClick, onCurrentClick)
|
||||
RemoveOutputButton(minMode, watcherManager, outputs, currentClick, onCurrentClick)
|
||||
}
|
||||
}
|
|
@ -21,6 +21,7 @@ import xyz.atnrch.wrench.watcher.Watcher
|
|||
|
||||
@Composable
|
||||
fun MoveFilesButton(
|
||||
minMode: Boolean,
|
||||
watcher: Watcher
|
||||
) {
|
||||
Button(
|
||||
|
@ -42,7 +43,9 @@ fun MoveFilesButton(
|
|||
contentDescription = "Start",
|
||||
modifier = Modifier.size(22.dp)
|
||||
)
|
||||
if(!minMode) {
|
||||
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
|
||||
Text("Move files")
|
||||
}
|
||||
}
|
||||
}
|
|
@ -23,6 +23,7 @@ import java.nio.file.Path
|
|||
|
||||
@Composable
|
||||
fun RemoveOutputButton(
|
||||
minMode: Boolean,
|
||||
watcherManager: WatcherManager,
|
||||
outputs: MutableList<Path>,
|
||||
currentClick: Int,
|
||||
|
@ -53,7 +54,9 @@ fun RemoveOutputButton(
|
|||
contentDescription = "Remove file",
|
||||
modifier = Modifier.size(22.dp)
|
||||
)
|
||||
if (!minMode) {
|
||||
Spacer(Modifier.size(ButtonDefaults.IconSpacing))
|
||||
Text("Delete input")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
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 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 SmallFileBottomRow(
|
||||
watcherManager: WatcherManager,
|
||||
watcher: Watcher,
|
||||
currentClick: Int,
|
||||
outputs: MutableList<Path>,
|
||||
onCurrentClick: (Int) -> Unit,
|
||||
) {
|
||||
Spacer(Modifier.width(5.dp))
|
||||
MoveFilesButton(watcher)
|
||||
if (currentClick != -1) {
|
||||
Spacer(Modifier.width(5.dp))
|
||||
AddOutputButton(watcherManager, outputs, currentClick)
|
||||
Spacer(Modifier.width(5.dp))
|
||||
RemoveOutputButton(watcherManager, outputs, currentClick, onCurrentClick)
|
||||
}
|
||||
}
|
Reference in a new issue