@@ -103,7 +103,7 @@ fun PeerCounter(
103103 imageVector = Icons .Filled .Email ,
104104 contentDescription = " Unread private messages" ,
105105 modifier = Modifier .size(16 .dp),
106- tint = Color (0xFFFF8C00 ) // Orange to match private message theme
106+ tint = Color (0xFFFF9500 ) // Orange to match private message theme
107107 )
108108 Spacer (modifier = Modifier .width(6 .dp))
109109 }
@@ -201,19 +201,18 @@ private fun PrivateChatHeader(
201201 val colorScheme = MaterialTheme .colorScheme
202202 val peerNickname = peerNicknames[peerID] ? : peerID
203203
204- Row (
205- modifier = Modifier .fillMaxWidth(),
206- horizontalArrangement = Arrangement .SpaceBetween ,
207- verticalAlignment = Alignment .CenterVertically
208- ) {
209- // Fixed: Make back button wider to prevent text cropping
204+ Box (modifier = Modifier .fillMaxWidth()) {
205+ // Back button - positioned all the way to the left with minimal margin
210206 Button (
211207 onClick = onBackClick,
212208 colors = ButtonDefaults .buttonColors(
213209 containerColor = Color .Transparent ,
214210 contentColor = colorScheme.primary
215211 ),
216- contentPadding = PaddingValues (horizontal = 12 .dp, vertical = 4 .dp)
212+ contentPadding = PaddingValues (horizontal = 4 .dp, vertical = 4 .dp), // Reduced horizontal padding
213+ modifier = Modifier
214+ .align(Alignment .CenterStart )
215+ .offset(x = (- 8 ).dp) // Move even further left to minimize margin
217216 ) {
218217 Row (
219218 verticalAlignment = Alignment .CenterVertically
@@ -233,27 +232,30 @@ private fun PrivateChatHeader(
233232 }
234233 }
235234
236- Spacer (modifier = Modifier .weight(1f ))
237-
238- Row (verticalAlignment = Alignment .CenterVertically ) {
235+ // Title - perfectly centered regardless of other elements
236+ Row (
237+ verticalAlignment = Alignment .CenterVertically ,
238+ modifier = Modifier .align(Alignment .Center )
239+ ) {
239240 Icon (
240241 imageVector = Icons .Filled .Lock ,
241242 contentDescription = " Private chat" ,
242243 modifier = Modifier .size(16 .dp),
243- tint = Color (0xFFFF8C00 ) // Orange to match private message theme
244+ tint = Color (0xFFFF9500 ) // Orange to match private message theme
244245 )
245246 Spacer (modifier = Modifier .width(4 .dp))
246247 Text (
247248 text = peerNickname,
248249 style = MaterialTheme .typography.titleMedium,
249- color = Color (0xFFFF8C00 ) // Orange
250+ color = Color (0xFFFF9500 ) // Orange
250251 )
251252 }
252253
253- Spacer (modifier = Modifier .weight(1f ))
254-
255- // Favorite button with proper filled/outlined star
256- IconButton (onClick = onToggleFavorite) {
254+ // Favorite button - positioned on the right
255+ IconButton (
256+ onClick = onToggleFavorite,
257+ modifier = Modifier .align(Alignment .CenterEnd )
258+ ) {
257259 Icon (
258260 imageVector = if (isFavorite) Icons .Filled .Star else Icons .Outlined .Star ,
259261 contentDescription = if (isFavorite) " Remove from favorites" else " Add to favorites" ,
@@ -273,12 +275,19 @@ private fun ChannelHeader(
273275) {
274276 val colorScheme = MaterialTheme .colorScheme
275277
276- Row (
277- modifier = Modifier .fillMaxWidth(),
278- horizontalArrangement = Arrangement .SpaceBetween ,
279- verticalAlignment = Alignment .CenterVertically
280- ) {
281- IconButton (onClick = onBackClick) {
278+ Box (modifier = Modifier .fillMaxWidth()) {
279+ // Back button - positioned all the way to the left with minimal margin
280+ Button (
281+ onClick = onBackClick,
282+ colors = ButtonDefaults .buttonColors(
283+ containerColor = Color .Transparent ,
284+ contentColor = colorScheme.primary
285+ ),
286+ contentPadding = PaddingValues (horizontal = 4 .dp, vertical = 4 .dp), // Reduced horizontal padding
287+ modifier = Modifier
288+ .align(Alignment .CenterStart )
289+ .offset(x = (- 8 ).dp) // Move even further left to minimize margin
290+ ) {
282291 Row (
283292 verticalAlignment = Alignment .CenterVertically
284293 ) {
@@ -297,18 +306,21 @@ private fun ChannelHeader(
297306 }
298307 }
299308
300- Spacer (modifier = Modifier .weight(1f ))
301-
309+ // Title - perfectly centered regardless of other elements
302310 Text (
303311 text = " channel: $channel " ,
304312 style = MaterialTheme .typography.titleMedium,
305- color = Color (0xFF0080FF ), // Blue
306- modifier = Modifier .clickable { onSidebarClick() }
313+ color = Color (0xFFFF9500 ), // Orange to match input field
314+ modifier = Modifier
315+ .align(Alignment .Center )
316+ .clickable { onSidebarClick() }
307317 )
308318
309- Spacer (modifier = Modifier .weight(1f ))
310-
311- TextButton (onClick = onLeaveChannel) {
319+ // Leave button - positioned on the right
320+ TextButton (
321+ onClick = onLeaveChannel,
322+ modifier = Modifier .align(Alignment .CenterEnd )
323+ ) {
312324 Text (
313325 text = " leave" ,
314326 style = MaterialTheme .typography.bodySmall,
0 commit comments