Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes and updates #244

Merged
merged 12 commits into from
Apr 28, 2024
4 changes: 2 additions & 2 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
- name: Create zip
if: ${{ steps.get_version.outputs.exists == 'true' }}
run: |
Move-Item .\build\windows\runner\Release\wsl2distromanager.msix .\wsl2-distro-manager-v${{ steps.get_version.outputs.version }}-nightly.msix
Move-Item .\build\windows\x64\runner\Release\wsl2distromanager.msix .\wsl2-distro-manager-v${{ steps.get_version.outputs.version }}-nightly.msix
Copy-Item -Path ./windows-dlls/* -Destination ./build/windows/runner/Release/
Compress-Archive -Path ./build/windows/runner/Release/* -DestinationPath .\wsl2-distro-manager-v${{ steps.get_version.outputs.version }}-nightly.zip
- uses: actions/upload-artifact@v3
Expand All @@ -77,7 +77,7 @@ jobs:
- name: Create release
if: ${{ steps.get_version.outputs.exists == 'false' && github.ref == 'refs/heads/main' }}
run: |
Move-Item .\build\windows\runner\Release\wsl2distromanager.msix .\wsl2-distro-manager-v${{ steps.get_version.outputs.version }}-unsigned.msix
Move-Item .\build\windows\x64\runner\Release\wsl2distromanager.msix .\wsl2-distro-manager-v${{ steps.get_version.outputs.version }}-unsigned.msix
Copy-Item -Path ./windows-dlls/* -Destination ./build/windows/runner/Release/
Compress-Archive -Path ./build/windows/runner/Release/* -DestinationPath .\wsl2-distro-manager-v${{ steps.get_version.outputs.version }}.zip
gh release create v${{ steps.get_version.outputs.version }} .\wsl2-distro-manager-v${{ steps.get_version.outputs.version }}.zip .\wsl2-distro-manager-v${{ steps.get_version.outputs.version }}-unsigned.msix --generate-notes --notes "This is an automated release."
Expand Down
691 changes: 462 additions & 229 deletions lib/oss_licenses.dart

Large diffs are not rendered by default.

65 changes: 34 additions & 31 deletions lib/screens/actions_screen.dart
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import 'package:fluent_ui/fluent_ui.dart';
import 'package:localization/localization.dart';
import 'package:re_editor/re_editor.dart';
import 'package:wsl2distromanager/components/analytics.dart';
import 'package:wsl2distromanager/components/helpers.dart';
import 'package:wsl2distromanager/dialogs/base_dialog.dart';
import 'package:wsl2distromanager/dialogs/qa_dialog.dart';
import 'package:wsl2distromanager/theme.dart';
import 'package:wsl2distromanager/api/quick_actions.dart';
import 'package:re_highlight/languages/bash.dart';
import 'package:re_highlight/styles/atom-one-light.dart';

class QuickPage extends StatefulWidget {
const QuickPage({Key? key}) : super(key: key);
Expand All @@ -18,9 +21,9 @@ class QuickPageState extends State<QuickPage> {
List<Widget> quickSettings = [];
String lineNumbers = '';
bool showInput = false;
ScrollController scrollController = ScrollController();
TextEditingController nameController = TextEditingController();
TextEditingController contentController = TextEditingController();
var scrollController = ScrollController();
var nameController = TextEditingController();
var contentController = CodeLineEditingController();
int lineNum = 30;

@override
Expand Down Expand Up @@ -81,7 +84,7 @@ class QuickPageState extends State<QuickPage> {
: Container(),
// TODO: Better line numbers
showInput
? CodeEditor(
? Editor(
contentController: contentController,
scrollController: scrollController,
lineNumbers: lineNumbers,
Expand Down Expand Up @@ -357,47 +360,47 @@ class QuickPageState extends State<QuickPage> {
}
}

class CodeEditor extends StatelessWidget {
const CodeEditor({
class Editor extends StatelessWidget {
const Editor({
Key? key,
required this.contentController,
required this.scrollController,
required this.lineNumbers,
required this.lineNum,
}) : super(key: key);

final TextEditingController contentController;
final CodeLineEditingController contentController;
final ScrollController scrollController;
final String lineNumbers;
final int lineNum;

@override
Widget build(BuildContext context) {
return SizedBox(
height: MediaQuery.of(context).size.height * 0.72,
width: MediaQuery.of(context).size.width * 0.9,
child: TextBox(
controller: contentController,
scrollController: scrollController,
style: const TextStyle(
fontFamily: 'Consolas',
fontSize: 12.0,
),
prefix: Padding(
padding: const EdgeInsets.only(left: 8.0, top: 3.0),
child: Text(
lineNumbers,
style: TextStyle(
color: AppTheme().color.normal,
fontFamily: 'Consolas',
fontSize: 12.0,
height: MediaQuery.of(context).size.height * 0.68,
width: MediaQuery.of(context).size.width * 0.9,
child: CodeEditor(
hint: '# ${'yourcodehere-text'.i18n()}',
indicatorBuilder:
(context, editingController, chunkController, notifier) {
return Row(
children: [
DefaultCodeLineNumber(
controller: editingController,
notifier: notifier,
),
DefaultCodeChunkIndicator(
width: 20,
controller: chunkController,
notifier: notifier)
],
);
},
style: CodeEditorStyle(
codeTheme: CodeHighlightTheme(
languages: {'bash': CodeHighlightThemeMode(mode: langBash)},
theme: atomOneLightTheme),
),
),
),
minLines: lineNum,
maxLines: lineNum,
placeholder: '# ${'yourcodehere-text'.i18n()}',
),
);
controller: contentController));
}
}
10 changes: 3 additions & 7 deletions lib/screens/settings_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,7 @@ class SettingsPageState extends State<SettingsPage> {

// Distro location setting
if (_settings['Default Distro Location']!.text.isNotEmpty) {
prefs.setString(
"DistroPath", _settings['Default Distro Location']!.text);
prefs.setString("DistroPath", _settings['Default Distro Location']!.text);
}
_settings.forEach((key, value) {
if (key != 'Default Distro Location' && value.text.isNotEmpty) {
Expand All @@ -190,7 +189,8 @@ class SettingsPageState extends State<SettingsPage> {
icon: const Icon(FluentIcons.open_folder_horizontal, size: 15.0),
onPressed: () async {
String? path = await FilePicker.platform.getDirectoryPath(
initialDirectory: prefs.getString("DistroPath") ?? defaultPath,
initialDirectory:
prefs.getString("DistroPath") ?? defaultPath,
);
if (path != null &&
_settings['Default Distro Location'] != null) {
Expand Down Expand Up @@ -380,10 +380,6 @@ class SettingsPageState extends State<SettingsPage> {
title: 'swap', tooltip: 'swapinfo-text'.i18n(), placeholder: ''),
settingsWidget(context,
title: 'swapFile', tooltip: 'vhdinfo-text'.i18n(), placeholder: ''),
settingsWidget(context,
title: 'pageReporting',
tooltip: 'unusedmemoryinfo-text'.i18n(),
type: SettingsType.bool),
settingsWidget(context,
title: 'guiApplications',
tooltip: 'guiinfo-text'.i18n(),
Expand Down
Loading
Loading