Improve title on desktop
This commit is contained in:
parent
c89c5af400
commit
77d6f50ad2
|
|
@ -3,6 +3,7 @@ import 'dart:async';
|
|||
import 'dart:convert';
|
||||
|
||||
// Flutter imports:
|
||||
import 'package:bitsdojo_window/bitsdojo_window.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
|
|
@ -132,6 +133,16 @@ void main({bool isTesting = false}) async {
|
|||
appRunner: () => runApp(InvoiceNinjaApp(store: store)),
|
||||
);
|
||||
}
|
||||
|
||||
doWhenWindowReady(() {
|
||||
final win = appWindow;
|
||||
//const initialSize = Size(600, 450);
|
||||
//win.minSize = initialSize;
|
||||
//win.size = initialSize;
|
||||
//win.alignment = Alignment.center;
|
||||
//win.maximize();
|
||||
win.show();
|
||||
});
|
||||
}
|
||||
|
||||
Future<AppState> _initialState(bool isTesting) async {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
// Flutter imports:
|
||||
import 'package:bitsdojo_window/bitsdojo_window.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
// Package imports:
|
||||
|
|
@ -219,6 +220,21 @@ class MainScreen extends StatelessWidget {
|
|||
print('## Error: main screen route $mainRoute not defined');
|
||||
}
|
||||
|
||||
final buttonColors = WindowButtonColors(
|
||||
iconNormal: state.headerTextColor,
|
||||
iconMouseOver: state.headerTextColor,
|
||||
iconMouseDown: state.headerTextColor,
|
||||
mouseOver: Color(prefState.enableDarkMode ? 0xFF222222 : 0xFFDDDDDD),
|
||||
mouseDown: Color(prefState.enableDarkMode ? 0xFF333333 : 0xFFCCCCCC),
|
||||
);
|
||||
|
||||
final closeButtonColors = WindowButtonColors(
|
||||
iconNormal: state.headerTextColor,
|
||||
iconMouseOver: Colors.white,
|
||||
mouseOver: Color(0xFFD32F2F),
|
||||
mouseDown: Color(0xFFB71C1C),
|
||||
);
|
||||
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
final state = store.state;
|
||||
|
|
@ -292,18 +308,54 @@ class MainScreen extends StatelessWidget {
|
|||
child: SafeArea(
|
||||
child: FocusTraversalGroup(
|
||||
policy: ReadingOrderTraversalPolicy(),
|
||||
child: ChangeLayoutBanner(
|
||||
appLayout: prefState.appLayout,
|
||||
suggestedLayout: AppLayout.desktop,
|
||||
child: Row(children: <Widget>[
|
||||
if (prefState.showMenu) MenuDrawerBuilder(),
|
||||
child: Column(
|
||||
children: [
|
||||
Material(
|
||||
color: !prefState.enableDarkMode && state.hasAccentColor
|
||||
? state.accentColor
|
||||
: null,
|
||||
child: WindowTitleBarBox(
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: MoveWindow(
|
||||
child: Row(
|
||||
children: [
|
||||
SizedBox(width: 6),
|
||||
Image.asset('assets/images/icon.png',
|
||||
width: 16),
|
||||
SizedBox(width: 6),
|
||||
Text(
|
||||
'Invoice Ninja',
|
||||
style:
|
||||
TextStyle(color: state.headerTextColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
)),
|
||||
MinimizeWindowButton(colors: buttonColors),
|
||||
MaximizeWindowButton(colors: buttonColors),
|
||||
CloseWindowButton(colors: closeButtonColors),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: AppBorder(
|
||||
child: screen,
|
||||
isLeft: prefState.showMenu &&
|
||||
(!state.isFullScreen || showFilterSidebar),
|
||||
)),
|
||||
]),
|
||||
child: ChangeLayoutBanner(
|
||||
appLayout: prefState.appLayout,
|
||||
suggestedLayout: AppLayout.desktop,
|
||||
child: Row(children: <Widget>[
|
||||
if (prefState.showMenu) MenuDrawerBuilder(),
|
||||
Expanded(
|
||||
child: AppBorder(
|
||||
child: screen,
|
||||
isLeft: prefState.showMenu &&
|
||||
(!state.isFullScreen || showFilterSidebar),
|
||||
)),
|
||||
]),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -6,10 +6,14 @@
|
|||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <bitsdojo_window_linux/bitsdojo_window_plugin.h>
|
||||
#include <sentry_flutter/sentry_flutter_plugin.h>
|
||||
#include <url_launcher_linux/url_launcher_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) sentry_flutter_registrar =
|
||||
fl_plugin_registry_get_registrar_for_plugin(registry, "SentryFlutterPlugin");
|
||||
sentry_flutter_plugin_register_with_registrar(sentry_flutter_registrar);
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
bitsdojo_window_linux
|
||||
sentry_flutter
|
||||
url_launcher_linux
|
||||
)
|
||||
|
|
|
|||
35
pubspec.lock
35
pubspec.lock
|
|
@ -43,6 +43,41 @@ 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"
|
||||
boardview:
|
||||
dependency: "direct main"
|
||||
description:
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ dependencies:
|
|||
contacts_service: ^0.6.1
|
||||
super_editor: ^0.1.0
|
||||
diacritic: ^0.1.3
|
||||
bitsdojo_window: ^0.1.1+1
|
||||
# printing: ^5.6.3
|
||||
# quick_actions: ^0.2.1
|
||||
# idb_shim: ^1.11.1+1
|
||||
|
|
|
|||
|
|
@ -6,11 +6,14 @@
|
|||
|
||||
#include "generated_plugin_registrant.h"
|
||||
|
||||
#include <bitsdojo_window_windows/bitsdojo_window_plugin.h>
|
||||
#include <native_pdf_renderer/native_pdf_renderer_plugin.h>
|
||||
#include <sentry_flutter/sentry_flutter_plugin.h>
|
||||
#include <url_launcher_windows/url_launcher_windows.h>
|
||||
|
||||
void RegisterPlugins(flutter::PluginRegistry* registry) {
|
||||
BitsdojoWindowPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("BitsdojoWindowPlugin"));
|
||||
NativePdfRendererPluginRegisterWithRegistrar(
|
||||
registry->GetRegistrarForPlugin("NativePdfRendererPlugin"));
|
||||
SentryFlutterPluginRegisterWithRegistrar(
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#
|
||||
|
||||
list(APPEND FLUTTER_PLUGIN_LIST
|
||||
bitsdojo_window_windows
|
||||
native_pdf_renderer
|
||||
sentry_flutter
|
||||
url_launcher_windows
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
#include <bitsdojo_window_windows/bitsdojo_window_plugin.h>
|
||||
auto bdw = bitsdojo_window_configure(BDW_CUSTOM_FRAME | BDW_HIDE_ON_STARTUP);
|
||||
|
||||
#include <flutter/dart_project.h>
|
||||
#include <flutter/flutter_view_controller.h>
|
||||
#include <windows.h>
|
||||
|
|
|
|||
Loading…
Reference in New Issue