From 3d325927f5659b1e1ad2180f7a83ea933f33d071 Mon Sep 17 00:00:00 2001 From: ArthurHeitmann <37270165+ArthurHeitmann@users.noreply.github.com> Date: Sat, 2 Nov 2024 20:51:43 +0100 Subject: [PATCH] mgrr-fication --- assets/images/desperado.png | Bin 0 -> 5954 bytes lib/widgets/misc/preferencesEditor.dart | 2 +- lib/widgets/titlebar/Titlebar.dart | 50 ++++++++++--------- lib/widgets/titlebar/logo.dart | 61 ++++++++++++++++++++++++ windows/runner/Runner.rc | 2 +- windows/runner/main.cpp | 2 +- 6 files changed, 91 insertions(+), 26 deletions(-) create mode 100644 assets/images/desperado.png create mode 100644 lib/widgets/titlebar/logo.dart diff --git a/assets/images/desperado.png b/assets/images/desperado.png new file mode 100644 index 0000000000000000000000000000000000000000..8c2f500c964981a1238838cf0c5f3b79eacc1d25 GIT binary patch literal 5954 zcmeHLMZdg(pX;6@U z{rw&9Gw0m7XU@#0JMm#6HPul>_%!$c0DwqIQBM0G2mc2M)<566yf*fafF9Z?8Q{X; z^}ej>6tJ90CcCRsw@95`S3scp923c6$qbRa{F%q-e{}q0I*nA zK7)X46A$+Zv$uCilQ)SUnMbeVSVyi}FaO34g^LX)KFYJ*|$K7^ZNsK z4=&>TeHWPjtot;qJ^0Z{DA~Yq$ajh(bj!~E;aWp+-A~H+Ao#b^d8&he#$FqT>J3g@0?bQ;G;G$ON%;O^Usd3&CjHR)w z{#!l^ay)b5Imzd$Pjsg_E3FKLJ@kxTOG(S22w%1hD>ow*Ovgxk?EegXiG zrj+EQb$v2>GkuYIy;S|SZ@u|o@CrN^bM7YdpnH(6_UrD}go5cDvnF|T7>$Fnl-v`| z&vgUXSZdwmDuSfg6y3^hKocY{1r?!=0ENs->)6%E(q)kMam)9S!@CWvqpX{6JBXd( zv@~IvlP;-~!J|Gk_!VG_KsIPT_>tRMBrF?@hUWI;L)P9=dhmnMMdPZ)YoDiyFm8y+JJ`w-CUVsX?K3kRi2!3W|hc+u%@Dd;cS|AM7 z@Zg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^l*lBb4s0Lzf(&d!)ok?2iE2Oah92YASSi?wBhS~m((^XwicST(71=!Cg^O)Ix*^^V?S?cRy-dza}ZJU4N zEu~J|4lGYf(tptl({ZwwC9rs{sBK0$b7@bJT1*`~7@MIgo3>2y zbgXJv{iWvX^Rj6A)Ezx1&NA$JBaTFry-0Y~aVL$^;FcFpzODcR5I%ZnnI@r(M0WIV z7uvq^Q9cydJ?9cF@XCb*(K?4`L$Nd)%(>8<`O6~+;MWj@%#(+9%uI#*+=ZjTO=ge-lir)lirJs zJn|^4>uOZ?%NLR}c|u}8+mh)cC|p===!$HE@EaYi$Ije9);^*Qfqz(dLpv$L;@D?} z4KD=KI-*0kdr^5!emLRBH6Av6$0@}OyjsVKjEN*fX|GNC3x7#e>H)tq`fQ!uFVvwV zb2h|vqu8Gh{en#c)4OrohJk;5>5cLTy($VF>h`IYI)ArISt9-S$;NheDQB3^%o7B> zHCcSnuC?8t^SbfdcRYjC%;rtF1T?`eaH*%6z-@-l{t4aD!z{qhzf${o{9$&BzZ24M zRYs&H_xwzHNki3BB#MZfQr$h`#54S>C|*l{$ih$Hy?8*dE+x2L-;y-oTV6KD8iobl zx#ME-zJK>{8+Qr%Lu%RV6n8=(zNuPo7gJLGLF?oogvw*uIATWR=CN*2@mnq26)xG! txr<;b--8?n(hP*(Xw>Z(N%rW@Ly9H_pHz1X{O{8TP?A@dtB^4Z{y#NFq>=yt literal 0 HcmV?d00001 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);