mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
chore: Changed titlebar window buttons background
This commit is contained in:
parent
9eed99c8e0
commit
8e4171be56
1 changed files with 89 additions and 79 deletions
|
|
@ -47,8 +47,8 @@ class _DefaultTitleBarState extends ConsumerState<DefaultTitleBar> with WindowLi
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
gradient: LinearGradient(
|
gradient: LinearGradient(
|
||||||
colors: [
|
colors: [
|
||||||
surfaceColor.withValues(alpha: 0.7),
|
|
||||||
surfaceColor.withValues(alpha: hovering ? 0.7 : 0),
|
surfaceColor.withValues(alpha: hovering ? 0.7 : 0),
|
||||||
|
surfaceColor.withValues(alpha: 0),
|
||||||
],
|
],
|
||||||
begin: Alignment.topCenter,
|
begin: Alignment.topCenter,
|
||||||
end: Alignment.bottomCenter,
|
end: Alignment.bottomCenter,
|
||||||
|
|
@ -83,94 +83,104 @@ class _DefaultTitleBarState extends ConsumerState<DefaultTitleBar> with WindowLi
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
Row(
|
Container(
|
||||||
children: [
|
decoration: BoxDecoration(boxShadow: [
|
||||||
FutureBuilder<List<bool>>(future: Future.microtask(() async {
|
BoxShadow(
|
||||||
final isMinimized = await windowManager.isMinimized();
|
color: surfaceColor.withValues(alpha: 0.15),
|
||||||
return [isMinimized];
|
blurRadius: 32,
|
||||||
}), builder: (context, snapshot) {
|
spreadRadius: 10,
|
||||||
final isMinimized = snapshot.data?.firstOrNull ?? false;
|
offset: const Offset(8, -6),
|
||||||
return IconButton(
|
),
|
||||||
|
]),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
FutureBuilder<List<bool>>(future: Future.microtask(() async {
|
||||||
|
final isMinimized = await windowManager.isMinimized();
|
||||||
|
return [isMinimized];
|
||||||
|
}), builder: (context, snapshot) {
|
||||||
|
final isMinimized = snapshot.data?.firstOrNull ?? false;
|
||||||
|
return IconButton(
|
||||||
|
style: IconButton.styleFrom(
|
||||||
|
hoverColor: brightness == Brightness.light
|
||||||
|
? Colors.black.withValues(alpha: 0.1)
|
||||||
|
: Colors.white.withValues(alpha: 0.2),
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2))),
|
||||||
|
onPressed: () async {
|
||||||
|
fullScreenHelper.closeFullScreen(ref);
|
||||||
|
if (isMinimized) {
|
||||||
|
windowManager.restore();
|
||||||
|
} else {
|
||||||
|
windowManager.minimize();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
icon: Transform.translate(
|
||||||
|
offset: const Offset(0, -2),
|
||||||
|
child: Icon(
|
||||||
|
Icons.minimize_rounded,
|
||||||
|
color: iconColor,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
FutureBuilder<List<bool>>(
|
||||||
|
future: Future.microtask(() async {
|
||||||
|
final isMaximized = await windowManager.isMaximized();
|
||||||
|
return [isMaximized];
|
||||||
|
}),
|
||||||
|
builder: (BuildContext context, AsyncSnapshot<List<bool>> snapshot) {
|
||||||
|
final maximized = snapshot.data?.firstOrNull ?? false;
|
||||||
|
return IconButton(
|
||||||
|
style: IconButton.styleFrom(
|
||||||
|
hoverColor: brightness == Brightness.light
|
||||||
|
? Colors.black.withValues(alpha: 0.1)
|
||||||
|
: Colors.white.withValues(alpha: 0.2),
|
||||||
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2)),
|
||||||
|
),
|
||||||
|
onPressed: () async {
|
||||||
|
fullScreenHelper.closeFullScreen(ref);
|
||||||
|
if (maximized) {
|
||||||
|
await windowManager.unmaximize();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (!maximized) {
|
||||||
|
await windowManager.maximize();
|
||||||
|
} else {
|
||||||
|
await windowManager.unmaximize();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
icon: Transform.translate(
|
||||||
|
offset: const Offset(0, 0),
|
||||||
|
child: Icon(
|
||||||
|
maximized ? Icons.maximize_rounded : Icons.crop_square_rounded,
|
||||||
|
color: iconColor,
|
||||||
|
size: 19,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
IconButton(
|
||||||
style: IconButton.styleFrom(
|
style: IconButton.styleFrom(
|
||||||
hoverColor: brightness == Brightness.light
|
hoverColor: Colors.red,
|
||||||
? Colors.black.withValues(alpha: 0.1)
|
shape: RoundedRectangleBorder(
|
||||||
: Colors.white.withValues(alpha: 0.2),
|
borderRadius: BorderRadius.circular(2),
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2))),
|
),
|
||||||
|
),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
fullScreenHelper.closeFullScreen(ref);
|
windowManager.close();
|
||||||
if (isMinimized) {
|
|
||||||
windowManager.restore();
|
|
||||||
} else {
|
|
||||||
windowManager.minimize();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
icon: Transform.translate(
|
icon: Transform.translate(
|
||||||
offset: const Offset(0, -2),
|
offset: const Offset(0, -2),
|
||||||
child: Icon(
|
child: Icon(
|
||||||
Icons.minimize_rounded,
|
Icons.close_rounded,
|
||||||
color: iconColor,
|
color: iconColor,
|
||||||
size: 20,
|
size: 23,
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
);
|
|
||||||
}),
|
|
||||||
FutureBuilder<List<bool>>(
|
|
||||||
future: Future.microtask(() async {
|
|
||||||
final isMaximized = await windowManager.isMaximized();
|
|
||||||
return [isMaximized];
|
|
||||||
}),
|
|
||||||
builder: (BuildContext context, AsyncSnapshot<List<bool>> snapshot) {
|
|
||||||
final maximized = snapshot.data?.firstOrNull ?? false;
|
|
||||||
return IconButton(
|
|
||||||
style: IconButton.styleFrom(
|
|
||||||
hoverColor: brightness == Brightness.light
|
|
||||||
? Colors.black.withValues(alpha: 0.1)
|
|
||||||
: Colors.white.withValues(alpha: 0.2),
|
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(2)),
|
|
||||||
),
|
|
||||||
onPressed: () async {
|
|
||||||
fullScreenHelper.closeFullScreen(ref);
|
|
||||||
if (maximized) {
|
|
||||||
await windowManager.unmaximize();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (!maximized) {
|
|
||||||
await windowManager.maximize();
|
|
||||||
} else {
|
|
||||||
await windowManager.unmaximize();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
icon: Transform.translate(
|
|
||||||
offset: const Offset(0, 0),
|
|
||||||
child: Icon(
|
|
||||||
maximized ? Icons.maximize_rounded : Icons.crop_square_rounded,
|
|
||||||
color: iconColor,
|
|
||||||
size: 19,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
IconButton(
|
|
||||||
style: IconButton.styleFrom(
|
|
||||||
hoverColor: Colors.red,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
borderRadius: BorderRadius.circular(2),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
onPressed: () async {
|
],
|
||||||
windowManager.close();
|
),
|
||||||
},
|
|
||||||
icon: Transform.translate(
|
|
||||||
offset: const Offset(0, -2),
|
|
||||||
child: Icon(
|
|
||||||
Icons.close_rounded,
|
|
||||||
color: iconColor,
|
|
||||||
size: 23,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue