Skip to content

Commit

Permalink
Merge pull request #21 from bostrot/fixed_light_theme
Browse files Browse the repository at this point in the history
Fixed light theme
  • Loading branch information
bostrot authored Apr 4, 2022
2 parents 82bd203 + 1af0ebb commit 3de0b88
Show file tree
Hide file tree
Showing 13 changed files with 81 additions and 56 deletions.
Binary file modified build/windows/runner/Release/data/app.so
Binary file not shown.
Binary file modified build/windows/runner/Release/desktop_window_plugin.dll
Binary file not shown.
Binary file modified build/windows/runner/Release/system_theme_plugin.dll
Binary file not shown.
Binary file modified build/windows/runner/Release/url_launcher_windows_plugin.dll
Binary file not shown.
Binary file modified build/windows/runner/Release/wsl2distromanager.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/components/constants.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// TODO: Update on release
const String currentVersion = "v0.9.0";
const String currentVersion = "v0.9.1";
const String windowsStoreUrl = "https://www.microsoft.com/store/"
"productId/9NWS9K95NMJB";
const String defaultPath = 'C:\\WSL2-Distros\\';
Expand Down
13 changes: 7 additions & 6 deletions lib/components/list_item.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'package:flutter/gestures.dart';
import 'package:wsl2distromanager/components/api.dart';
import 'package:wsl2distromanager/components/theme.dart';

import 'analytics.dart';
import 'package:fluent_ui/fluent_ui.dart';
Expand Down Expand Up @@ -70,8 +71,8 @@ class _ListItemState extends State<ListItem> {
borderRadius: BorderRadius.all(Radius.circular(8.0)),
),
tileColor: hovered
? const Color.fromRGBO(255, 255, 255, 0.2)
: Colors.grey,
? themeData.activeColor.withOpacity(0.1)
: themeData.activeColor.withOpacity(0.05),
title: MouseRegion(
cursor: SystemMouseCursors.click,
child: Listener(
Expand Down Expand Up @@ -103,7 +104,7 @@ class _ListItemState extends State<ListItem> {
WSLApi().start(widget.item,
startPath: startPath, startUser: startName);
Future.delayed(const Duration(milliseconds: 500),
widget.statusMsg('$widget.item started.'));
widget.statusMsg('${widget.item} started.'));
},
),
),
Expand Down Expand Up @@ -154,9 +155,9 @@ class Bar extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container(
decoration: const BoxDecoration(
color: Colors.grey,
borderRadius: BorderRadius.only(
decoration: BoxDecoration(
color: themeData.activeColor.withOpacity(0.05),
borderRadius: const BorderRadius.only(
bottomLeft: Radius.circular(5.0),
bottomRight: Radius.circular(5.0))),
child: Padding(
Expand Down
3 changes: 3 additions & 0 deletions lib/components/theme.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import 'package:fluent_ui/fluent_ui.dart';

ThemeData themeData = ThemeData();
3 changes: 1 addition & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'package:system_theme/system_theme.dart';
import 'package:bitsdojo_window/bitsdojo_window.dart';
import 'package:wsl2distromanager/components/analytics.dart';
import 'package:wsl2distromanager/components/helpers.dart';
import 'package:wsl2distromanager/components/theme.dart';
import 'package:wsl2distromanager/screens/home_screen.dart';

void main() async {
Expand All @@ -29,8 +30,6 @@ void main() async {
plausible.event();
}

ThemeData themeData = ThemeData();

class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);

Expand Down
9 changes: 7 additions & 2 deletions lib/screens/home_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:wsl2distromanager/components/constants.dart';
import 'package:wsl2distromanager/components/api.dart';
import 'package:wsl2distromanager/components/list.dart';
import 'package:wsl2distromanager/components/navbar.dart';
import 'package:wsl2distromanager/components/theme.dart';
import 'package:wsl2distromanager/dialogs/create_dialog.dart';
import 'package:wsl2distromanager/dialogs/info_dialog.dart';
import 'package:wsl2distromanager/screens/settings_screen.dart';
Expand Down Expand Up @@ -91,7 +92,10 @@ class _MyHomePageState extends State<MyHomePage> {
child: Padding(
padding: const EdgeInsets.only(top: 8.0),
child: Container(
color: const Color.fromRGBO(0, 0, 0, 0.2),
decoration: BoxDecoration(
color: themeData.activeColor.withOpacity(0.05),
borderRadius: const BorderRadius.all(Radius.circular(8.0)),
),
child: ListTile(
title: status == 'WIDGET' ? statusWidget : Text(status),
leading:
Expand All @@ -115,6 +119,7 @@ class _MyHomePageState extends State<MyHomePage> {
Widget build(BuildContext context) {
return NavigationView(
pane: NavigationPane(
displayMode: PaneDisplayMode.auto,
items: [
PaneItemAction(
icon: const Icon(FluentIcons.info),
Expand Down Expand Up @@ -154,7 +159,7 @@ class _MyHomePageState extends State<MyHomePage> {
statusMsg: statusMsg,
),
Padding(
padding: const EdgeInsets.all(15.0),
padding: const EdgeInsets.all(10.0),
child: statusBuilder(),
),
],
Expand Down
96 changes: 54 additions & 42 deletions lib/screens/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ class _SettingsPageState extends State<SettingsPage> {
child: SingleChildScrollView(
padding: const EdgeInsets.only(left: 20.0, right: 20.0),
child: SizedBox(
width: 400.0,
width: MediaQuery.of(context).size.width,
child: settingsList(context),
),
),
),
Padding(
padding: const EdgeInsets.all(8.0),
padding: const EdgeInsets.only(
left: 20.0, right: 20.0, bottom: 8.0, top: 2.0),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Button(
child: const Text('Edit .wslconfig directly'),
Expand All @@ -73,46 +74,57 @@ class _SettingsPageState extends State<SettingsPage> {
const SizedBox(
width: 10.0,
),
Button(
child: const Text('Restart WSL'),
style: ButtonStyle(
padding: ButtonState.all(const EdgeInsets.only(
left: 15.0, right: 15.0, top: 10.0, bottom: 10.0))),
onPressed: () {
WSLApi().restart();
Navigator.pop(context);
}),
const SizedBox(
width: 60.0,
),
Button(
child: const Text('Save'),
style: ButtonStyle(
padding: ButtonState.all(const EdgeInsets.only(
left: 15.0, right: 15.0, top: 10.0, bottom: 10.0))),
onPressed: () {
// Sync target ip setting _syncIpTextController
if (_syncIpTextController.text.isNotEmpty) {
prefs.setString("SyncIP", _syncIpTextController.text);
}
Row(
children: [
Button(
child: const Text('Restart WSL'),
style: ButtonStyle(
padding: ButtonState.all(const EdgeInsets.only(
left: 15.0,
right: 15.0,
top: 10.0,
bottom: 10.0))),
onPressed: () {
WSLApi().restart();
Navigator.pop(context);
}),
const SizedBox(
width: 10.0,
),
Button(
child: const Text('Save'),
style: ButtonStyle(
padding: ButtonState.all(const EdgeInsets.only(
left: 15.0,
right: 20.0,
top: 10.0,
bottom: 10.0))),
onPressed: () {
// Sync target ip setting _syncIpTextController
if (_syncIpTextController.text.isNotEmpty) {
prefs.setString(
"SyncIP", _syncIpTextController.text);
}

// Distro location setting
if (_settings['Default Distro Location']
.toString()
.isNotEmpty) {
prefs.setString("SaveLocation",
_settings['Default Distro Location']!.text);
}
String config = '';
_settings.forEach((key, value) {
if (key != 'Default Distro Location' &&
value.text.isNotEmpty) {
config += '$key=${value.text}\n';
}
});
WSLApi().writeConfig(config);
Navigator.pop(context);
}),
// Distro location setting
if (_settings['Default Distro Location']
.toString()
.isNotEmpty) {
prefs.setString("SaveLocation",
_settings['Default Distro Location']!.text);
}
String config = '';
_settings.forEach((key, value) {
if (key != 'Default Distro Location' &&
value.text.isNotEmpty) {
config += '$key=${value.text}\n';
}
});
WSLApi().writeConfig(config);
Navigator.pop(context);
}),
],
),
],
),
),
Expand Down
7 changes: 6 additions & 1 deletion pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ packages:
name: fluent_ui
url: "https://pub.dartlang.org"
source: hosted
version: "3.9.1"
version: "3.10.0"
flutter:
dependency: "direct main"
description: flutter
Expand All @@ -195,6 +195,11 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
flutter_localizations:
dependency: transitive
description: flutter
source: sdk
version: "0.0.0"
flutter_plugin_android_lifecycle:
dependency: transitive
description:
Expand Down
4 changes: 2 additions & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 0.9.0 # Current version
version: 0.9.1 # Current version

environment:
sdk: ">=2.12.0 <3.0.0"
Expand All @@ -34,7 +34,7 @@ dependencies:
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
desktop_window: ^0.4.0
fluent_ui: ^3.9.1
fluent_ui: ^3.10.0
system_theme: ^1.0.1
file_picker: ^4.5.1
url_launcher: ^6.0.20
Expand Down

0 comments on commit 3de0b88

Please sign in to comment.