dark theme disabled button color, disabled combox color

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-03-01 16:30:39 +08:00
parent 7b80269dab
commit d1f58a444d
2 changed files with 22 additions and 7 deletions

View File

@ -218,19 +218,30 @@ class MyTheme {
labelColor: Colors.white70, labelColor: Colors.white70,
), ),
scrollbarTheme: ScrollbarThemeData( scrollbarTheme: ScrollbarThemeData(
thumbColor: MaterialStateProperty.all(Colors.grey[500]) thumbColor: MaterialStateProperty.all(Colors.grey[500]),
), ),
splashColor: Colors.transparent, splashColor: Colors.transparent,
highlightColor: Colors.transparent, highlightColor: Colors.transparent,
splashFactory: isDesktop ? NoSplash.splashFactory : null, splashFactory: isDesktop ? NoSplash.splashFactory : null,
outlinedButtonTheme: OutlinedButtonThemeData( outlinedButtonTheme: OutlinedButtonThemeData(
style: style: OutlinedButton.styleFrom(
OutlinedButton.styleFrom(side: BorderSide(color: Colors.white38))), side: BorderSide(color: Colors.white38),
disabledForegroundColor: Colors.white70,
),
),
textButtonTheme: isDesktop textButtonTheme: isDesktop
? TextButtonThemeData( ? TextButtonThemeData(
style: ButtonStyle(splashFactory: NoSplash.splashFactory), style: TextButton.styleFrom(
) splashFactory: NoSplash.splashFactory,
disabledForegroundColor: Colors.white70,
))
: null, : null,
elevatedButtonTheme: ElevatedButtonThemeData(
style: ElevatedButton.styleFrom(
disabledForegroundColor: Colors.white70,
disabledBackgroundColor: Colors.white10,
),
),
checkboxTheme: checkboxTheme:
const CheckboxThemeData(checkColor: MaterialStatePropertyAll(dark)), const CheckboxThemeData(checkColor: MaterialStatePropertyAll(dark)),
colorScheme: ColorScheme.fromSwatch( colorScheme: ColorScheme.fromSwatch(

View File

@ -538,6 +538,7 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
translate('Screen Share'), translate('Screen Share'),
translate('Deny remote access'), translate('Deny remote access'),
], ],
enabled: enabled,
initialKey: initialKey, initialKey: initialKey,
onChanged: (mode) async { onChanged: (mode) async {
String modeValue; String modeValue;
@ -667,6 +668,7 @@ class _SafetyState extends State<_Safety> with AutomaticKeepAliveClientMixin {
return _Card(title: 'Password', children: [ return _Card(title: 'Password', children: [
_ComboBox( _ComboBox(
enabled: !locked,
keys: modeKeys, keys: modeKeys,
values: modeValues, values: modeValues,
initialKey: modeInitialKey, initialKey: modeInitialKey,
@ -1722,7 +1724,6 @@ class _ComboBox extends StatelessWidget {
required this.values, required this.values,
required this.initialKey, required this.initialKey,
required this.onChanged, required this.onChanged,
// ignore: unused_element
this.enabled = true, this.enabled = true,
}) : super(key: key); }) : super(key: key);
@ -1735,7 +1736,9 @@ class _ComboBox extends StatelessWidget {
var ref = values[index].obs; var ref = values[index].obs;
current = keys[index]; current = keys[index];
return Container( return Container(
decoration: BoxDecoration(border: Border.all(color: MyTheme.border)), decoration: BoxDecoration(
border: Border.all(
color: _disabledTextColor(context, enabled) ?? MyTheme.border)),
height: 30, height: 30,
child: Obx(() => DropdownButton<String>( child: Obx(() => DropdownButton<String>(
isExpanded: true, isExpanded: true,
@ -1744,6 +1747,7 @@ class _ComboBox extends StatelessWidget {
underline: Container( underline: Container(
height: 25, height: 25,
), ),
style: TextStyle(color: _disabledTextColor(context, enabled)),
icon: const Icon( icon: const Icon(
Icons.expand_more_sharp, Icons.expand_more_sharp,
size: 20, size: 20,