feat: remove button scaling
This commit is contained in:
parent
34de9a79d8
commit
e04e4d5fbf
5 changed files with 9 additions and 22 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.BottomRowNew
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.FileWatcherBottomRow
|
||||
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
|
||||
) { BottomRowNew(state, watcherManager, watcher, currentClick, outputs, onCurrentClick) }
|
||||
) { FileWatcherBottomRow(state, watcherManager, watcher, currentClick, outputs, onCurrentClick) }
|
||||
}
|
|
@ -5,7 +5,6 @@ import androidx.compose.material.ScaffoldState
|
|||
import androidx.compose.material.rememberScaffoldState
|
||||
import androidx.compose.runtime.*
|
||||
import androidx.compose.ui.window.WindowState
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.AppBottomBar
|
||||
import xyz.atnrch.wrench.components.filemanager.bottom.FloatingButton
|
||||
import xyz.atnrch.wrench.components.filemanager.top.TopBar
|
||||
import xyz.atnrch.wrench.compose.SnackBarDataHolder
|
||||
|
|
|
@ -13,11 +13,9 @@ import androidx.compose.material.icons.Icons
|
|||
import androidx.compose.material.icons.filled.NoteAdd
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.scale
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.WindowState
|
||||
import xyz.atnrch.wrench.components.filemanager.center.showDirectoryPicker
|
||||
import xyz.atnrch.wrench.logger.Logger
|
||||
import xyz.atnrch.wrench.ui.UIColors
|
||||
|
@ -27,13 +25,10 @@ import java.nio.file.Path
|
|||
|
||||
@Composable
|
||||
fun AddOutputButton(
|
||||
state: WindowState,
|
||||
watcherManager: WatcherManager,
|
||||
outputs: MutableList<Path>,
|
||||
currentClick: Int
|
||||
) {
|
||||
val scaleFactor: Float = if (state.size.width <= 600.dp) 0.85f else 1f
|
||||
|
||||
Button(
|
||||
onClick =
|
||||
{
|
||||
|
@ -55,7 +50,7 @@ fun AddOutputButton(
|
|||
),
|
||||
shape = RoundedCornerShape(100),
|
||||
border = BorderStroke(2.dp, UIColors.ORANGE),
|
||||
modifier = Modifier.shadow(24.dp, RoundedCornerShape(100), false).scale(scaleFactor)
|
||||
modifier = Modifier.shadow(24.dp, RoundedCornerShape(100), false)
|
||||
) {
|
||||
Icon(
|
||||
Icons.Filled.NoteAdd,
|
||||
|
|
|
@ -11,7 +11,7 @@ import xyz.atnrch.wrench.watcher.WatcherManager
|
|||
import java.nio.file.Path
|
||||
|
||||
@Composable
|
||||
fun BottomRowNew(
|
||||
fun FileWatcherBottomRow(
|
||||
state: WindowState,
|
||||
watcherManager: WatcherManager,
|
||||
watcher: Watcher,
|
||||
|
@ -19,14 +19,12 @@ fun BottomRowNew(
|
|||
outputs: MutableList<Path>,
|
||||
onCurrentClick: (Int) -> Unit,
|
||||
) {
|
||||
val buttonWidth = if (state.size.width <= 600.dp) 0.dp else 10.dp
|
||||
|
||||
Spacer(Modifier.width(10.dp))
|
||||
MoveFilesButton(state, watcher)
|
||||
if (currentClick != -1) {
|
||||
Spacer(Modifier.width(buttonWidth))
|
||||
AddOutputButton(state, watcherManager, outputs, currentClick)
|
||||
Spacer(Modifier.width(buttonWidth))
|
||||
RemoveOutputButton(state, watcherManager, outputs, currentClick, onCurrentClick)
|
||||
Spacer(Modifier.width(10.dp))
|
||||
AddOutputButton(watcherManager, outputs, currentClick)
|
||||
Spacer(Modifier.width(10.dp))
|
||||
RemoveOutputButton(watcherManager, outputs, currentClick, onCurrentClick)
|
||||
}
|
||||
}
|
|
@ -13,11 +13,9 @@ import androidx.compose.material.icons.Icons
|
|||
import androidx.compose.material.icons.filled.Delete
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.draw.scale
|
||||
import androidx.compose.ui.draw.shadow
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.window.WindowState
|
||||
import xyz.atnrch.wrench.registery.ACTIVE_COMPOSABLE
|
||||
import xyz.atnrch.wrench.ui.UIColors
|
||||
import xyz.atnrch.wrench.watcher.WatcherManager
|
||||
|
@ -25,14 +23,11 @@ import java.nio.file.Path
|
|||
|
||||
@Composable
|
||||
fun RemoveOutputButton(
|
||||
state: WindowState,
|
||||
watcherManager: WatcherManager,
|
||||
outputs: MutableList<Path>,
|
||||
currentClick: Int,
|
||||
onCurrentClick: (Int) -> Unit
|
||||
) {
|
||||
val scaleFactor: Float = if (state.size.width <= 600.dp) 0.85f else 1f
|
||||
|
||||
Button(
|
||||
onClick =
|
||||
{
|
||||
|
@ -50,7 +45,7 @@ fun RemoveOutputButton(
|
|||
),
|
||||
shape = RoundedCornerShape(100),
|
||||
border = BorderStroke(2.dp, UIColors.STRESS),
|
||||
modifier = Modifier.shadow(24.dp, RoundedCornerShape(100), false).scale(scaleFactor)
|
||||
modifier = Modifier.shadow(24.dp, RoundedCornerShape(100), false)
|
||||
) {
|
||||
Icon(
|
||||
Icons.Filled.Delete,
|
||||
|
|
Reference in a new issue