diff --git a/assets/images/desperado.png b/assets/images/desperado.png new file mode 100644 index 00000000..8c2f500c Binary files /dev/null and b/assets/images/desperado.png differ diff --git a/lib/widgets/misc/preferencesEditor.dart b/lib/widgets/misc/preferencesEditor.dart index a0f699d4..26195a6c 100644 --- a/lib/widgets/misc/preferencesEditor.dart +++ b/lib/widgets/misc/preferencesEditor.dart @@ -41,7 +41,7 @@ class _PreferencesEditorState extends ChangeNotifierState { const Text("Preferences", style: TextStyle(fontWeight: FontWeight.w300, fontSize: 25),), const SizedBox(height: 20,), ...makeDataExportEditor(context), - ...makeIndexingEditor(), + // ...makeIndexingEditor(), ...makeThemeEditor(), ...makeMusicEditor(), ], diff --git a/lib/widgets/titlebar/Titlebar.dart b/lib/widgets/titlebar/Titlebar.dart index 8210222d..e6196751 100644 --- a/lib/widgets/titlebar/Titlebar.dart +++ b/lib/widgets/titlebar/Titlebar.dart @@ -8,6 +8,7 @@ import '../../utils/utils.dart'; import '../../widgets/theme/customTheme.dart'; import '../misc/ChangeNotifierWidget.dart'; import 'TitlebarButton.dart'; +import 'logo.dart'; class TitleBar extends ChangeNotifierWidget { @@ -106,34 +107,37 @@ class TitleBarState extends ChangeNotifierState with WindowListener { onPressed: () => areasManager.openPreferences(), ), ), - Tooltip( - message: "Auto translate Jap to Eng", - waitDuration: const Duration(milliseconds: 500), - child: ChangeNotifierBuilder( - notifier: shouldAutoTranslate, - builder: (context) => Opacity( - opacity: shouldAutoTranslate.value ? 1.0 : 0.25, - child: IconButton( - padding: const EdgeInsets.all(5), - constraints: const BoxConstraints(), - iconSize: 20, - splashRadius: 20, - icon: const Icon(Icons.translate, size: 15,), - isSelected: shouldAutoTranslate.value, - onPressed: () => shouldAutoTranslate.value ^= true, - ), - ), - ), - ), + // Tooltip( + // message: "Auto translate Jap to Eng", + // waitDuration: const Duration(milliseconds: 500), + // child: ChangeNotifierBuilder( + // notifier: shouldAutoTranslate, + // builder: (context) => Opacity( + // opacity: shouldAutoTranslate.value ? 1.0 : 0.25, + // child: IconButton( + // padding: const EdgeInsets.all(5), + // constraints: const BoxConstraints(), + // iconSize: 20, + // splashRadius: 20, + // icon: const Icon(Icons.translate, size: 15,), + // isSelected: shouldAutoTranslate.value, + // onPressed: () => shouldAutoTranslate.value ^= true, + // ), + // ), + // ), + // ), Expanded( child: GestureDetector( onPanUpdate: isDesktop ? (details) => windowManager.startDragging() : null, onDoubleTap: isDesktop ? toggleMaximize : null, behavior: HitTestBehavior.translucent, - child: Container( - padding: const EdgeInsets.symmetric(horizontal: 15), - alignment: Alignment.center, - child: Text(windowTitle.value, style: TextStyle(color: getTheme(context).titleBarTextColor), overflow: TextOverflow.ellipsis), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + GameLogo(size: const Size(21, 21)), + const SizedBox(width: 6), + Text(windowTitle.value, style: TextStyle(color: getTheme(context).titleBarTextColor), overflow: TextOverflow.ellipsis), + ], ) ), ), diff --git a/lib/widgets/titlebar/logo.dart b/lib/widgets/titlebar/logo.dart new file mode 100644 index 00000000..7b8a6146 --- /dev/null +++ b/lib/widgets/titlebar/logo.dart @@ -0,0 +1,61 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'dart:ui' as ui; + + +import '../theme/customTheme.dart'; + +class GameLogo extends StatefulWidget { + final Size size; + + const GameLogo({super.key, required this.size}); + + @override + State createState() => _GameLogoState(); +} + +class _GameLogoState extends State { + late Future _img; + + @override + void initState() { + super.initState(); + _img = rootBundle.load("assets/images/desperado.png") + .then((bytes) => decodeImageFromList(bytes.buffer.asUint8List())); + } + + @override + Widget build(BuildContext context) { + return FutureBuilder( + future: _img, + builder: (context, snapshot) { + if (!snapshot.hasData) + return SizedBox( + width: widget.size.width, + height: widget.size.height, + ); + return ShaderMask( + blendMode: BlendMode.dstIn, + shaderCallback: (bounds) { + var image = snapshot.data!; + return ImageShader( + image, + TileMode.repeated, + TileMode.repeated, + Matrix4.diagonal3Values(widget.size.width / image.width, widget.size.height / image.height, 1).storage, + ); + }, + child: Padding( + padding: const EdgeInsets.all(1), + child: Container( + width: widget.size.width - 1, + height: widget.size.height - 1, + color: getTheme(context).textColor?.withOpacity(0.85), + ), + ), + ); + }, + ); + } +} diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc index eef51df7..7a380419 100644 --- a/windows/runner/Runner.rc +++ b/windows/runner/Runner.rc @@ -90,7 +90,7 @@ BEGIN BLOCK "040904e4" BEGIN VALUE "CompanyName", "com.example" "\0" - VALUE "FileDescription", "File and Scripts Editor for Nier Automata" "\0" + VALUE "FileDescription", "File and Scripts Editor for MGR:R" "\0" VALUE "FileVersion", VERSION_AS_STRING "\0" VALUE "InternalName", "f_servo" "\0" VALUE "LegalCopyright", "Copyright (C) 2022 com.example. All rights reserved." "\0" diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp index 550f2d1a..142f3e16 100644 --- a/windows/runner/main.cpp +++ b/windows/runner/main.cpp @@ -28,7 +28,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, FlutterWindow window(project); Win32Window::Point origin(100, 100); Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"F-SERVO", origin, size)) { + if (!window.CreateAndShow(L"F-SERVO (for mgr:r)", origin, size)) { return EXIT_FAILURE; } window.SetQuitOnClose(true);