Fix AppTheme not applied to some widget

This commit is contained in:
Ming Ming 2021-08-30 18:14:16 +08:00
parent 43aa12ed57
commit 5ab3698490
3 changed files with 57 additions and 50 deletions

View file

@ -73,29 +73,31 @@ class _AccountPickerDialogState extends State<AccountPickerDialog> {
),
),
];
return SimpleDialog(
title: ListTile(
dense: true,
title: Text(
widget.account.url,
style: const TextStyle(fontWeight: FontWeight.bold),
),
subtitle: Text(
widget.account.username,
style: const TextStyle(fontWeight: FontWeight.bold),
),
trailing: IconButton(
icon: Icon(
Icons.edit,
color: AppTheme.getSecondaryTextColor(context),
return AppTheme(
child: SimpleDialog(
title: ListTile(
dense: true,
title: Text(
widget.account.url,
style: const TextStyle(fontWeight: FontWeight.bold),
),
subtitle: Text(
widget.account.username,
style: const TextStyle(fontWeight: FontWeight.bold),
),
trailing: IconButton(
icon: Icon(
Icons.edit,
color: AppTheme.getSecondaryTextColor(context),
),
tooltip: L10n.global().editTooltip,
onPressed: () => _onEditPressed(),
),
tooltip: L10n.global().editTooltip,
onPressed: () => _onEditPressed(),
),
titlePadding: const EdgeInsetsDirectional.fromSTEB(8, 16, 8, 0),
contentPadding: const EdgeInsetsDirectional.fromSTEB(0, 12, 0, 8),
children: otherAccountOptions + addAccountOptions,
),
titlePadding: const EdgeInsetsDirectional.fromSTEB(8, 16, 8, 0),
contentPadding: const EdgeInsetsDirectional.fromSTEB(0, 12, 0, 8),
children: otherAccountOptions + addAccountOptions,
);
}
@ -143,8 +145,7 @@ class _AccountPickerDialogState extends State<AccountPickerDialog> {
// the app passwords are unique to each entry, but just in case
Navigator.of(context).pop();
SnackBarManager().showSnackBar(SnackBar(
content:
Text(L10n.global().editAccountConflictFailureNotification),
content: Text(L10n.global().editAccountConflictFailureNotification),
duration: k.snackBarDurationNormal,
));
return;

View file

@ -198,23 +198,26 @@ class _SettingsState extends State<Settings> {
if (value) {
showDialog(
context: context,
builder: (context) => AlertDialog(
title: Text(L10n.global().exifSupportConfirmationDialogTitle),
content: Text(L10n.global().exifSupportDetails),
actions: <Widget>[
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child: Text(MaterialLocalizations.of(context).cancelButtonLabel),
),
TextButton(
onPressed: () {
Navigator.of(context).pop(true);
},
child: Text(L10n.global().enableButtonLabel),
),
],
builder: (context) => AppTheme(
child: AlertDialog(
title: Text(L10n.global().exifSupportConfirmationDialogTitle),
content: Text(L10n.global().exifSupportDetails),
actions: <Widget>[
TextButton(
onPressed: () {
Navigator.of(context).pop();
},
child:
Text(MaterialLocalizations.of(context).cancelButtonLabel),
),
TextButton(
onPressed: () {
Navigator.of(context).pop(true);
},
child: Text(L10n.global().enableButtonLabel),
),
],
),
),
).then((value) {
if (value == true) {

View file

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:nc_photos/app_localizations.dart';
import 'package:nc_photos/theme.dart';
class ZoomMenuButton extends StatelessWidget {
ZoomMenuButton({
@ -67,17 +68,19 @@ class _PopupMenuZoomState extends State<_PopupMenuZoom> {
@override
build(BuildContext context) {
return Slider(
value: _value.toDouble(),
min: widget.minValue.toDouble(),
max: widget.maxValue.toDouble(),
divisions: (widget.maxValue - widget.minValue).round(),
onChanged: (value) {
setState(() {
_value = value.round();
});
widget.onChanged?.call(_value);
},
return AppTheme(
child: Slider(
value: _value.toDouble(),
min: widget.minValue.toDouble(),
max: widget.maxValue.toDouble(),
divisions: (widget.maxValue - widget.minValue).round(),
onChanged: (value) {
setState(() {
_value = value.round();
});
widget.onChanged?.call(_value);
},
),
);
}