mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-28 09:25:09 +00:00
Section + ChatListNavLink.android: align in-card chat row divider with desktop; canvas to 0.94
Two changes: 1) Theme.kt LIGHT canvas: 0.97f → 0.94f (#F0F0F0). User wants more contrast against cards. With Material's default 0.04-alpha hover (#F5F5F5) this puts hover LIGHTER than canvas by 5 units — unusual direction but it's the user's call; they'll evaluate visually. 2) ChatListNavLinkView.android: when rendered inside a SectionView card (e.g. contact list inside NewChatSheet after the forEach-into-card refactor), use SectionDivider() — same 2dp full-width canvas-color divider as desktop. Outside a card (main chat list), fall back to the original Material `Divider(Modifier.padding(horizontal = 8.dp))` so unchanged for that context. 3) LocalInSectionCard made `internal` so the android-specific file can read it. Same pattern as LocalAppColors etc. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+7
-1
@@ -1,5 +1,6 @@
|
||||
package chat.simplex.common.views.chatlist
|
||||
|
||||
import SectionDivider
|
||||
import androidx.compose.foundation.*
|
||||
import androidx.compose.foundation.layout.*
|
||||
import androidx.compose.material.Divider
|
||||
@@ -8,6 +9,7 @@ import androidx.compose.ui.Alignment
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.unit.dp
|
||||
import chat.simplex.common.platform.onRightClick
|
||||
import chat.simplex.common.views.helpers.LocalInSectionCard
|
||||
import chat.simplex.common.views.helpers.*
|
||||
|
||||
@Composable
|
||||
@@ -38,5 +40,9 @@ actual fun ChatListNavLinkLayout(
|
||||
DefaultDropdownMenu(showMenu, dropdownMenuItems = dropdownMenuItems)
|
||||
}
|
||||
}
|
||||
Divider(Modifier.padding(horizontal = 8.dp))
|
||||
if (LocalInSectionCard.current) {
|
||||
SectionDivider()
|
||||
} else {
|
||||
Divider(Modifier.padding(horizontal = 8.dp))
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -607,7 +607,7 @@ fun canvasColorForCurrentTheme(): Color {
|
||||
val theme = CurrentColors.value
|
||||
val c = theme.colors
|
||||
return when (theme.base) {
|
||||
DefaultTheme.LIGHT -> c.background.mixWith(c.onBackground, 0.97f)
|
||||
DefaultTheme.LIGHT -> c.background.mixWith(c.onBackground, 0.94f)
|
||||
DefaultTheme.SIMPLEX -> c.background.darker(0.4f)
|
||||
else -> c.background
|
||||
}
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ val CARD_ITEM_PADDING = CARD_PADDING - 1.dp
|
||||
// Set to true by SectionView around its inner Column. SectionItemView reads it
|
||||
// to decide whether to draw the 2dp bottom divider. False default keeps
|
||||
// standalone usage (alerts, pickers, custom contexts) unaffected.
|
||||
private val LocalInSectionCard = staticCompositionLocalOf { false }
|
||||
internal val LocalInSectionCard = staticCompositionLocalOf { false }
|
||||
|
||||
|
||||
@Composable
|
||||
|
||||
Reference in New Issue
Block a user