Skip to content

Commit 07adb24

Browse files
committed
Updated the custom window frame border and it wont show on mobile
1 parent af7e7b8 commit 07adb24

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

lib/main.dart

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import 'package:bitsdojo_window/bitsdojo_window.dart';
1414

1515
void main() async {
1616
runApp(const CoreCoderApp());
17-
if (Platform.isWindows || Platform.isLinux || Platform.isMacOS) {
17+
if (CoreCoderApp.isDesktop) {
1818
doWhenWindowReady(() {
1919
const initialSize = Size(800, 600);
2020
appWindow.minSize = const Size(256, 256);
@@ -88,6 +88,7 @@ class CoreCoderAppState extends State<CoreCoderApp> {
8888
child: Column(
8989
children: [
9090
// The title bar
91+
if(CoreCoderApp.isDesktop)
9192
WindowTitleBarBox(
9293
child: Row(children: [
9394
Expanded(
@@ -127,24 +128,25 @@ class CoreCoderAppState extends State<CoreCoderApp> {
127128
}
128129
}
129130

130-
final buttonColors = WindowButtonColors(
131-
iconNormal: borderColor,
132-
mouseOver: Color(0xFFF6A00C),
133-
mouseDown: Color(0xFF805306),
134-
iconMouseOver: Color(0xFF805306),
135-
iconMouseDown: Color(0xFFFFD500));
136-
137-
final closeButtonColors = WindowButtonColors(
138-
mouseOver: const Color(0xFFD32F2F),
139-
mouseDown: const Color(0xFFB71C1C),
140-
iconNormal: borderColor,
141-
iconMouseOver: Colors.white);
142-
143131
class WindowButtons extends StatelessWidget {
144132
const WindowButtons({Key? key}) : super(key: key);
145133

146134
@override
147135
Widget build(BuildContext context) {
136+
var theme = Theme.of(context);
137+
var buttonColors = WindowButtonColors(
138+
mouseOver: theme.canvasColor,
139+
mouseDown: theme.backgroundColor,
140+
iconNormal: theme.textTheme.bodyText1?.color,
141+
iconMouseOver: theme.textTheme.bodyText1?.color,
142+
iconMouseDown: theme.textTheme.bodyText1?.color);
143+
144+
var closeButtonColors = WindowButtonColors(
145+
mouseOver: const Color(0xFFD32F2F),
146+
mouseDown: const Color(0xFFB71C1C),
147+
iconNormal: theme.textTheme.bodyText1?.color,
148+
iconMouseOver: theme.textTheme.bodyText1?.color);
149+
148150
return Row(
149151
children: [
150152
MinimizeWindowButton(colors: buttonColors),

0 commit comments

Comments
 (0)