Skip to content

Commit

Permalink
fix: error missing key and fix wrong banner color (#924)
Browse files Browse the repository at this point in the history
Fixes #923
  • Loading branch information
Feichtmeier authored Sep 20, 2024
1 parent d0cc369 commit b452e68
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
18 changes: 9 additions & 9 deletions lib/src/theme_widgets/settings_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ class GnomeSettings {

T? _updateValue<T>(String key) {
T? value;
try {
_settings.get(key).then((v) {
value = v.toNative() as T?;
if (_values[key] != value) {
_values[key] = value;
notifyListeners();
}
});
} on GSettingsUnknownKeyException catch (_) {}
_settings.get(key).then((v) {
value = v.toNative() as T?;
if (_values[key] != value) {
_values[key] = value;
notifyListeners();
}
}).catchError((_) {
value = null;
});
return value;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/src/themes/common_themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,7 @@ CardTheme _createCardTheme(ColorScheme colorScheme) {
}

Color _cardColor(ColorScheme colorScheme) =>
colorScheme.surface.scale(lightness: colorScheme.isLight ? -0.1 : 0.08);
colorScheme.surface.scale(lightness: colorScheme.isLight ? -0.05 : 0.05);

/// Helper function to create a new Yaru light theme
ThemeData createYaruLightTheme({
Expand Down
9 changes: 4 additions & 5 deletions lib/src/widgets/yaru_banner.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:yaru/constants.dart';
import 'package:yaru/foundation.dart' show YaruBorderRadiusExtension;
import 'package:yaru/src/colors.dart';

import 'yaru_tile.dart';

Expand Down Expand Up @@ -88,10 +89,8 @@ class YaruBanner extends StatelessWidget {
final theme = Theme.of(context);
final borderRadius = BorderRadius.circular(kYaruBannerRadius);

final light = theme.brightness == Brightness.light;

final defaultSurfaceTintColor =
light ? theme.cardColor : const Color.fromARGB(255, 126, 126, 126);
final defaultSurfaceTintColor = theme.scaffoldBackgroundColor
.scale(lightness: theme.brightness == Brightness.light ? 0 : 0.03);
return Material(
color: selected == true
? theme.primaryColor.withOpacity(0.8)
Expand All @@ -104,7 +103,7 @@ class YaruBanner extends StatelessWidget {
hoverColor: theme.colorScheme.onSurface.withOpacity(0.1),
mouseCursor: mouseCursor,
child: Card(
color: color,
color: color ?? defaultSurfaceTintColor,
shadowColor: Colors.transparent,
surfaceTintColor: surfaceTintColor ?? defaultSurfaceTintColor,
elevation: elevation ?? 1,
Expand Down

0 comments on commit b452e68

Please sign in to comment.