mirror of
https://github.com/zarzet/SpotiFLAC-Mobile.git
synced 2026-10-11 02:08:44 +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) =>
|
static double chromeOpacity(BuildContext context) {
|
||||||
Theme.of(context).extension<MornyeTheme>()?.chromeSurface != null
|
final theme = Theme.of(context);
|
||||||
? 0.42
|
if (theme.extension<MornyeTheme>()?.chromeSurface != null) return 0.36;
|
||||||
: 0.70;
|
// 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) =>
|
static double navigationOpacity(BuildContext context) {
|
||||||
Theme.of(context).extension<MornyeTheme>()?.chromeSurface != null
|
final theme = Theme.of(context);
|
||||||
? 0.28
|
if (theme.extension<MornyeTheme>()?.chromeSurface != null) return 0.24;
|
||||||
: 0.54;
|
return theme.brightness == Brightness.dark ? 0.44 : 0.54;
|
||||||
|
}
|
||||||
|
|
||||||
static const lightAccent = Color.fromRGBO(204, 46, 51, 1);
|
static const lightAccent = Color.fromRGBO(204, 46, 51, 1);
|
||||||
static const darkAccent = Color.fromRGBO(224, 61, 60, 1);
|
static const darkAccent = Color.fromRGBO(224, 61, 60, 1);
|
||||||
|
|||||||
@@ -259,7 +259,7 @@ class MornyeGlass extends StatelessWidget {
|
|||||||
firstInGroup = true,
|
firstInGroup = true,
|
||||||
lastInGroup = 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({
|
const MornyeGlass.navigation({
|
||||||
super.key,
|
super.key,
|
||||||
required this.child,
|
required this.child,
|
||||||
@@ -465,8 +465,8 @@ class _MornyeGlassSurface extends StatelessWidget {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Static, axis-aligned highlights: bright upper/lower inner edges and a thin
|
/// Faint edge reflections define the glass without a bright capsule outline.
|
||||||
/// shadow at the sides. No offscreen layer, extra blur, or per-frame readback.
|
/// No offscreen layer, extra blur, or per-frame readback.
|
||||||
class _MornyeGlassRim extends CustomPainter {
|
class _MornyeGlassRim extends CustomPainter {
|
||||||
const _MornyeGlassRim({
|
const _MornyeGlassRim({
|
||||||
required this.shape,
|
required this.shape,
|
||||||
@@ -499,24 +499,24 @@ class _MornyeGlassRim extends CustomPainter {
|
|||||||
Paint()
|
Paint()
|
||||||
..style = PaintingStyle.stroke
|
..style = PaintingStyle.stroke
|
||||||
..strokeWidth = 0.5
|
..strokeWidth = 0.5
|
||||||
..color = Colors.black.withValues(alpha: 0.22),
|
..color = Colors.black.withValues(alpha: illuminated ? 0.10 : 0.22),
|
||||||
);
|
);
|
||||||
if (illuminated) {
|
if (illuminated) {
|
||||||
canvas.drawRRect(
|
canvas.drawRRect(
|
||||||
outline.deflate(0.9),
|
outline.deflate(0.8),
|
||||||
Paint()
|
Paint()
|
||||||
..style = PaintingStyle.stroke
|
..style = PaintingStyle.stroke
|
||||||
..strokeWidth = 0.8
|
..strokeWidth = 0.6
|
||||||
..shader = LinearGradient(
|
..shader = LinearGradient(
|
||||||
begin: Alignment.topCenter,
|
begin: Alignment.topCenter,
|
||||||
end: Alignment.bottomCenter,
|
end: Alignment.bottomCenter,
|
||||||
stops: const [0, 0.18, 0.5, 0.82, 1],
|
stops: const [0, 0.14, 0.5, 0.86, 1],
|
||||||
colors: [
|
colors: [
|
||||||
firstInGroup ? const Color(0x99ffffff) : Colors.transparent,
|
firstInGroup ? const Color(0x2effffff) : Colors.transparent,
|
||||||
const Color(0x18ffffff),
|
const Color(0x08ffffff),
|
||||||
const Color(0x30000000),
|
const Color(0x0a000000),
|
||||||
const Color(0x18ffffff),
|
const Color(0x08ffffff),
|
||||||
lastInGroup ? const Color(0x80ffffff) : Colors.transparent,
|
lastInGroup ? const Color(0x1fffffff) : Colors.transparent,
|
||||||
],
|
],
|
||||||
).createShader(bounds),
|
).createShader(bounds),
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user