Tweak colors of drop down menu.
This commit is contained in:
parent
5807c1dc85
commit
beb78be082
3 changed files with 31 additions and 5 deletions
|
|
@ -59,6 +59,7 @@ import io.element.android.libraries.matrix.api.user.MatrixUser
|
||||||
import io.element.android.libraries.matrix.ui.model.getAvatarData
|
import io.element.android.libraries.matrix.ui.model.getAvatarData
|
||||||
import io.element.android.libraries.testtags.TestTags
|
import io.element.android.libraries.testtags.TestTags
|
||||||
import io.element.android.libraries.testtags.testTag
|
import io.element.android.libraries.testtags.testTag
|
||||||
|
import io.element.android.libraries.theme.ElementTheme
|
||||||
import io.element.android.libraries.ui.strings.CommonStrings
|
import io.element.android.libraries.ui.strings.CommonStrings
|
||||||
|
|
||||||
@OptIn(ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalMaterial3Api::class)
|
||||||
|
|
@ -138,12 +139,20 @@ private fun DefaultRoomListTopBar(
|
||||||
IconButton(
|
IconButton(
|
||||||
onClick = onSearchClicked,
|
onClick = onSearchClicked,
|
||||||
) {
|
) {
|
||||||
Icon(Icons.Default.Search, contentDescription = stringResource(CommonStrings.action_search))
|
Icon(
|
||||||
|
imageVector = Icons.Default.Search,
|
||||||
|
tint = ElementTheme.materialColors.secondary,
|
||||||
|
contentDescription = stringResource(CommonStrings.action_search),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
IconButton(
|
IconButton(
|
||||||
onClick = { showMenu = !showMenu }
|
onClick = { showMenu = !showMenu }
|
||||||
) {
|
) {
|
||||||
Icon(Icons.Default.MoreVert, contentDescription = null)
|
Icon(
|
||||||
|
imageVector = Icons.Default.MoreVert,
|
||||||
|
tint = ElementTheme.materialColors.secondary,
|
||||||
|
contentDescription = null,
|
||||||
|
)
|
||||||
}
|
}
|
||||||
DropdownMenu(
|
DropdownMenu(
|
||||||
expanded = showMenu,
|
expanded = showMenu,
|
||||||
|
|
@ -155,7 +164,13 @@ private fun DefaultRoomListTopBar(
|
||||||
onMenuActionClicked(RoomListMenuAction.InviteFriends)
|
onMenuActionClicked(RoomListMenuAction.InviteFriends)
|
||||||
},
|
},
|
||||||
text = { DropdownMenuItemText(stringResource(id = CommonStrings.action_invite)) },
|
text = { DropdownMenuItemText(stringResource(id = CommonStrings.action_invite)) },
|
||||||
leadingIcon = { Icon(Icons.Outlined.Share, contentDescription = null) }
|
leadingIcon = {
|
||||||
|
Icon(
|
||||||
|
Icons.Outlined.Share,
|
||||||
|
tint = ElementTheme.materialColors.secondary,
|
||||||
|
contentDescription = null,
|
||||||
|
)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
DropdownMenuItem(
|
DropdownMenuItem(
|
||||||
onClick = {
|
onClick = {
|
||||||
|
|
@ -163,7 +178,13 @@ private fun DefaultRoomListTopBar(
|
||||||
onMenuActionClicked(RoomListMenuAction.ReportBug)
|
onMenuActionClicked(RoomListMenuAction.ReportBug)
|
||||||
},
|
},
|
||||||
text = { DropdownMenuItemText(stringResource(id = CommonStrings.common_report_a_bug)) },
|
text = { DropdownMenuItemText(stringResource(id = CommonStrings.common_report_a_bug)) },
|
||||||
leadingIcon = { Icon(Icons.Outlined.BugReport, contentDescription = null) }
|
leadingIcon = {
|
||||||
|
Icon(
|
||||||
|
Icons.Outlined.BugReport,
|
||||||
|
tint = ElementTheme.materialColors.secondary,
|
||||||
|
contentDescription = null,
|
||||||
|
)
|
||||||
|
}
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package io.element.android.libraries.designsystem.theme.components
|
package io.element.android.libraries.designsystem.theme.components
|
||||||
|
|
||||||
|
import androidx.compose.foundation.background
|
||||||
import androidx.compose.foundation.layout.ColumnScope
|
import androidx.compose.foundation.layout.ColumnScope
|
||||||
import androidx.compose.foundation.layout.widthIn
|
import androidx.compose.foundation.layout.widthIn
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
|
@ -23,6 +24,7 @@ import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.unit.DpOffset
|
import androidx.compose.ui.unit.DpOffset
|
||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import androidx.compose.ui.window.PopupProperties
|
import androidx.compose.ui.window.PopupProperties
|
||||||
|
import io.element.android.libraries.theme.ElementTheme
|
||||||
|
|
||||||
private val minMenuWidth = 200.dp
|
private val minMenuWidth = 200.dp
|
||||||
|
|
||||||
|
|
@ -39,7 +41,9 @@ fun DropdownMenu(
|
||||||
androidx.compose.material3.DropdownMenu(
|
androidx.compose.material3.DropdownMenu(
|
||||||
expanded = expanded,
|
expanded = expanded,
|
||||||
onDismissRequest = onDismissRequest,
|
onDismissRequest = onDismissRequest,
|
||||||
modifier = modifier.widthIn(min = minMenuWidth),
|
modifier = modifier
|
||||||
|
.background(color = ElementTheme.materialColors.background)
|
||||||
|
.widthIn(min = minMenuWidth),
|
||||||
offset = offset,
|
offset = offset,
|
||||||
properties = properties,
|
properties = properties,
|
||||||
content = content
|
content = content
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ fun DropdownMenuItem(
|
||||||
fun DropdownMenuItemText(text: String) {
|
fun DropdownMenuItemText(text: String) {
|
||||||
Text(
|
Text(
|
||||||
text = text,
|
text = text,
|
||||||
|
color = ElementTheme.materialColors.primary,
|
||||||
style = ElementTheme.typography.fontBodyLgRegular
|
style = ElementTheme.typography.fontBodyLgRegular
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue