This commit is contained in:
callebtc
2025-07-12 02:37:51 +02:00
parent 83da8f3b1b
commit 006ac7e78a
@@ -201,19 +201,16 @@ private fun PrivateChatHeader(
val colorScheme = MaterialTheme.colorScheme val colorScheme = MaterialTheme.colorScheme
val peerNickname = peerNicknames[peerID] ?: peerID val peerNickname = peerNicknames[peerID] ?: peerID
Row( Box(modifier = Modifier.fillMaxWidth()) {
modifier = Modifier.fillMaxWidth(), // Back button - positioned on the left
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
// Fixed: Make back button wider to prevent text cropping
Button( Button(
onClick = onBackClick, onClick = onBackClick,
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
containerColor = Color.Transparent, containerColor = Color.Transparent,
contentColor = colorScheme.primary contentColor = colorScheme.primary
), ),
contentPadding = PaddingValues(horizontal = 12.dp, vertical = 4.dp) contentPadding = PaddingValues(horizontal = 12.dp, vertical = 4.dp),
modifier = Modifier.align(Alignment.CenterStart)
) { ) {
Row( Row(
verticalAlignment = Alignment.CenterVertically verticalAlignment = Alignment.CenterVertically
@@ -233,9 +230,11 @@ private fun PrivateChatHeader(
} }
} }
Spacer(modifier = Modifier.weight(1f)) // Title - perfectly centered regardless of other elements
Row(
Row(verticalAlignment = Alignment.CenterVertically) { verticalAlignment = Alignment.CenterVertically,
modifier = Modifier.align(Alignment.Center)
) {
Icon( Icon(
imageVector = Icons.Filled.Lock, imageVector = Icons.Filled.Lock,
contentDescription = "Private chat", contentDescription = "Private chat",
@@ -250,10 +249,11 @@ private fun PrivateChatHeader(
) )
} }
Spacer(modifier = Modifier.weight(1f)) // Favorite button - positioned on the right
IconButton(
// Favorite button with proper filled/outlined star onClick = onToggleFavorite,
IconButton(onClick = onToggleFavorite) { modifier = Modifier.align(Alignment.CenterEnd)
) {
Icon( Icon(
imageVector = if (isFavorite) Icons.Filled.Star else Icons.Outlined.Star, imageVector = if (isFavorite) Icons.Filled.Star else Icons.Outlined.Star,
contentDescription = if (isFavorite) "Remove from favorites" else "Add to favorites", contentDescription = if (isFavorite) "Remove from favorites" else "Add to favorites",
@@ -273,19 +273,16 @@ private fun ChannelHeader(
) { ) {
val colorScheme = MaterialTheme.colorScheme val colorScheme = MaterialTheme.colorScheme
Row( Box(modifier = Modifier.fillMaxWidth()) {
modifier = Modifier.fillMaxWidth(), // Back button - positioned on the left
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
// Use same back button style as DM header (Button instead of IconButton)
Button( Button(
onClick = onBackClick, onClick = onBackClick,
colors = ButtonDefaults.buttonColors( colors = ButtonDefaults.buttonColors(
containerColor = Color.Transparent, containerColor = Color.Transparent,
contentColor = colorScheme.primary contentColor = colorScheme.primary
), ),
contentPadding = PaddingValues(horizontal = 12.dp, vertical = 4.dp) contentPadding = PaddingValues(horizontal = 12.dp, vertical = 4.dp),
modifier = Modifier.align(Alignment.CenterStart)
) { ) {
Row( Row(
verticalAlignment = Alignment.CenterVertically verticalAlignment = Alignment.CenterVertically
@@ -305,19 +302,21 @@ private fun ChannelHeader(
} }
} }
Spacer(modifier = Modifier.weight(1f)) // Title - perfectly centered regardless of other elements
// Centered title with orange color to match DM input field
Text( Text(
text = "channel: $channel", text = "channel: $channel",
style = MaterialTheme.typography.titleMedium, style = MaterialTheme.typography.titleMedium,
color = Color(0xFFFF8C00), // Orange to match input field color = Color(0xFFFF8C00), // Orange to match input field
modifier = Modifier.clickable { onSidebarClick() } modifier = Modifier
.align(Alignment.Center)
.clickable { onSidebarClick() }
) )
Spacer(modifier = Modifier.weight(1f)) // Leave button - positioned on the right
TextButton(
TextButton(onClick = onLeaveChannel) { onClick = onLeaveChannel,
modifier = Modifier.align(Alignment.CenterEnd)
) {
Text( Text(
text = "leave", text = "leave",
style = MaterialTheme.typography.bodySmall, style = MaterialTheme.typography.bodySmall,