mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-02 14:19:45 +02:00
fix(mornye): soften glass rims and increase transparency
This commit is contained in:
1 parent
788c76c22d
commit
d1eba29a4a
2 files changed
+23
-20
No files matched your search
@@ -45,15 +45,18 @@ class MornyeTheme extends ThemeExtension<MornyeTheme> {
|
||||
);
|
||||
}
|
||||
|
||||
static double chromeOpacity(BuildContext context) =>
|
||||
Theme.of(context).extension<MornyeTheme>()?.chromeSurface != null
|
||||
? 0.42
|
||||
: 0.70;
|
||||
static double chromeOpacity(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
if (theme.extension<MornyeTheme>()?.chromeSurface != null) return 0.36;
|
||||
// Light glass needs more fill to keep dark subtitles readable over black.
|
||||
return theme.brightness == Brightness.dark ? 0.60 : 0.70;
|
||||
}
|
||||
|
||||
static double navigationOpacity(BuildContext context) =>
|
||||
Theme.of(context).extension<MornyeTheme>()?.chromeSurface != null
|
||||
? 0.28
|
||||
: 0.54;
|
||||
static double navigationOpacity(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
if (theme.extension<MornyeTheme>()?.chromeSurface != null) return 0.24;
|
||||
return theme.brightness == Brightness.dark ? 0.44 : 0.54;
|
||||
}
|
||||
|
||||
static const lightAccent = Color.fromRGBO(204, 46, 51, 1);
|
||||
static const darkAccent = Color.fromRGBO(224, 61, 60, 1);
|
||||
|
||||
@@ -259,7 +259,7 @@ class MornyeGlass extends StatelessWidget {
|
||||
firstInGroup = true,
|
||||
lastInGroup = true;
|
||||
|
||||
/// Shares the navigation bar's tint, blur and visible outer rim.
|
||||
/// Shares the navigation bar's tint, blur and subtle edge reflections.
|
||||
const MornyeGlass.navigation({
|
||||
super.key,
|
||||
required this.child,
|
||||
@@ -465,8 +465,8 @@ class _MornyeGlassSurface extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// Static, axis-aligned highlights: bright upper/lower inner edges and a thin
|
||||
/// shadow at the sides. No offscreen layer, extra blur, or per-frame readback.
|
||||
/// Faint edge reflections define the glass without a bright capsule outline.
|
||||
/// No offscreen layer, extra blur, or per-frame readback.
|
||||
class _MornyeGlassRim extends CustomPainter {
|
||||
const _MornyeGlassRim({
|
||||
required this.shape,
|
||||
@@ -499,24 +499,24 @@ class _MornyeGlassRim extends CustomPainter {
|
||||
Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = 0.5
|
||||
..color = Colors.black.withValues(alpha: 0.22),
|
||||
..color = Colors.black.withValues(alpha: illuminated ? 0.10 : 0.22),
|
||||
);
|
||||
if (illuminated) {
|
||||
canvas.drawRRect(
|
||||
outline.deflate(0.9),
|
||||
outline.deflate(0.8),
|
||||
Paint()
|
||||
..style = PaintingStyle.stroke
|
||||
..strokeWidth = 0.8
|
||||
..strokeWidth = 0.6
|
||||
..shader = LinearGradient(
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
stops: const [0, 0.18, 0.5, 0.82, 1],
|
||||
stops: const [0, 0.14, 0.5, 0.86, 1],
|
||||
colors: [
|
||||
firstInGroup ? const Color(0x99ffffff) : Colors.transparent,
|
||||
const Color(0x18ffffff),
|
||||
const Color(0x30000000),
|
||||
const Color(0x18ffffff),
|
||||
lastInGroup ? const Color(0x80ffffff) : Colors.transparent,
|
||||
firstInGroup ? const Color(0x2effffff) : Colors.transparent,
|
||||
const Color(0x08ffffff),
|
||||
const Color(0x0a000000),
|
||||
const Color(0x08ffffff),
|
||||
lastInGroup ? const Color(0x1fffffff) : Colors.transparent,
|
||||
],
|
||||
).createShader(bounds),
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user