Skip to content
This repository has been archived by the owner on Aug 19, 2022. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Tricked-dev committed Mar 3, 2022
1 parent eda36df commit 885e7c0
Show file tree
Hide file tree
Showing 7 changed files with 71 additions and 115 deletions.
140 changes: 70 additions & 70 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// You should have received a copy of the license along with this
// work. If not, see <http://creativecommons.org/licenses/by-nc-nd/3.0/>.

import 'package:bitsdojo_window/bitsdojo_window.dart';
// import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:args/args.dart';
import 'package:flutter/foundation.dart';
import 'package:tmodinstaller/config.dart';
Expand Down Expand Up @@ -40,10 +40,10 @@ void main(List<String> args) async {

windowManager.waitUntilReadyToShow().then((_) async {
// Hide window title bar
if (defaultTargetPlatform == TargetPlatform.windows) {
await windowManager.setTitleBarStyle('hidden');
await windowManager.setMinimumSize(const Size(755, 545));
}
// if (defaultTargetPlatform == TargetPlatform.windows) {
// await windowManager.setTitleBarStyle('hidden');
// await windowManager.setMinimumSize(const Size(755, 545));
// }
await windowManager.setSize(const Size(800, 600));
await windowManager.center();
await windowManager.show();
Expand Down Expand Up @@ -177,23 +177,23 @@ class _TModInstallerPageState extends State<TModInstallerPage> {
return true;
}).toList();
return NavigationView(
appBar: defaultTargetPlatform == TargetPlatform.windows
? NavigationAppBar(
title: () {
return const DragToMoveArea(
child: Align(
alignment: AlignmentDirectional.centerStart,
child: Text("TMod Installer"),
),
);
}(),
actions: DragToMoveArea(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: const [Spacer(), WindowButtons()],
),
))
: null,
// appBar: defaultTargetPlatform == TargetPlatform.windows
// ? NavigationAppBar(
// title: () {
// return const DragToMoveArea(
// child: Align(
// alignment: AlignmentDirectional.centerStart,
// child: Text("TMod Installer"),
// ),
// );
// }(),
// actions: DragToMoveArea(
// child: Row(
// crossAxisAlignment: CrossAxisAlignment.start,
// children: const [Spacer(), WindowButtons()],
// ),
// ))
// : null,
pane: NavigationPane(
selected: index,
onChanged: (i) => setState(() => index = i),
Expand Down Expand Up @@ -250,52 +250,52 @@ class _TModInstallerPageState extends State<TModInstallerPage> {
}
}

class WindowButtons extends StatelessWidget {
const WindowButtons({Key? key}) : super(key: key);
// class WindowButtons extends StatelessWidget {
// const WindowButtons({Key? key}) : super(key: key);

@override
Widget build(BuildContext context) {
assert(debugCheckHasFluentTheme(context));
assert(debugCheckHasFluentLocalizations(context));
final ThemeData theme = FluentTheme.of(context);
final buttonColors = WindowButtonColors(
iconNormal: theme.inactiveColor,
iconMouseDown: theme.inactiveColor,
iconMouseOver: theme.inactiveColor,
mouseOver: ButtonThemeData.buttonColor(
theme.brightness, {ButtonStates.hovering}),
mouseDown: ButtonThemeData.buttonColor(
theme.brightness, {ButtonStates.pressing}),
);
final closeButtonColors = WindowButtonColors(
mouseOver: Colors.red,
mouseDown: Colors.red.dark,
iconNormal: theme.inactiveColor,
iconMouseOver: Colors.red.basedOnLuminance(),
iconMouseDown: Colors.red.dark.basedOnLuminance(),
);
return Row(children: [
Tooltip(
message: FluentLocalizations.of(context).minimizeWindowTooltip,
child: MinimizeWindowButton(colors: buttonColors),
),
Tooltip(
message: FluentLocalizations.of(context).restoreWindowTooltip,
child: WindowButton(
colors: buttonColors,
iconBuilder: (context) {
if (appWindow.isMaximized) {
return RestoreIcon(color: context.iconColor);
}
return MaximizeIcon(color: context.iconColor);
},
onPressed: appWindow.maximizeOrRestore,
),
),
Tooltip(
message: FluentLocalizations.of(context).closeWindowTooltip,
child: CloseWindowButton(colors: closeButtonColors),
),
]);
}
}
// @override
// Widget build(BuildContext context) {
// assert(debugCheckHasFluentTheme(context));
// assert(debugCheckHasFluentLocalizations(context));
// final ThemeData theme = FluentTheme.of(context);
// final buttonColors = WindowButtonColors(
// iconNormal: theme.inactiveColor,
// iconMouseDown: theme.inactiveColor,
// iconMouseOver: theme.inactiveColor,
// mouseOver: ButtonThemeData.buttonColor(
// theme.brightness, {ButtonStates.hovering}),
// mouseDown: ButtonThemeData.buttonColor(
// theme.brightness, {ButtonStates.pressing}),
// );
// final closeButtonColors = WindowButtonColors(
// mouseOver: Colors.red,
// mouseDown: Colors.red.dark,
// iconNormal: theme.inactiveColor,
// iconMouseOver: Colors.red.basedOnLuminance(),
// iconMouseDown: Colors.red.dark.basedOnLuminance(),
// );
// return Row(children: [
// Tooltip(
// message: FluentLocalizations.of(context).minimizeWindowTooltip,
// child: MinimizeWindowButton(colors: buttonColors),
// ),
// Tooltip(
// message: FluentLocalizations.of(context).restoreWindowTooltip,
// child: WindowButton(
// colors: buttonColors,
// iconBuilder: (context) {
// if (appWindow.isMaximized) {
// return RestoreIcon(color: context.iconColor);
// }
// return MaximizeIcon(color: context.iconColor);
// },
// onPressed: appWindow.maximizeOrRestore,
// ),
// ),
// Tooltip(
// message: FluentLocalizations.of(context).closeWindowTooltip,
// child: CloseWindowButton(colors: closeButtonColors),
// ),
// ]);
// }
// }
4 changes: 0 additions & 4 deletions linux/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@

#include "generated_plugin_registrant.h"

#include <bitsdojo_window_linux/bitsdojo_window_plugin.h>
#include <file_selector_linux/file_selector_plugin.h>
#include <flutter_acrylic/flutter_acrylic_plugin.h>
#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
#include <url_launcher_linux/url_launcher_plugin.h>
#include <window_manager/window_manager_plugin.h>

void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) bitsdojo_window_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "BitsdojoWindowPlugin");
bitsdojo_window_plugin_register_with_registrar(bitsdojo_window_linux_registrar);
g_autoptr(FlPluginRegistrar) file_selector_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "FileSelectorPlugin");
file_selector_plugin_register_with_registrar(file_selector_linux_registrar);
Expand Down
1 change: 0 additions & 1 deletion linux/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
bitsdojo_window_linux
file_selector_linux
flutter_acrylic
isar_flutter_libs
Expand Down
35 changes: 0 additions & 35 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -36,41 +36,6 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.8.2"
bitsdojo_window:
dependency: "direct main"
description:
name: bitsdojo_window
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1+1"
bitsdojo_window_linux:
dependency: transitive
description:
name: bitsdojo_window_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.1"
bitsdojo_window_macos:
dependency: transitive
description:
name: bitsdojo_window_macos
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
bitsdojo_window_platform_interface:
dependency: transitive
description:
name: bitsdojo_window_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
bitsdojo_window_windows:
dependency: transitive
description:
name: bitsdojo_window_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.0"
boolean_selector:
dependency: transitive
description:
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
flutter_native_splash: ^2.0.5
url_launcher: ^6.0.20
url_strategy: ^0.2.0
bitsdojo_window: ^0.1.1+1
# bitsdojo_window: ^0.1.1+1
window_manager: ^0.1.6
shared_preferences: ^2.0.8
flutter_svg: ^1.0.3
Expand Down
3 changes: 0 additions & 3 deletions windows/flutter/generated_plugin_registrant.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

#include "generated_plugin_registrant.h"

#include <bitsdojo_window_windows/bitsdojo_window_plugin.h>
#include <file_selector_windows/file_selector_windows.h>
#include <flutter_acrylic/flutter_acrylic_plugin.h>
#include <isar_flutter_libs/isar_flutter_libs_plugin.h>
Expand All @@ -15,8 +14,6 @@
#include <window_manager/window_manager_plugin.h>

void RegisterPlugins(flutter::PluginRegistry* registry) {
BitsdojoWindowPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("BitsdojoWindowPlugin"));
FileSelectorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("FileSelectorWindows"));
FlutterAcrylicPluginRegisterWithRegistrar(
Expand Down
1 change: 0 additions & 1 deletion windows/flutter/generated_plugins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#

list(APPEND FLUTTER_PLUGIN_LIST
bitsdojo_window_windows
file_selector_windows
flutter_acrylic
isar_flutter_libs
Expand Down

0 comments on commit 885e7c0

Please sign in to comment.