Fix register view on WASM, remove edit buttons when viewing non-editable project
This commit is contained in:
@@ -181,7 +181,6 @@ fun LoginView(server: String?, error: String?, onSwitchSignup: () -> Unit, onLog
|
|||||||
Text("Log in", style = MaterialTheme.typography.headlineMedium)
|
Text("Log in", style = MaterialTheme.typography.headlineMedium)
|
||||||
|
|
||||||
ServerSelect(serverUrl) { serverUrl = it }
|
ServerSelect(serverUrl) { serverUrl = it }
|
||||||
// OutlinedTextField(serverUrl, { serverUrl = it }, Modifier.fillMaxWidth(), label = { Text("Server URL") }, singleLine = true)
|
|
||||||
|
|
||||||
OutlinedTextField(username, { username = it }, Modifier.fillMaxWidth(), label = { Text("Username") }, singleLine = true)
|
OutlinedTextField(username, { username = it }, Modifier.fillMaxWidth(), label = { Text("Username") }, singleLine = true)
|
||||||
OutlinedTextField(password, { password = it }, Modifier.fillMaxWidth(), label = { Text("Password") }, visualTransformation = PasswordVisualTransformation(), singleLine = true)
|
OutlinedTextField(password, { password = it }, Modifier.fillMaxWidth(), label = { Text("Password") }, visualTransformation = PasswordVisualTransformation(), singleLine = true)
|
||||||
@@ -213,7 +212,7 @@ fun SignupView(server: String?, error: String?, onSwitchLogin: () -> Unit, onSig
|
|||||||
Column(Modifier.padding(5.dp).widthIn(min = 250.dp).width(IntrinsicSize.Min), horizontalAlignment = Alignment.CenterHorizontally) {
|
Column(Modifier.padding(5.dp).widthIn(min = 250.dp).width(IntrinsicSize.Min), horizontalAlignment = Alignment.CenterHorizontally) {
|
||||||
Text("Sign up", style = MaterialTheme.typography.headlineMedium)
|
Text("Sign up", style = MaterialTheme.typography.headlineMedium)
|
||||||
|
|
||||||
OutlinedTextField(serverUrl, { serverUrl = it }, Modifier.fillMaxWidth(), label = { Text("Server URL") }, singleLine = true)
|
ServerSelect(serverUrl) { serverUrl = it }
|
||||||
|
|
||||||
OutlinedTextField(inviteCode, { inviteCode = it }, Modifier.fillMaxWidth(), label = { Text("Invite code") }, singleLine = true)
|
OutlinedTextField(inviteCode, { inviteCode = it }, Modifier.fillMaxWidth(), label = { Text("Invite code") }, singleLine = true)
|
||||||
OutlinedTextField(username, { username = it }, Modifier.fillMaxWidth(), label = { Text("Username") }, singleLine = true)
|
OutlinedTextField(username, { username = it }, Modifier.fillMaxWidth(), label = { Text("Username") }, singleLine = true)
|
||||||
|
|||||||
+43
-39
@@ -77,47 +77,49 @@ fun ProjectView(id: Uuid, forceBack: () -> Unit) {
|
|||||||
Box(Modifier.fillMaxSize().padding(15.dp)) {
|
Box(Modifier.fillMaxSize().padding(15.dp)) {
|
||||||
ProjectPlotArea(vm)
|
ProjectPlotArea(vm)
|
||||||
|
|
||||||
if(addOpen) {
|
if(editable) {
|
||||||
CompositionLocalProvider(LocalIndication provides NoFeedbackIndication()) {
|
|
||||||
Box(Modifier.clickable { addOpen = false }.fillMaxSize())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Column(Modifier.align(Alignment.BottomEnd).padding(25.dp), horizontalAlignment = Alignment.End) {
|
|
||||||
if(addOpen) {
|
if(addOpen) {
|
||||||
var lblWidth by mutableStateOf(1000.dp)
|
CompositionLocalProvider(LocalIndication provides NoFeedbackIndication()) {
|
||||||
var dataWidth by mutableStateOf(1000.dp)
|
Box(Modifier.clickable { addOpen = false }.fillMaxSize())
|
||||||
val density = LocalDensity.current
|
|
||||||
|
|
||||||
Column(Modifier.width(maxOf(lblWidth, dataWidth)), horizontalAlignment = Alignment.End) {
|
|
||||||
Surface(Modifier.onGloballyPositioned {
|
|
||||||
lblWidth = with(density) { it.size.width.toDp() }
|
|
||||||
}, shape = MaterialTheme.shapes.small, shadowElevation = 10.dp) {
|
|
||||||
Row(Modifier.clickable { addingLabel = true }.padding(15.dp)) {
|
|
||||||
Icon(Lucide.CaseSensitive, "Add label")
|
|
||||||
Spacer(Modifier.width(5.dp))
|
|
||||||
Text("Label")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Spacer(Modifier.height(10.dp))
|
|
||||||
|
|
||||||
Surface(Modifier.onGloballyPositioned {
|
|
||||||
dataWidth = with(density) { it.size.width.toDp() }
|
|
||||||
}, shape = MaterialTheme.shapes.small, shadowElevation = 10.dp) {
|
|
||||||
Row(Modifier.clickable { addingData = true }.padding(15.dp)) {
|
|
||||||
Icon(Lucide.ChartLine, "Add data")
|
|
||||||
Spacer(Modifier.width(5.dp))
|
|
||||||
Text("Data")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Spacer(Modifier.height(15.dp))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IconButton({ addOpen = !addOpen }, Modifier.scale(1.5f), shape = MaterialTheme.shapes.medium) {
|
Column(Modifier.align(Alignment.BottomEnd).padding(25.dp), horizontalAlignment = Alignment.End) {
|
||||||
Icon(if(addOpen) Lucide.X else Lucide.Plus, if(addOpen) "Add data" else "Close menu")
|
if (addOpen) {
|
||||||
|
var lblWidth by mutableStateOf(1000.dp)
|
||||||
|
var dataWidth by mutableStateOf(1000.dp)
|
||||||
|
val density = LocalDensity.current
|
||||||
|
|
||||||
|
Column(Modifier.width(maxOf(lblWidth, dataWidth)), horizontalAlignment = Alignment.End) {
|
||||||
|
Surface(Modifier.onGloballyPositioned {
|
||||||
|
lblWidth = with(density) { it.size.width.toDp() }
|
||||||
|
}, shape = MaterialTheme.shapes.small, shadowElevation = 10.dp) {
|
||||||
|
Row(Modifier.clickable { addingLabel = true }.padding(15.dp)) {
|
||||||
|
Icon(Lucide.CaseSensitive, "Add label")
|
||||||
|
Spacer(Modifier.width(5.dp))
|
||||||
|
Text("Label")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer(Modifier.height(10.dp))
|
||||||
|
|
||||||
|
Surface(Modifier.onGloballyPositioned {
|
||||||
|
dataWidth = with(density) { it.size.width.toDp() }
|
||||||
|
}, shape = MaterialTheme.shapes.small, shadowElevation = 10.dp) {
|
||||||
|
Row(Modifier.clickable { addingData = true }.padding(15.dp)) {
|
||||||
|
Icon(Lucide.ChartLine, "Add data")
|
||||||
|
Spacer(Modifier.width(5.dp))
|
||||||
|
Text("Data")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Spacer(Modifier.height(15.dp))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
IconButton({ addOpen = !addOpen }, Modifier.scale(1.5f), shape = MaterialTheme.shapes.medium) {
|
||||||
|
Icon(if (addOpen) Lucide.X else Lucide.Plus, if (addOpen) "Add data" else "Close menu")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -621,8 +623,10 @@ fun ProjectPlotArea(vm: ProjectVM){
|
|||||||
}
|
}
|
||||||
else Icon(Lucide.RulerDimensionLine, "Use as baseline")
|
else Icon(Lucide.RulerDimensionLine, "Use as baseline")
|
||||||
}
|
}
|
||||||
IconButton({ deletingVersion = lbl }, Modifier.align(Alignment.CenterVertically)) {
|
if(editable) {
|
||||||
Icon(Lucide.Trash, "Delete version")
|
IconButton({ deletingVersion = lbl }, Modifier.align(Alignment.CenterVertically)) {
|
||||||
|
Icon(Lucide.Trash, "Delete version")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user