Skip to content

Commit

Permalink
mgrr-fication
Browse files Browse the repository at this point in the history
  • Loading branch information
ArthurHeitmann committed Nov 2, 2024
1 parent 3b881c6 commit 3d32592
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 26 deletions.
Binary file added assets/images/desperado.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion lib/widgets/misc/preferencesEditor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class _PreferencesEditorState extends ChangeNotifierState<PreferencesEditor> {
const Text("Preferences", style: TextStyle(fontWeight: FontWeight.w300, fontSize: 25),),
const SizedBox(height: 20,),
...makeDataExportEditor(context),
...makeIndexingEditor(),
// ...makeIndexingEditor(),
...makeThemeEditor(),
...makeMusicEditor(),
],
Expand Down
50 changes: 27 additions & 23 deletions lib/widgets/titlebar/Titlebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -106,34 +107,37 @@ class TitleBarState extends ChangeNotifierState<TitleBar> 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),
],
)
),
),
Expand Down
61 changes: 61 additions & 0 deletions lib/widgets/titlebar/logo.dart
Original file line number Diff line number Diff line change
@@ -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<GameLogo> createState() => _GameLogoState();
}

class _GameLogoState extends State<GameLogo> {
late Future<ui.Image> _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),
),
),
);
},
);
}
}
2 changes: 1 addition & 1 deletion windows/runner/Runner.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion windows/runner/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 3d32592

Please sign in to comment.