Skip to content

Commit bbd198b

Browse files
committed
Update
- experimental features which include ntfs related tweaks for now - added legacy notification balloons
1 parent 036a6f9 commit bbd198b

File tree

6 files changed

+267
-8
lines changed

6 files changed

+267
-8
lines changed

lib/screens/pages/performancePage.dart

Lines changed: 141 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import 'package:fluent_ui/fluent_ui.dart';
33

44
import 'package:revitool/utils.dart';
55
import 'package:revitool/widgets/card_highlight.dart';
6+
import 'package:revitool/widgets/subtitle.dart';
67
import 'package:win32_registry/win32_registry.dart';
78
import 'package:process_run/shell_run.dart';
89
import 'package:fluentui_system_icons/fluentui_system_icons.dart' as msicons;
@@ -24,14 +25,18 @@ class _PerformancePageState extends State<PerformancePage> {
2425

2526
bool foBool = readRegistryInt(RegistryHive.currentUser, r'System\GameConfigStore', "GameDVR_FSEBehaviorMode") != 2;
2627

28+
//NTFS
29+
bool ntfsLTABool = readRegistryInt(RegistryHive.localMachine, r'SYSTEM\ControlSet001\Control\FileSystem', "RefsDisableLastAccessUpdate") != 1;
30+
bool ntfsEdTBool = readRegistryInt(RegistryHive.localMachine, r'SYSTEM\ControlSet001\Control\FileSystem', "NtfsDisable8dot3NameCreation") != 1;
31+
bool ntfsMUBool = readRegistryInt(RegistryHive.localMachine, r'SYSTEM\ControlSet001\Control\FileSystem', "NtfsMemoryUsage") == 2;
32+
2733
@override
2834
Widget build(BuildContext context) {
2935
return ScaffoldPage.scrollable(
3036
header: const PageHeader(
3137
title: Text('Performance'),
3238
),
3339
children: [
34-
// subtitle(content: const Text('A simple ToggleSwitch')),
3540
CardHighlight(
3641
child: Row(
3742
children: [
@@ -232,6 +237,141 @@ class _PerformancePageState extends State<PerformancePage> {
232237
],
233238
),
234239
),
240+
241+
if (expBool) ...[
242+
subtitle(content: const Text("NTFS")),
243+
CardHighlight(
244+
child: Row(
245+
children: [
246+
const SizedBox(width: 5.0),
247+
const Icon(FluentIcons.time_entry, size: 24),
248+
const SizedBox(width: 15.0),
249+
Expanded(
250+
child: SizedBox(
251+
child: Column(
252+
crossAxisAlignment: CrossAxisAlignment.start,
253+
children: [
254+
InfoLabel(label: 'Last Access Time'),
255+
Text(
256+
"Disabling Last Time Access improves the speed of file and directory access, reduces disk I/O load and latency",
257+
style: FluentTheme.of(context).brightness.isDark
258+
? const TextStyle(fontSize: 11, color: Color.fromARGB(255, 200, 200, 200), overflow: TextOverflow.fade)
259+
: const TextStyle(fontSize: 11, color: Color.fromARGB(255, 117, 117, 117), overflow: TextOverflow.fade),
260+
)
261+
],
262+
),
263+
),
264+
),
265+
const SizedBox(width: 5.0),
266+
Text(ntfsLTABool ? "On" : "Off"),
267+
const SizedBox(width: 10.0),
268+
ToggleSwitch(
269+
checked: ntfsLTABool,
270+
onChanged: (bool value) async {
271+
setState(() {
272+
ntfsLTABool = value;
273+
});
274+
275+
if (ntfsLTABool) {
276+
await run('fsutil behavior set disableLastAccess 0');
277+
} else {
278+
await run('fsutil behavior set disableLastAccess 1');
279+
}
280+
},
281+
),
282+
],
283+
),
284+
),
285+
const SizedBox(height: 5.0),
286+
CardHighlight(
287+
child: Row(
288+
children: [
289+
const SizedBox(width: 5.0),
290+
const Icon(FluentIcons.file_system, size: 24),
291+
const SizedBox(width: 15.0),
292+
Expanded(
293+
child: SizedBox(
294+
child: Column(
295+
crossAxisAlignment: CrossAxisAlignment.start,
296+
children: [
297+
InfoLabel(label: '8.3 Naming'),
298+
Text(
299+
"Disabling 8.3 names improves speed and security",
300+
style: FluentTheme.of(context).brightness.isDark
301+
? const TextStyle(fontSize: 11, color: Color.fromARGB(255, 200, 200, 200), overflow: TextOverflow.fade)
302+
: const TextStyle(fontSize: 11, color: Color.fromARGB(255, 117, 117, 117), overflow: TextOverflow.fade),
303+
)
304+
],
305+
),
306+
),
307+
),
308+
const SizedBox(width: 5.0),
309+
Text(ntfsEdTBool ? "On" : "Off"),
310+
const SizedBox(width: 10.0),
311+
ToggleSwitch(
312+
checked: ntfsEdTBool,
313+
onChanged: (bool value) async {
314+
setState(() {
315+
ntfsEdTBool = value;
316+
});
317+
318+
if (ntfsEdTBool) {
319+
await run('fsutil behavior set disable8dot3 0');
320+
} else {
321+
await run('fsutil behavior set disable8dot3 1');
322+
}
323+
},
324+
),
325+
],
326+
),
327+
),
328+
const SizedBox(height: 5.0),
329+
CardHighlight(
330+
expandTitle: "More information",
331+
codeSnippet:
332+
"Increasing the physical memory doesn't always increase the amount of paged pool memory available to NTFS. Setting memoryusage to 2 raises the limit of paged pool memory. This might improve performance if your system is opening and closing many files in the same file set and is not already using large amounts of system memory for other apps or for cache memory. If your computer is already using large amounts of system memory for other apps or for cache memory, increasing the limit of NTFS paged and non-paged pool memory reduces the available pool memory for other processes. This might reduce overall system performance.\n\nDefault is Off",
333+
child: Row(
334+
children: [
335+
const SizedBox(width: 5.0),
336+
const Icon(FluentIcons.hard_drive_unlock, size: 24),
337+
const SizedBox(width: 15.0),
338+
Expanded(
339+
child: SizedBox(
340+
child: Column(
341+
crossAxisAlignment: CrossAxisAlignment.start,
342+
children: [
343+
InfoLabel(label: 'Increase the limit of paged pool memory to NTFS'),
344+
// Text(
345+
// "improve performance if your system is opening and closing many files in the same file set and is not already using large amounts of system memory for other apps or for cache memory",
346+
// style: FluentTheme.of(context).brightness.isDark
347+
// ? const TextStyle(fontSize: 11, color: Color.fromARGB(255, 200, 200, 200), overflow: TextOverflow.fade)
348+
// : const TextStyle(fontSize: 11, color: Color.fromARGB(255, 117, 117, 117), overflow: TextOverflow.fade),
349+
// )
350+
],
351+
),
352+
),
353+
),
354+
const SizedBox(width: 5.0),
355+
Text(ntfsMUBool ? "On" : "Off"),
356+
const SizedBox(width: 10.0),
357+
ToggleSwitch(
358+
checked: ntfsMUBool,
359+
onChanged: (bool value) async {
360+
setState(() {
361+
ntfsMUBool = value;
362+
});
363+
364+
if (ntfsMUBool) {
365+
await run('fsutil behavior set memoryusage 2');
366+
} else {
367+
await run('fsutil behavior set memoryusage 1');
368+
}
369+
},
370+
),
371+
],
372+
),
373+
),
374+
]
235375
],
236376
);
237377
}

lib/screens/pages/usabilityPage.dart

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class UsabilityPage extends StatefulWidget {
1414

1515
class _UsabilityPageState extends State<UsabilityPage> {
1616
bool notifBool = readRegistryInt(RegistryHive.localMachine, r'SOFTWARE\Policies\Microsoft\Windows\Explorer', 'IsNotificationsEnabled') == 1;
17+
bool elbnBool = readRegistryInt(RegistryHive.currentUser, r'Software\Policies\Microsoft\Windows\Explorer', 'EnableLegacyBalloonNotifications') != 0;
1718
bool itpBool = readRegistryInt(RegistryHive.localMachine, r'SOFTWARE\Policies\Microsoft\InputPersonalization', 'AllowInputPersonalization') == 1;
1819
bool foBool = false;
1920
@override
@@ -91,6 +92,58 @@ class _UsabilityPageState extends State<UsabilityPage> {
9192
),
9293
),
9394
//
95+
if (notifBool) ...[
96+
const SizedBox(height: 5.0),
97+
CardHighlight(
98+
child: Row(
99+
children: [
100+
const SizedBox(width: 5.0),
101+
const Icon(
102+
FluentIcons.balloons,
103+
size: 24,
104+
),
105+
const SizedBox(width: 15.0),
106+
Expanded(
107+
child: SizedBox(
108+
child: Column(
109+
crossAxisAlignment: CrossAxisAlignment.start,
110+
children: [
111+
InfoLabel(label: 'Legacy Notification Balloons'),
112+
// Text(
113+
// "Get notified if there's something new",
114+
// style: FluentTheme.of(context).brightness.isDark
115+
// ? const TextStyle(fontSize: 11, color: Color.fromARGB(255, 200, 200, 200), overflow: TextOverflow.fade)
116+
// : const TextStyle(fontSize: 11, color: Color.fromARGB(255, 117, 117, 117), overflow: TextOverflow.fade),
117+
// )
118+
],
119+
),
120+
),
121+
),
122+
const SizedBox(width: 5.0),
123+
Text(elbnBool ? "On" : "Off"),
124+
const SizedBox(width: 10.0),
125+
ToggleSwitch(
126+
checked: elbnBool,
127+
onChanged: (bool value) async {
128+
setState(() {
129+
elbnBool = value;
130+
});
131+
if (elbnBool) {
132+
writeRegistryDword(Registry.currentUser, r'Software\Policies\Microsoft\Windows\Explorer', 'EnableLegacyBalloonNotifications', 1);
133+
await Process.run('taskkill.exe', ['/im', 'explorer.exe', '/f']);
134+
await Process.run('explorer.exe', [], runInShell: true);
135+
} else {
136+
writeRegistryDword(Registry.currentUser, r'Software\Policies\Microsoft\Windows\Explorer', 'EnableLegacyBalloonNotifications', 0);
137+
await Process.run('taskkill.exe', ['/im', 'explorer.exe', '/f']);
138+
await Process.run('explorer.exe', [], runInShell: true);
139+
}
140+
},
141+
),
142+
],
143+
),
144+
),
145+
],
146+
94147
const SizedBox(height: 5.0),
95148
CardHighlight(
96149
child: Row(

lib/screens/settings.dart

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import 'package:fluent_ui/fluent_ui.dart';
22
import 'package:provider/provider.dart';
33
import 'package:revitool/theme.dart';
4+
import 'package:revitool/utils.dart';
45
import 'package:revitool/widgets/card_highlight.dart';
56

67
class SettingsPage extends StatefulWidget {
@@ -80,6 +81,43 @@ class _SettingsPageState extends State<SettingsPage> {
8081
],
8182
),
8283
),
84+
const SizedBox(height: 5.0),
85+
CardHighlight(
86+
child: Row(
87+
children: [
88+
const SizedBox(width: 5.0),
89+
const Icon(FluentIcons.picture_library, size: 24),
90+
const SizedBox(width: 15.0),
91+
Expanded(
92+
child: SizedBox(
93+
child: Column(
94+
crossAxisAlignment: CrossAxisAlignment.start,
95+
children: [
96+
InfoLabel(label: 'Experimental tweaks'),
97+
// Text(
98+
// "Experimental",
99+
// style: FluentTheme.of(context).brightness.isDark
100+
// ? const TextStyle(fontSize: 11, color: Color.fromARGB(255, 200, 200, 200), overflow: TextOverflow.fade)
101+
// : const TextStyle(fontSize: 11, color: Color.fromARGB(255, 117, 117, 117), overflow: TextOverflow.fade),
102+
// )
103+
],
104+
),
105+
),
106+
),
107+
const SizedBox(width: 5.0),
108+
Text(expBool ? "On" : "Off"),
109+
const SizedBox(width: 10.0),
110+
ToggleSwitch(
111+
checked: expBool,
112+
onChanged: (bool value) async {
113+
setState(() {
114+
expBool = value;
115+
});
116+
},
117+
),
118+
],
119+
),
120+
),
83121
],
84122
);
85123
}

lib/utils.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ String mainPath = Platform.resolvedExecutable;
88
// nsudo path
99
Directory directoryExe = Directory("${mainPath.substring(0, mainPath.lastIndexOf("\\"))}\\data\\flutter_assets\\additionals");
1010

11+
// Experimental features
12+
bool expBool = false;
13+
1114
int? readRegistryInt(RegistryHive hive, String path, String value) {
1215
return Registry.openPath(
1316
hive,

lib/widgets/card_highlight.dart

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,11 @@ import 'dart:math';
33
import 'package:fluent_ui/fluent_ui.dart';
44

55
class CardHighlight extends StatefulWidget {
6-
const CardHighlight({
7-
Key? key,
8-
this.backgroundColor,
9-
required this.child,
10-
this.codeSnippet,
11-
}) : super(key: key);
6+
const CardHighlight({Key? key, this.backgroundColor, required this.child, this.codeSnippet, this.expandTitle}) : super(key: key);
127

138
final Widget child;
149
final String? codeSnippet;
15-
10+
final String? expandTitle;
1611
final Color? backgroundColor;
1712

1813
@override
@@ -27,6 +22,7 @@ class _CardHighlightState extends State<CardHighlight> with AutomaticKeepAliveCl
2722

2823
@override
2924
Widget build(BuildContext context) {
25+
final theme = FluentTheme.of(context);
3026
super.build(context);
3127
return Column(children: [
3228
Card(
@@ -42,6 +38,21 @@ class _CardHighlightState extends State<CardHighlight> with AutomaticKeepAliveCl
4238
),
4339
),
4440
),
41+
if (widget.expandTitle != null) ...[
42+
Expander(
43+
key: PageStorageKey(key),
44+
headerShape: (open) => const RoundedRectangleBorder(
45+
borderRadius: BorderRadius.zero,
46+
),
47+
onStateChanged: (state) {
48+
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
49+
if (mounted) setState(() => isOpen = state);
50+
});
51+
},
52+
header: Text("${widget.expandTitle}"),
53+
content: Text("${widget.codeSnippet}"),
54+
),
55+
]
4556
]);
4657
}
4758

lib/widgets/subtitle.dart

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import 'package:fluent_ui/fluent_ui.dart';
2+
import 'package:flutter/widgets.dart';
3+
4+
Widget subtitle({required Widget content}) {
5+
return Builder(builder: (context) {
6+
return Padding(
7+
padding: const EdgeInsets.only(top: 14.0, bottom: 2.0),
8+
child: DefaultTextStyle(
9+
style: FluentTheme.of(context).typography.subtitle!,
10+
child: content,
11+
),
12+
);
13+
});
14+
}

0 commit comments

Comments
 (0)