Skip to content

Commit

Permalink
Fix build error and added fi-FI contributor name
Browse files Browse the repository at this point in the history
Fix build error and added fi-FI contributor name
  • Loading branch information
0x7c13 committed Jul 14, 2019
1 parent 4684484 commit e1f9f3b
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ So here comes the “Notepads” 🎉 (s stands for Sets).

* Ctrl+N/T to create new tab.
* Ctrl+(Shift)+Tab to switch between tabs.
* Ctrl+"+" to increase font size and Ctrl+"-" to decrease font size. Ctrl+"0" to reset font size to default.
* Ctrl+"+"/"-" to increase/decrease font size. Ctrl+"0" to reset font size to default.
* Ctrl+L/R to change text flow direction. (LTR/RTL)

## Author’s Notes:
Expand Down Expand Up @@ -81,6 +81,7 @@ On the other hand, you might noticed that I work for Microsoft. However, Notepad
* [ja-JP][Japanese]: [Mamoru Satoh](https://github.com/pnp0a03)
* [de-DE][German]/[de-CH][German (Switzerland)]: [Walter Wolf](https://github.com/WalterWolf49)
* [ru-RU][Russian]: [Pavel Erokhin](https://github.com/MairwunNx)
* [fi-FI][Finnish]: [Esa Elo](https://github.com/sauihdik)

## Stay tuned 📢:

Expand Down
35 changes: 18 additions & 17 deletions src/Notepads/Controls/TextEditor/TextEditor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace Notepads.Controls.TextEditor

namespace Notepads.Controls.TextEditor
{
using Notepads.Services;
using Notepads.Utilities;
Expand Down Expand Up @@ -43,14 +44,13 @@ public TextEditor()
HorizontalAlignment = HorizontalAlignment.Stretch;
VerticalAlignment = VerticalAlignment.Stretch;
HandwritingView.BorderThickness = new Thickness(0);

ContextFlyout = new TextEditorContextFlyout(this);
TextChanging += TextEditor_TextChanging;
Paste += async (sender, args) => await PastePlainTextFromWindowsClipboard(args);
PointerWheelChanged += OnPointerWheelChanged;

SetDefaultTabStop(FontFamily, FontSize);

PointerWheelChanged += OnPointerWheelChanged;
EditorSettingsService.OnFontFamilyChanged += (sender, fontFamily) =>
{
FontFamily = new FontFamily(fontFamily);
Expand All @@ -75,21 +75,22 @@ private void OnPointerWheelChanged(object sender, PointerRoutedEventArgs e)
var alt = Window.Current.CoreWindow.GetKeyState(VirtualKey.Menu);
var shift = Window.Current.CoreWindow.GetKeyState(VirtualKey.Shift);

if (!ctrl.HasFlag(CoreVirtualKeyStates.Down) ||
alt.HasFlag(CoreVirtualKeyStates.Down) ||
shift.HasFlag(CoreVirtualKeyStates.Down)) return;

var currentPoint = e.GetCurrentPoint(this);
if (currentPoint.Properties.MouseWheelDelta > 0)
{
SetDefaultTabStop(FontFamily, FontSize + 2);
FontSize += 2;
}
else
if (ctrl.HasFlag(CoreVirtualKeyStates.Down) &&
!alt.HasFlag(CoreVirtualKeyStates.Down) &&
!shift.HasFlag(CoreVirtualKeyStates.Down))
{
if (!(FontSize > 4)) return;
SetDefaultTabStop(FontFamily, FontSize - 2);
FontSize -= 2;
var mouseWheelDelta = e.GetCurrentPoint(this).Properties.MouseWheelDelta;
if (mouseWheelDelta > 0)
{
SetDefaultTabStop(FontFamily, FontSize + 1);
FontSize += 1;
}
else if (mouseWheelDelta < 0)
{
if (!(FontSize > 4)) return;
SetDefaultTabStop(FontFamily, FontSize - 1);
FontSize -= 1;
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Notepads/Notepads.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@
</ItemGroup>
<ItemGroup>
<PRIResource Include="Strings\fi-FI\Resources.resw" />
</ItemGroup
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
Expand Down
5 changes: 3 additions & 2 deletions src/Notepads/Strings/fi-FI/Resources.resw
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
Expand Down Expand Up @@ -141,7 +142,7 @@
<comment>ContentSharing: Failure message when user trying to share empty content.</comment>
</data>
<data name="ErrorMessage_NotepadsFileSizeLimit" xml:space="preserve">
<value>Notepads ei tällä hetkellä tue tiedostoja, joiden koko on suurempi kuin 1&nbsp;MB.</value>
<value>Notepads ei tällä hetkellä tue tiedostoja, joiden koko on suurempi kuin 1MB.</value>
<comment>ErrorMessage: NotepadsFileSizeLimit text.</comment>
</data>
<data name="FileOpenErrorDialog_Content" xml:space="preserve">
Expand Down Expand Up @@ -320,4 +321,4 @@
<value>Tallennettu</value>
<comment>TextEditor: Notification message when file has been saved successfully.</comment>
</data>
</root>
</root>

0 comments on commit e1f9f3b

Please sign in to comment.