Skip to content
This repository was archived by the owner on Nov 15, 2025. It is now read-only.

Commit 024c7d6

Browse files
Samuel12321VasilisPatkarpovv-borisANT0x1Sam
authored
Dev merge for 0.9.3 (#582)
* Updated Greek Translation (#495) * Updated Greek Translation * Fixed Num Lock Flyout Out of Margins * Flyout animation toggle (#511) * widget animation toggle * translation added * Flyout animation toggle - done * minor changes * typo in ru translation * Update Russian translation (#510) * Update ModernFlyouts.ru.xlf * Update README.md * Update README.md * Update ModernFlyouts/MultilingualResources/ModernFlyouts.ru.xlf * Update ModernFlyouts/MultilingualResources/ModernFlyouts.ru.xlf * Apply suggestions from code review * - Updated Nuget Packages * Localized Manifest * Remove redundant playground * .wapproj simplification remove redundant windows.universal target * . * Update nuget packages * Update Nuget Packages * Minor cleanup * Finally! Fixed #4 - Bug: Audio flyout is not shown when the volume is changed through means other than media keys Fixed #470 - Bug: Flyouts doesn't appear while holding any mousebutton * fix null crash * Revert "fix null crash" This reverts commit 4ef6985. * Minor fixes * Translated all strings to danish (#516) * Fix issue template syntax error (#509) * Add some translators into the list in README (#505) * Updated translators list on README * Translated all strings to danish Co-authored-by: Myuki <myuki@outlook.ie> Co-authored-by: imgradeone <30969327+imgradeone@users.noreply.github.com> * Temp enable both zh-hans and zh-cn * Update Ukrainian translation (#545) * Fix issue template syntax error (#509) * Add some translators into the list in README (#505) * Updated translators list on README * Update ModernFlyouts.uk.xlf * Update ModernFlyouts.uk.xlf * Update ModernFlyouts.uk.xlf very important commit) Co-authored-by: Myuki <myuki@outlook.ie> Co-authored-by: imgradeone <30969327+imgradeone@users.noreply.github.com> Co-authored-by: Sam <35312698+Samuel12321@users.noreply.github.com> * Re-Updated Turkish Translation (#562) * Fix issue template syntax error (#509) * Add some translators into the list in README (#505) * Updated translators list on README * Re-Updated Turkish Translation * Re-Updated Turkish Translation v2 Co-authored-by: Myuki <myuki@outlook.ie> Co-authored-by: imgradeone <30969327+imgradeone@users.noreply.github.com> * Fix syntax error for settings.off * updates Co-authored-by: Vasilis Patelis <65589110+VasilisPat@users.noreply.github.com> Co-authored-by: karpovv-boris <78983523+karpovv-boris@users.noreply.github.com> Co-authored-by: Tony <ANT0x1@users.noreply.github.com> Co-authored-by: sam <sam> Co-authored-by: Sam <samuelgilliessmith@hotmail.com> Co-authored-by: Shankar <shankarbus04082001@hotmail.com> Co-authored-by: Emil Nymann Sølyst <emilnymann96@gmail.com> Co-authored-by: Myuki <myuki@outlook.ie> Co-authored-by: imgradeone <30969327+imgradeone@users.noreply.github.com> Co-authored-by: PlayDay <18056374+playday3008@users.noreply.github.com> Co-authored-by: Eren <75967441+ErenAKGUN2007@users.noreply.github.com>
1 parent 6ed9187 commit 024c7d6

77 files changed

Lines changed: 3484 additions & 694 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
<PropertyGroup>
33
<Authors>ModernFlyouts Community</Authors>
44
<LangVersion>latest</LangVersion>
5-
<Version>0.9.1</Version>
5+
<Version>0.9.3</Version>
66
</PropertyGroup>
77
</Project>

ModernFlyouts.Core/Interop/BandWindow.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,6 @@ public void CreateWindow()
347347

348348
hookManager.OnHwndCreated(hWnd);
349349

350-
//WindowCompositionHelper.MakeWindowTransparent(hWnd);
351-
352350
HwndSourceParameters param = new()
353351
{
354352
WindowStyle = (int)(WindowStyles.WS_VISIBLE | WindowStyles.WS_CHILD),

ModernFlyouts.Core/Interop/WindowCompositionHelper.cs

Lines changed: 0 additions & 69 deletions
This file was deleted.

ModernFlyouts.Core/Media/Control/GSMTCMediaSession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ private async void UpdateSessionInfo(GlobalSystemMediaTransportControlsSession s
165165
{
166166
> 0 => MediaPlaybackTrackChangeDirection.Forward,
167167
< 0 => MediaPlaybackTrackChangeDirection.Backward,
168-
_ => throw new NotImplementedException()
168+
_ => MediaPlaybackTrackChangeDirection.Unknown
169169
};
170170
}
171171

ModernFlyouts.Core/Media/Control/NowPlayingMediaSession.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ private void UpdateSessionInfo()
180180
{
181181
> 0 => MediaPlaybackTrackChangeDirection.Forward,
182182
< 0 => MediaPlaybackTrackChangeDirection.Backward,
183-
_ => throw new NotImplementedException()
183+
_ => MediaPlaybackTrackChangeDirection.Unknown
184184
};
185185
}
186186

ModernFlyouts.Core/Media/Control/NowPlayingMediaSessionManager.cs

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
using ModernFlyouts.Core.Helpers;
1+
using ModernFlyouts.Core.Threading;
22
using ModernFlyouts.Core.Utilities;
33
using NPSMLib;
44
using System;
55
using System.Linq;
6+
using System.Threading.Tasks;
67

78
namespace ModernFlyouts.Core.Media.Control
89
{
@@ -12,30 +13,36 @@ public class NowPlayingMediaSessionManager : MediaSessionManager
1213

1314
public override async void OnEnabled()
1415
{
15-
NpsmServiceStart.NpsmServiceStarted += NpsmServiceStart_NpsmServiceStarted;
16-
NpsmServiceStart_NpsmServiceStarted(null, null);
16+
NpsmService.Started += NpsmService_Started;
17+
await OnNpsmServiceStarted();
1718
}
1819

19-
private async void NpsmServiceStart_NpsmServiceStarted(object sender, EventArgs e)
20+
private async void NpsmService_Started(object sender, EventArgs e)
21+
{
22+
await OnNpsmServiceStarted();
23+
}
24+
25+
private async Task OnNpsmServiceStarted()
2026
{
2127
//Example: explorer.exe crashes, the NPSMLib still holds the "link"
2228
//THEN explorer.exe restarts and NPSM restarts too, reloading all NPSM sessions
2329

2430
//Now recreate NPSessionManager.
31+
2532
try
2633
{
34+
await CleanupNPSM();
35+
2736
NPSessionManager = new();
2837
NPSessionManager.SessionListChanged += NPSessionsChanged;
2938

3039
await LoadSessions();
3140
}
32-
catch (Exception)
41+
catch
3342
{
3443
//This is in case NPSM dies immediately after sending a wnf notification
35-
await ClearSessions();
36-
if (NPSessionManager != null)
37-
NPSessionManager.SessionListChanged -= NPSessionsChanged;
38-
NPSessionManager = null;
44+
45+
await CleanupNPSM();
3946
}
4047
}
4148

@@ -132,6 +139,12 @@ private async UiTask LoadSessions()
132139
}
133140

134141
public override async void OnDisabled()
142+
{
143+
NpsmService.Started -= NpsmService_Started;
144+
await CleanupNPSM();
145+
}
146+
147+
private async Task CleanupNPSM()
135148
{
136149
if (NPSessionManager != null)
137150
{

ModernFlyouts.Core/ModernFlyouts.Core.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11-
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="7.0.0-preview5" />
11+
<PackageReference Include="Microsoft.Toolkit.Mvvm" Version="8.0.0-preview5" />
1212
<PackageReference Include="NAudio" Version="2.0.0" />
1313
<PackageReference Include="NPSMLib" Version="0.9.14" />
14-
<PackageReference Include="System.Drawing.Common" Version="6.0.0-preview.1.21102.12" />
15-
<PackageReference Include="System.Management" Version="6.0.0-preview.1.21102.12" />
14+
<PackageReference Include="System.Drawing.Common" Version="6.0.0-preview.5.21221.8" />
15+
<PackageReference Include="System.Management" Version="6.0.0-preview.5.21221.8" />
1616
</ItemGroup>
1717

1818
</Project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Windows;
55
using System.Windows.Threading;
66

7-
namespace ModernFlyouts.Core.Helpers
7+
namespace ModernFlyouts.Core.Threading
88
{
99
//Taken from here!
1010
//https://medium.com/criteo-engineering/switching-back-to-the-ui-thread-in-wpf-uwp-in-modern-c-5dc1cc8efa5e

ModernFlyouts.Core/UI/FlyoutWindow/FlyoutWindow.Animations.cs

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,21 @@ private void OpenFlyout()
1818
RoutedEventArgs args = new(OpenedEvent);
1919
RaiseEvent(args);
2020

21-
PlayOpenAnimation();
21+
22+
if (FlyoutAnimationEnabled)
23+
{
24+
c_translation = 40;
25+
PlayOpenAnimation();
26+
}
27+
else
28+
{
29+
c_translation = 0;
30+
RenderTransform = new TranslateTransform();
31+
BeginAnimation(VisibilityProperty, null);
32+
BeginAnimation(OpacityProperty, null);
33+
Visibility = Visibility.Visible;
34+
Opacity = 1.0;
35+
}
2236

2337
timer?.Start();
2438
}
@@ -28,7 +42,15 @@ private void CloseFlyout()
2842
RoutedEventArgs args = new(ClosingEvent);
2943
RaiseEvent(args);
3044

31-
PlayCloseAnimation();
45+
if (FlyoutAnimationEnabled)
46+
{
47+
PlayCloseAnimation();
48+
}
49+
else
50+
{
51+
Opacity = 0.0;
52+
Visibility = Visibility.Hidden;
53+
}
3254
}
3355

3456
#region Close Timer
@@ -105,7 +127,7 @@ public void UpdateCloseTimerInterval(double timeout)
105127
private DoubleKeyFrame fromHorizontalOffsetKeyFrameClosing;
106128
private DoubleKeyFrame fromVerticalOffsetKeyFrameClosing;
107129

108-
private const double c_translation = 40;
130+
private double c_translation = 40;
109131
private static readonly TimeSpan translateDuration = TimeSpan.FromMilliseconds(367);
110132

111133
private static readonly PropertyPath opacityPath = new(OpacityProperty);
@@ -115,6 +137,7 @@ public void UpdateCloseTimerInterval(double timeout)
115137
private static readonly KeySpline decelerateKeySplineOpening = new(0.1, 0.9, 0.2, 1);
116138
private static readonly KeySpline decelerateKeySplineClosing = new(1, 0.2, 0.9, 0.1);
117139

140+
118141
private void PrepareAnimations()
119142
{
120143
EnsureClosingStoryboard();
@@ -141,9 +164,11 @@ private void EnsureOpeningStoryboard()
141164
{
142165
new DiscreteObjectKeyFrame(Visibility.Visible, TimeSpan.Zero)
143166
}
167+
144168
};
145169
Storyboard.SetTarget(visibilityAnim, this);
146170
Storyboard.SetTargetProperty(visibilityAnim, visibilityPath);
171+
147172

148173
DoubleAnimationUsingKeyFrames opacityAnim = new()
149174
{

ModernFlyouts.Core/UI/FlyoutWindow/FlyoutWindow.Properties.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,5 +345,22 @@ private static void OnIsOpenPropertyChanged(DependencyObject d, DependencyProper
345345
}
346346

347347
#endregion
348+
349+
#region FlyoutAnimationEnabled
350+
351+
public static readonly DependencyProperty FlyoutAnimationEnabledProperty =
352+
DependencyProperty.Register(
353+
nameof(FlyoutAnimationEnabled),
354+
typeof(bool),
355+
typeof(FlyoutWindow),
356+
new PropertyMetadata(false));
357+
358+
public bool FlyoutAnimationEnabled
359+
{
360+
get => (bool)GetValue(FlyoutAnimationEnabledProperty);
361+
set => SetValue(FlyoutAnimationEnabledProperty, value);
362+
}
363+
364+
#endregion
348365
}
349366
}

0 commit comments

Comments
 (0)