mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-24 23:15:35 -04:00
Accessibility update
This commit is contained in:
parent
be8014c97a
commit
3b1cb53b8a
55 changed files with 1089 additions and 807 deletions
|
@ -95,19 +95,15 @@ class _DrawerMenuState extends State<DrawerMenu> {
|
|||
activeBorder = scale.primary;
|
||||
}
|
||||
|
||||
final avatar = AvatarWidget(
|
||||
final avatar = StyledAvatar(
|
||||
name: name,
|
||||
size: 34,
|
||||
borderColor: border,
|
||||
foregroundColor: loggedIn ? scale.primaryText : scale.subtleText,
|
||||
backgroundColor: loggedIn ? scale.primary : scale.elementBackground,
|
||||
scaleConfig: scaleConfig,
|
||||
textStyle: theme.textTheme.titleLarge!,
|
||||
size: 34.scaled(context),
|
||||
);
|
||||
|
||||
return AnimatedPadding(
|
||||
padding: EdgeInsets.fromLTRB(selected ? 0 : 8, selected ? 0 : 2,
|
||||
selected ? 0 : 8, selected ? 0 : 2),
|
||||
selected ? 0 : 8, selected ? 0 : 2)
|
||||
.scaled(context),
|
||||
duration: const Duration(milliseconds: 50),
|
||||
child: MenuItemWidget(
|
||||
title: name,
|
||||
|
@ -144,7 +140,7 @@ class _DrawerMenuState extends State<DrawerMenu> {
|
|||
(scaleConfig.preferBorders || scaleConfig.useVisualIndicators)
|
||||
? null
|
||||
: activeBorder,
|
||||
minHeight: 48,
|
||||
minHeight: 48.scaled(context),
|
||||
));
|
||||
}
|
||||
|
||||
|
@ -196,7 +192,8 @@ class _DrawerMenuState extends State<DrawerMenu> {
|
|||
color: scaleScheme.errorScale.subtleBorder,
|
||||
borderRadius: 12 * scaleConfig.borderRadiusScale),
|
||||
);
|
||||
loggedInAccounts.add(loggedInAccount.paddingLTRB(0, 0, 0, 8));
|
||||
loggedInAccounts
|
||||
.add(loggedInAccount.paddingLTRB(0, 0, 0, 8.scaled(context)));
|
||||
} else {
|
||||
// Account is not logged in
|
||||
final scale = theme.extension<ScaleScheme>()!.grayScale;
|
||||
|
@ -246,8 +243,8 @@ class _DrawerMenuState extends State<DrawerMenu> {
|
|||
}
|
||||
return IconButton(
|
||||
icon: icon,
|
||||
padding: const EdgeInsets.all(12),
|
||||
color: border,
|
||||
constraints: const BoxConstraints.expand(height: 48, width: 48),
|
||||
style: ButtonStyle(
|
||||
backgroundColor: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.hovered)) {
|
||||
|
@ -286,7 +283,10 @@ class _DrawerMenuState extends State<DrawerMenu> {
|
|||
final scale = scaleScheme.scale(_scaleKind);
|
||||
|
||||
final settingsButton = _getButton(
|
||||
icon: const Icon(Icons.settings),
|
||||
icon: const Icon(
|
||||
Icons.settings,
|
||||
applyTextScaling: true,
|
||||
),
|
||||
tooltip: translate('menu.settings_tooltip'),
|
||||
scale: scale,
|
||||
scaleConfig: scaleConfig,
|
||||
|
@ -295,7 +295,10 @@ class _DrawerMenuState extends State<DrawerMenu> {
|
|||
}).paddingLTRB(0, 0, 16, 0);
|
||||
|
||||
final addButton = _getButton(
|
||||
icon: const Icon(Icons.add),
|
||||
icon: const Icon(
|
||||
Icons.add,
|
||||
applyTextScaling: true,
|
||||
),
|
||||
tooltip: translate('menu.add_account_tooltip'),
|
||||
scale: scale,
|
||||
scaleConfig: scaleConfig,
|
||||
|
@ -364,7 +367,7 @@ class _DrawerMenuState extends State<DrawerMenu> {
|
|||
// : null)
|
||||
// .paddingLTRB(0, 0, 16, 0),
|
||||
GestureDetector(
|
||||
onLongPress: () async {
|
||||
onLongPress: () {
|
||||
context
|
||||
.findAncestorWidgetOfExactType<KeyboardShortcuts>()!
|
||||
.reloadTheme(context);
|
||||
|
|
|
@ -2,6 +2,8 @@ import 'package:awesome_extensions/awesome_extensions.dart';
|
|||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../../../theme/views/preferences/preferences.dart';
|
||||
|
||||
class MenuItemWidget extends StatelessWidget {
|
||||
const MenuItemWidget({
|
||||
required this.title,
|
||||
|
@ -81,7 +83,7 @@ class MenuItemWidget extends StatelessWidget {
|
|||
hoverColor: footerButtonIconHoverColor,
|
||||
icon: Icon(
|
||||
footerButtonIcon,
|
||||
size: 24,
|
||||
size: 24.scaled(context),
|
||||
),
|
||||
onPressed: footerCallback),
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue