Skip to content

Commit

Permalink
Merge pull request #396 from PixiEditor/master
Browse files Browse the repository at this point in the history
Version 0.1.8
  • Loading branch information
flabbet committed Mar 8, 2022
2 parents adbbeff + e80d40d commit 7d38ed6
Show file tree
Hide file tree
Showing 194 changed files with 4,189 additions and 3,459 deletions.
27 changes: 23 additions & 4 deletions .github/ISSUE_TEMPLATE/report_a_bug.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,32 @@ about: Report a bug, not working feature or anything related
---

**Describe as detailed as possible when it happens**

A clear and concise description of what the problem is. Ex. Holding CTRL+Z and P at the same time, causes program to crash

**Describe what you tried to do in order to fix it**
A clear and concise description of what you tried to do to fix the problem (if possible).
**Add reproduction steps**

If you are able to, include steps to reproduce bug

Example:
1. Create new file with size 64x64
2. Draw line anywhere
3. Center content
4. PixiEditor crashes

**Expected behaviour**

What should happen?

**Include related files,**

If bug makes PixiEditor crash, include crash report. If it is possible, include screenshots and videos.

**System information**

Windows version: 11/10/8/7

**Include screenshots of error**
If it is possible, include screenshots, videos etc.

**Additional context**

Add any other context here.
14 changes: 7 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# Contributing

Hey! Thanks for being interested in project! It means a lot. But, before contributing please read this guide :)
Hey! Thanks for being interested in the project! It means a lot. But, before contributing please read this guide :)

When contributing to this repository, please first discuss the change you wish to make via issue,
email, or any other method with the owners of this repository before making a change.

## Issues

