Add scaling, fix #15

pull/2/head
axtlos 3 years ago
parent f045a651f4
commit 5cc16d00fa
No known key found for this signature in database
GPG Key ID: A468AFD71DD51D4A

@ -1,9 +1,2 @@
Chosen location: Asia Desktop: gnome
Chosen Region: Aqtau
Chosen layout: at
Chosen variant: normal
Username: e
Username:
Username: u
Enable sudo: true

@ -11,6 +11,7 @@ import 'package:jade_gui/functions/install.dart';
import 'package:jade_gui/classes/keymap.dart'; import 'package:jade_gui/classes/keymap.dart';
import 'package:jade_gui/classes/desktop.dart'; import 'package:jade_gui/classes/desktop.dart';
import 'package:jade_gui/desktops/desktops.dart'; import 'package:jade_gui/desktops/desktops.dart';
import 'package:window_size/window_size.dart';
import 'dart:io'; import 'dart:io';
@ -44,6 +45,11 @@ Future<void> writeToLog(String message) async {
}); });
} }
void setWindowSize() {
setWindowMinSize(Size(0, 0));
setWindowMaxSize(Size(1300, 870));
}
void main() => runApp( void main() => runApp(
const MaterialApp( const MaterialApp(
debugShowCheckedModeBanner: false, debugShowCheckedModeBanner: false,
@ -69,7 +75,7 @@ class Jadegui extends StatefulWidget {
} }
class _JadeguiState extends State<Jadegui> { class _JadeguiState extends State<Jadegui> {
var file = File("jade_log.txt").writeAsString(""); var file = File('${env["HOME"]}/jade_log.txt').writeAsString("");
int _selectedIndex = 0; int _selectedIndex = 0;
bool nextpage = false; bool nextpage = false;
bool choseLayout = false; bool choseLayout = false;
@ -101,6 +107,7 @@ class _JadeguiState extends State<Jadegui> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
setWindowSize();
return Scaffold( return Scaffold(
backgroundColor: const Color.fromARGB(255, 23, 23, 23), backgroundColor: const Color.fromARGB(255, 23, 23, 23),
body: Row( body: Row(
@ -287,14 +294,25 @@ class _JadeguiState extends State<Jadegui> {
Widget condition() { Widget condition() {
Widget widget; Widget widget;
double logicWidth = 1300;
double logicHeight = 870;
switch (_selectedIndex) { switch (_selectedIndex) {
case 0: case 0:
widget = welcome(() { widget = SizedBox(
child: FittedBox(
fit: BoxFit.contain,
alignment: Alignment.center,
child: SizedBox(
width: logicWidth,
height: logicHeight,
child: welcome(() {
setState(() { setState(() {
_selectedIndex = _selectedIndex + 1; _selectedIndex = _selectedIndex + 1;
}); });
}); }),
),
),
);
break; break;
case 1: case 1:
widget = locale( widget = locale(
@ -323,7 +341,14 @@ class _JadeguiState extends State<Jadegui> {
break; break;
case 2: case 2:
widget = keyboard( widget = SizedBox.expand(
child: FittedBox(
fit: BoxFit.contain,
alignment: Alignment.center,
child: SizedBox(
width: logicWidth,
height: logicHeight,
child: keyboard(
() { () {
setState(() { setState(() {
_selectedIndex = _selectedIndex + 1; _selectedIndex = _selectedIndex + 1;
@ -344,10 +369,20 @@ class _JadeguiState extends State<Jadegui> {
(value) { (value) {
writeToLog(value); writeToLog(value);
}, },
),
),
),
); );
break; break;
case 3: case 3:
widget = users( widget = SizedBox.expand(
child: FittedBox(
fit: BoxFit.contain,
alignment: Alignment.center,
child: SizedBox(
width: logicWidth,
height: logicHeight,
child: users(
(value) { (value) {
setState(() { setState(() {
enableSudo = value; enableSudo = value;
@ -407,11 +442,20 @@ class _JadeguiState extends State<Jadegui> {
_selectedIndex = _selectedIndex + 1; _selectedIndex = _selectedIndex + 1;
}); });
}, },
),
),
),
); );
break; break;
case 4: case 4:
debugPrint(password); widget = SizedBox.expand(
widget = desktopView( child: FittedBox(
fit: BoxFit.contain,
alignment: Alignment.center,
child: SizedBox(
width: logicWidth,
height: logicHeight,
child: desktopView(
currDesktop, currDesktop,
(selectedDesktop) { (selectedDesktop) {
setState(() { setState(() {
@ -424,10 +468,20 @@ class _JadeguiState extends State<Jadegui> {
_selectedIndex = _selectedIndex + 1; _selectedIndex = _selectedIndex + 1;
}); });
}, },
),
),
),
); );
break; break;
case 5: case 5:
widget = misc( widget = SizedBox.expand(
child: FittedBox(
fit: BoxFit.contain,
alignment: Alignment.center,
child: SizedBox(
width: logicWidth,
height: logicHeight,
child: misc(
(value) { (value) {
setState(() { setState(() {
ipv6 = value; ipv6 = value;
@ -454,15 +508,25 @@ class _JadeguiState extends State<Jadegui> {
_selectedIndex = _selectedIndex + 1; _selectedIndex = _selectedIndex + 1;
}); });
}, },
),
),
),
); );
break; break;
case 6: case 6:
widget = partitioning( widget = SizedBox.expand(
child: FittedBox(
fit: BoxFit.contain,
alignment: Alignment.center,
child: SizedBox(
width: logicWidth,
height: logicHeight,
child: partitioning(
disks, disks,
(value) { (value) {
setState(() { setState(() {
disks = value; disks = value;
writeToLog("Disks: $disks"); writeToLog("Disks:widget $disks");
}); });
}, },
(value) { (value) {
@ -496,6 +560,9 @@ class _JadeguiState extends State<Jadegui> {
runningInfo = true; runningInfo = true;
}); });
}, },
),
),
),
); );
break; break;
case 7: case 7:
@ -512,7 +579,14 @@ class _JadeguiState extends State<Jadegui> {
runningEfi = true; runningEfi = true;
}); });
}); });
widget = summary( widget = SizedBox.expand(
child: FittedBox(
fit: BoxFit.contain,
alignment: Alignment.center,
child: SizedBox(
width: logicWidth,
height: logicHeight,
child: summary(
getSelectedLocPack(), getSelectedLocPack(),
getChosenLayout(), getChosenLayout(),
getChosenVariant(), getChosenVariant(),
@ -545,10 +619,20 @@ class _JadeguiState extends State<Jadegui> {
runningSum = true; runningSum = true;
}); });
}, },
),
),
),
); );
break; break;
case 8: case 8:
widget = install( widget = SizedBox.expand(
child: FittedBox(
fit: BoxFit.contain,
alignment: Alignment.center,
child: SizedBox(
width: logicWidth,
height: logicHeight,
child: install(
getSelectedLocPack(), getSelectedLocPack(),
getChosenLayout(), getChosenLayout(),
getChosenVariant(), getChosenVariant(),
@ -579,6 +663,9 @@ class _JadeguiState extends State<Jadegui> {
}); });
}, },
writeToLog, writeToLog,
),
),
),
); );
break; break;
default: default:

@ -6,6 +6,10 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <window_size/window_size_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) { void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) window_size_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "WindowSizePlugin");
window_size_plugin_register_with_registrar(window_size_registrar);
} }

@ -3,6 +3,7 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
window_size
) )
set(PLUGIN_BUNDLED_LIBRARIES) set(PLUGIN_BUNDLED_LIBRARIES)

@ -289,6 +289,15 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.4.4" version: "2.4.4"
window_size:
dependency: "direct main"
description:
path: "plugins/window_size"
ref: a738913c8ce2c9f47515382d40827e794a334274
resolved-ref: a738913c8ce2c9f47515382d40827e794a334274
url: "https://github.com/google/flutter-desktop-embedding.git"
source: git
version: "0.1.0"
xdg_directories: xdg_directories:
dependency: transitive dependency: transitive
description: description:

@ -36,6 +36,12 @@ dependencies:
cupertino_icons: ^1.0.2 cupertino_icons: ^1.0.2
process_run: ^0.12.3+2 process_run: ^0.12.3+2
path_provider: ^2.0.9 path_provider: ^2.0.9
window_size:
git:
url: https://github.com/google/flutter-desktop-embedding.git
path: plugins/window_size
ref: a738913c8ce2c9f47515382d40827e794a334274
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:

Loading…
Cancel
Save