Skip to content

Commit 336ba7f

Browse files
authoredDec 23, 2021
Merge pull request #21 from Hanprogramer/dev
0.0.1.11
2 parents cd326ef + 07adb24 commit 336ba7f

File tree

2 files changed

+101
-63
lines changed

2 files changed

+101
-63
lines changed
 

‎lib/homepage.dart

+85-49
Original file line numberDiff line numberDiff line change
@@ -457,70 +457,106 @@ class _HomePageState extends State<HomePage> {
457457
query.size.width > query.size.height);
458458
final page = Center(
459459
child: Container(
460-
padding: isLandscape? EdgeInsets.zero : const EdgeInsets.all(16.0),
461460
constraints: BoxConstraints(
462461
minHeight: MediaQuery.of(context).size.height - 34,
463462
minWidth: double.infinity),
464-
child:
465-
isLandscape?
463+
child: isLandscape
464+
?
466465

467466
/// ==================
468467
/// The windows layout
469468
/// ==================
470-
DesktopTabBar(
471-
tabs: <DesktopTabData>[
472-
DesktopTabData(icon: const Icon(Icons.featured_play_list), title: const Text("Projects")),
473-
DesktopTabData(icon: const Icon(Icons.input), title: const Text("Plugins")),
474-
DesktopTabData(icon: const Icon(Icons.settings), title: const Text("Settings")),
475-
],
476-
content:<Widget>[
477-
Column(children:projectsWidgetList),
478-
const PluginsBrowser(),
479-
SettingsPage(mm),
480-
])
469+
DesktopTabBar(tabs: <DesktopTabData>[
470+
DesktopTabData(
471+
icon: const Icon(Icons.featured_play_list),
472+
title: const Text("Projects")),
473+
DesktopTabData(
474+
icon: const Icon(Icons.input), title: const Text("Plugins")),
475+
DesktopTabData(
476+
icon: const Icon(Icons.settings),
477+
title: const Text("Settings")),
478+
], content: <Widget>[
479+
Padding(
480+
padding: const EdgeInsets.all(16.0),
481+
child: Column(
482+
crossAxisAlignment: CrossAxisAlignment.stretch,
483+
children: [
484+
Row(children: [
485+
const Text(
486+
"Recent Projects",
487+
style: TextStyle(
488+
fontWeight: FontWeight.bold,
489+
fontSize: 24.0,
490+
),
491+
),
492+
const Spacer(flex: 1),
493+
OutlinedButton(
494+
onPressed: () {
495+
refreshRecentProjects();
496+
},
497+
child: const Text("Refresh"),
498+
),
499+
OutlinedButton(
500+
onPressed: () {},
501+
child: const Text("Add"),
502+
),
503+
]),
504+
Column(
505+
children: projectsWidgetList,
506+
)
507+
])),
508+
const PluginsBrowser(),
509+
SettingsPage(mm),
510+
])
481511
:
482512

483513
/// ==================
484514
/// The android layout
485515
/// ==================
486-
Column(crossAxisAlignment: CrossAxisAlignment.stretch, children: [
487-
Row(children: [
488-
const Text(
489-
"Recent Projects",
490-
style: TextStyle(
491-
fontWeight: FontWeight.bold,
492-
fontSize: 24.0,
516+
Padding(
517+
padding: const EdgeInsets.all(16.0),
518+
child: Column(
519+
crossAxisAlignment: CrossAxisAlignment.stretch,
520+
children: [
521+
Row(children: [
522+
const Text(
523+
"Recent Projects",
524+
style: TextStyle(
525+
fontWeight: FontWeight.bold,
526+
fontSize: 24.0,
527+
),
493528
),
494-
),
495-
const Spacer(flex: 1),
496-
OutlinedButton(
497-
onPressed: () {
498-
refreshRecentProjects();
499-
},
500-
child: const Text("Refresh"),
501-
),
502-
OutlinedButton(
503-
onPressed: () {},
504-
child: const Text("Add"),
505-
),
506-
]),
507-
Column(
508-
children: projectsWidgetList,
509-
)
510-
]),
529+
const Spacer(flex: 1),
530+
OutlinedButton(
531+
onPressed: () {
532+
refreshRecentProjects();
533+
},
534+
child: const Text("Refresh"),
535+
),
536+
OutlinedButton(
537+
onPressed: () {},
538+
child: const Text("Add"),
539+
),
540+
]),
541+
Column(
542+
children: projectsWidgetList,
543+
)
544+
])),
511545
));
512546
return Scaffold(
513-
appBar: CoreCoderApp.isLandscape(context)? null: AppBar(
514-
title: const Text("CoreCoder Develop"),
515-
centerTitle: true,
516-
actions: [
517-
IconButton(
518-
onPressed: () => {showSettings()},
519-
icon: const Icon(Icons.settings),
520-
tooltip: "Settings"),
521-
const SizedBox(width: 16.0),
522-
],
523-
),
547+
appBar: CoreCoderApp.isLandscape(context)
548+
? null
549+
: AppBar(
550+
title: const Text("CoreCoder Develop"),
551+
centerTitle: true,
552+
actions: [
553+
IconButton(
554+
onPressed: () => {showSettings()},
555+
icon: const Icon(Icons.settings),
556+
tooltip: "Settings"),
557+
const SizedBox(width: 16.0),
558+
],
559+
),
524560
body: SingleChildScrollView(child: page),
525561
floatingActionButton: FloatingActionButton(
526562
onPressed: () => showCreateProjectDialog(),

‎lib/main.dart

+16-14
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)
Please sign in to comment.