If you want to report a bug, follow steps below, if you want to request a feature, check [this](https://github.com/flabbet/PixiEditor/blob/master/.github/ISSUE_TEMPLATE/feature_request.md)
If you want to report a bug, follow the steps below, if you want to request a feature, check [this](https://github.com/flabbet/PixiEditor/blob/master/.github/ISSUE_TEMPLATE/feature_request.md)

* First of all, check if the issue is on the [list](https://github.com/flabbet/PixiEditor/issues) and/or [board](https://github.com/flabbet/PixiEditor/projects), if yes, upvote it.

* If not, report an issue [here](https://github.com/flabbet/PixiEditor/issues) like that:
1. Clear as short as possible title
2. Describe issue as detailed as possible
3. Include screenshots if possible.
* If not, report an issue [here](https://github.com/flabbet/PixiEditor/issues) while following these guidelines:
1. Keep the title short and straightforward.
2. Describe the issue as detailed as possible
3. Include screenshots if you can.

## Pull Requests

Before pull request, read [this](https://github.com/flabbet/PixiEditor/blob/master/PULL_REQUEST_TEMPLATE.md)
Before submitting a pull request, read [this](https://github.com/flabbet/PixiEditor/blob/master/PULL_REQUEST_TEMPLATE.md)
7 changes: 5 additions & 2 deletions PixiEditor/App.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Application x:Class="PixiEditor.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="Views/MainWindow.xaml">
>
<!--StartupUri="Views/MainWindow.xaml"-->
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
Expand All @@ -17,6 +18,7 @@
<ResourceDictionary Source="Styles/DarkCheckboxStyle.xaml" />
<ResourceDictionary Source="Styles/ListSwitchButtonStyle.xaml" />
<ResourceDictionary Source="Styles/LabelStyles.xaml" />
<ResourceDictionary Source="Styles/PixiListBoxItemStyle.xaml" />
<ResourceDictionary Source="Styles/AvalonDock/DarkBrushes.xaml" />
<ResourceDictionary Source="Styles/AvalonDock/Themes/Menu/DarkBrushes.xaml" />
<ResourceDictionary Source="Styles/AvalonDock/Themes/OverlayButtons.xaml" />
Expand All @@ -25,7 +27,8 @@
<ResourceDictionary Source="Styles/AvalonDock/Themes/Generic.xaml" />
<ResourceDictionary Source="Styles/AvalonDock/PixiEditorDockTheme.xaml" />
<ResourceDictionary Source="Styles/TreeViewStyle.xaml" />
<ResourceDictionary Source="Styles/RadioButtonStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
</Application>
37 changes: 36 additions & 1 deletion PixiEditor/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
using PixiEditor.Models.Dialogs;
using PixiEditor.Models.DataHolders;
using PixiEditor.Models.Dialogs;
using PixiEditor.Models.Enums;
using PixiEditor.ViewModels;
using PixiEditor.Views.Dialogs;
using System;
using System.Diagnostics;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows;

namespace PixiEditor
Expand All @@ -11,6 +16,23 @@ namespace PixiEditor
/// </summary>
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
string arguments = string.Join(' ', e.Args);

if (ParseArgument("--crash (\"?)([A-z0-9:\\/\\ -_.]+)\\1", arguments, out Group[] groups))
{
CrashReport report = CrashReport.Parse(groups[2].Value);
MainWindow = new CrashReportDialog(report);
}
else
{
MainWindow = new MainWindow();
}

MainWindow.Show();
}

protected override void OnSessionEnding(SessionEndingCancelEventArgs e)
{
base.OnSessionEnding(e);
Expand All @@ -21,5 +43,18 @@ protected override void OnSessionEnding(SessionEndingCancelEventArgs e)
e.Cancel = confirmation != ConfirmationType.Yes;
}
}

private bool ParseArgument(string pattern, string args, out Group[] groups)
{
Match match = Regex.Match(args, pattern, RegexOptions.IgnoreCase);
groups = null;

if (match.Success)
{
groups = match.Groups.Values.ToArray();
}

return match.Success;
}
}
}
19 changes: 0 additions & 19 deletions PixiEditor/Exceptions/ArrayLengthMismatchException.cs

This file was deleted.

2 changes: 1 addition & 1 deletion PixiEditor/Exceptions/CorruptedFileException.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ namespace PixiEditor.Exceptions
public class CorruptedFileException : Exception
{
public CorruptedFileException()
: base("Selected file is invalid or corrupted.")
: base("The file you've chosen might be corrupted.")
{
}

Expand Down
106 changes: 0 additions & 106 deletions PixiEditor/Helpers/Behaviours/AllowableCharactersTextBoxBehavior.cs

This file was deleted.

11 changes: 9 additions & 2 deletions PixiEditor/Helpers/Behaviours/ClearFocusOnClickBehavior.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using PixiEditor.Models.Controllers.Shortcuts;
using System.Windows;
using System.Windows.Input;
using System.Windows.Interactivity;

namespace PixiEditor.Helpers.Behaviours
Expand All @@ -8,8 +9,14 @@ public class ClearFocusOnClickBehavior : Behavior<FrameworkElement>
{
protected override void OnAttached()
{
AssociatedObject.MouseDown += AssociatedObject_MouseDown;
base.OnAttached();
AssociatedObject.MouseDown += AssociatedObject_MouseDown;
AssociatedObject.LostKeyboardFocus += AssociatedObject_LostKeyboardFocus;
}

private void AssociatedObject_LostKeyboardFocus(object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e)
{

}

protected override void OnDetaching()
Expand All @@ -20,7 +27,7 @@ protected override void OnDetaching()
private void AssociatedObject_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
AssociatedObject.Focus();
ShortcutController.BlockShortcutExecution = false;
ShortcutController.UnblockShortcutExecutionAll();
}
}
}
4 changes: 2 additions & 2 deletions PixiEditor/Helpers/Behaviours/GlobalShortcutFocusBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ protected override void OnDetaching()

private void AssociatedObject_LostKeyboardFocus(object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e)
{
ShortcutController.BlockShortcutExecution = false;
ShortcutController.UnblockShortcutExecution("GlobalShortcutFocusBehavior");
}

private void AssociatedObject_GotKeyboardFocus(object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e)
{
ShortcutController.BlockShortcutExecution = true;
ShortcutController.BlockShortcutExection("GlobalShortcutFocusBehavior");
}
}
}

0 comments on commit 7d38ed6

Please sign in to comment.