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

delete mask button #255

Merged
merged 2 commits into from
Jan 30, 2024
Merged
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
25 changes: 19 additions & 6 deletions GUI/src/main/kotlin/ui/screens/SettingsScreen.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,19 @@ import androidx.compose.foundation.layout.*
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.Close
import androidx.compose.material3.*
import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import models.AppState
import ui.components.general.*
import ui.components.general.HelpMenu
import ui.components.general.ProjectMenu
import ui.components.general.TitleWithInfo
import ui.components.selectVideoScreen.MaskSelectorButton
import ui.components.settingsScreen.CustomSlider
import ui.components.settingsScreen.SaveButton
Expand Down Expand Up @@ -132,10 +135,9 @@ fun SettingsScreen(state: MutableState<AppState>) {

// mask
Row(
modifier = Modifier.height(200.dp),
modifier = Modifier.height(200.dp).fillMaxWidth(0.8f),
horizontalArrangement = Arrangement.Center,
) {
Column(modifier = Modifier.weight(0.2f)) {}
MaskSelectorButton(
buttonText = "Upload Mask",
buttonPath = state.value.maskPath,
Expand All @@ -149,10 +151,21 @@ fun SettingsScreen(state: MutableState<AppState>) {
},
directoryPath = state.value.maskPath,
)
Column(modifier = Modifier.weight(0.2f)) {
// Implement remove mask button here

// delete mask path
Column(modifier = Modifier.weight(0.2f).padding(16.dp).fillMaxHeight(0.9f)) {
Button(
onClick = { state.value = state.value.copy(maskPath = null) },
shape = MaterialTheme.shapes.medium,
modifier = Modifier.fillMaxSize(),
content = { Icon(Icons.Default.Close, "delete mask path", modifier = Modifier.fillMaxSize(0.6f)) },
colors =
ButtonDefaults.buttonColors(
contentColor = MaterialTheme.colorScheme.onTertiary,
containerColor = MaterialTheme.colorScheme.tertiary,
),
)
}
Column(modifier = Modifier.weight(0.2f)) {}
}
}
}
Expand Down
Loading