color for icons in reader

close #107
This commit is contained in:
Cuong-Tran 2024-06-23 00:32:47 +07:00
parent 2bbda8c0bd
commit c8c4ad7be6
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2
4 changed files with 51 additions and 7 deletions

View file

@ -68,6 +68,10 @@ fun MangaCoverDialog(
modifier: Modifier = Modifier,
// KMK <--
) {
// KMK -->
val iconColor = contentColorFor(MaterialTheme.colorScheme.secondaryContainer)
val dropdownBgColor = MaterialTheme.colorScheme.surfaceVariant
// KMK <--
Dialog(
onDismissRequest = onDismissRequest,
properties = DialogProperties(
@ -94,7 +98,7 @@ fun MangaCoverDialog(
imageVector = Icons.Outlined.Close,
contentDescription = stringResource(MR.strings.action_close),
// KMK -->
tint = contentColorFor(MaterialTheme.colorScheme.secondaryContainer),
tint = iconColor,
// KMK <--
)
}
@ -108,7 +112,7 @@ fun MangaCoverDialog(
icon = Icons.Outlined.Share,
onClick = onShareClick,
// KMK -->
iconTint = contentColorFor(MaterialTheme.colorScheme.secondaryContainer),
iconTint = iconColor,
// KMK <--
),
AppBar.Action(
@ -116,7 +120,7 @@ fun MangaCoverDialog(
icon = Icons.Outlined.Save,
onClick = onSaveClick,
// KMK -->
iconTint = contentColorFor(MaterialTheme.colorScheme.secondaryContainer),
iconTint = iconColor,
// KMK <--
),
),
@ -137,7 +141,7 @@ fun MangaCoverDialog(
imageVector = Icons.Outlined.Edit,
contentDescription = stringResource(MR.strings.action_edit_cover),
// KMK -->
tint = contentColorFor(MaterialTheme.colorScheme.secondaryContainer),
tint = iconColor,
// KMK <--
)
}
@ -146,7 +150,7 @@ fun MangaCoverDialog(
onDismissRequest = { expanded = false },
offset = DpOffset(8.dp, 0.dp),
// KMK -->
modifier = Modifier.background(MaterialTheme.colorScheme.surfaceVariant),
modifier = Modifier.background(dropdownBgColor),
// KMK <--
) {
DropdownMenuItem(
@ -157,7 +161,7 @@ fun MangaCoverDialog(
},
// KMK -->
colors = MenuDefaults.itemColors().copy(
textColor = contentColorFor(MaterialTheme.colorScheme.surfaceVariant),
textColor = contentColorFor(dropdownBgColor),
),
// KMK <--
)
@ -169,7 +173,7 @@ fun MangaCoverDialog(
},
// KMK -->
colors = MenuDefaults.itemColors().copy(
textColor = contentColorFor(MaterialTheme.colorScheme.surfaceVariant),
textColor = contentColorFor(dropdownBgColor),
),
// KMK <--
)

View file

@ -12,6 +12,7 @@ import androidx.compose.material.icons.outlined.Settings
import androidx.compose.material.icons.outlined.Share
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
@ -51,6 +52,9 @@ fun BottomReaderBar(
onClickShiftPage: () -> Unit,
// SY <--
) {
// KMK -->
val iconColor = MaterialTheme.colorScheme.primary
// KMK <--
Row(
modifier = Modifier
.fillMaxWidth()
@ -65,6 +69,9 @@ fun BottomReaderBar(
Icon(
imageVector = Icons.Outlined.FormatListNumbered,
contentDescription = stringResource(MR.strings.chapters),
// KMK -->
tint = iconColor,
// KMK <--
)
}
}
@ -74,6 +81,9 @@ fun BottomReaderBar(
Icon(
imageVector = Icons.Outlined.Public,
contentDescription = stringResource(MR.strings.action_open_in_web_view),
// KMK -->
tint = iconColor,
// KMK <--
)
}
}
@ -83,6 +93,9 @@ fun BottomReaderBar(
Icon(
imageVector = Icons.Outlined.Share,
contentDescription = stringResource(MR.strings.action_share),
// KMK -->
tint = iconColor,
// KMK <--
)
}
}
@ -92,6 +105,9 @@ fun BottomReaderBar(
Icon(
painter = painterResource(readingMode.iconRes),
contentDescription = stringResource(MR.strings.viewer),
// KMK -->
tint = iconColor,
// KMK <--
)
}
}
@ -101,6 +117,9 @@ fun BottomReaderBar(
Icon(
imageVector = orientation.icon,
contentDescription = stringResource(MR.strings.pref_rotation_type),
// KMK -->
tint = iconColor,
// KMK <--
)
}
}
@ -117,6 +136,9 @@ fun BottomReaderBar(
if (cropEnabled) R.drawable.ic_crop_24dp else R.drawable.ic_crop_off_24dp,
),
contentDescription = stringResource(MR.strings.pref_crop_borders),
// KMK -->
tint = iconColor,
// KMK <--
)
}
}
@ -130,6 +152,9 @@ fun BottomReaderBar(
Icon(
painter = painterResource(R.drawable.ic_book_open_variant_24dp),
contentDescription = stringResource(SYMR.strings.page_layout),
// KMK -->
tint = iconColor,
// KMK <--
)
}
}
@ -139,6 +164,9 @@ fun BottomReaderBar(
Icon(
painter = painterResource(R.drawable.ic_page_next_outline_24dp),
contentDescription = stringResource(SYMR.strings.shift_double_pages),
// KMK -->
tint = iconColor,
// KMK <--
)
}
}
@ -147,6 +175,9 @@ fun BottomReaderBar(
Icon(
imageVector = Icons.Outlined.Settings,
contentDescription = stringResource(MR.strings.action_settings),
// KMK -->
tint = iconColor,
// KMK <--
)
}
// SY <--

View file

@ -234,6 +234,9 @@ fun ExhUtils(
Icons.Outlined.KeyboardArrowDown
},
contentDescription = null,
// KMK -->
tint = MaterialTheme.colorScheme.primary,
// KMK <--
)
}
}

View file

@ -86,6 +86,9 @@ fun ChapterNavigator(
val buttonColor = IconButtonDefaults.filledIconButtonColors(
containerColor = backgroundColor,
disabledContainerColor = backgroundColor,
// KMK -->
contentColor = MaterialTheme.colorScheme.primary,
// KMK <--
)
// We explicitly handle direction based on the reader viewer rather than the system direction
@ -198,6 +201,9 @@ fun ChapterNavigatorVert(
val buttonColor = IconButtonDefaults.filledIconButtonColors(
containerColor = backgroundColor,
disabledContainerColor = backgroundColor,
// KMK -->
contentColor = MaterialTheme.colorScheme.primary,
// KMK <--
)
FilledIconButton(
enabled = enabledPrevious,