Skip to content

Commit b9c436c

Browse files
authored
Merge pull request #556 from unchihugo/refactor/simplify-settings-options
Simplified Taskbar Widget settings page by removing the Clickable and Closeable options and setting them to be always true as most users will leave these on by default. Removed (Experimental) label from Next Up settings page as this feature has been extensively tested and matured. Changed Taskbar Widget settings page InfoBar severity level to be informational instead of warning.
2 parents cffe1f8 + 5b6a31f commit b9c436c

4 files changed

Lines changed: 12 additions & 57 deletions

File tree

‎FluentFlyoutWPF/Controls/TaskbarWidgetControl.xaml.cs‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public void ApplyWindowsTheme()
103103

104104
private void Grid_MouseEnter(object sender, MouseEventArgs e)
105105
{
106-
if (!SettingsManager.Current.TaskbarWidgetClickable || String.IsNullOrEmpty(SongTitle.Text + SongArtist.Text)) return;
106+
if (string.IsNullOrEmpty(SongTitle.Text + SongArtist.Text)) return;
107107

108108
SolidColorBrush targetBackgroundBrush;
109109
// hover effects with animations, hard-coded colors because I can't find the resource brushes
@@ -146,7 +146,7 @@ private void Grid_MouseEnter(object sender, MouseEventArgs e)
146146

147147
private void Grid_MouseLeave(object sender, MouseEventArgs e)
148148
{
149-
if (!SettingsManager.Current.TaskbarWidgetClickable || String.IsNullOrEmpty(SongTitle.Text + SongArtist.Text)) return;
149+
if (string.IsNullOrEmpty(SongTitle.Text + SongArtist.Text)) return;
150150

151151
// Animate back to transparent
152152
var backgroundAnimation = new ColorAnimation
@@ -171,10 +171,10 @@ private void Grid_MouseLeave(object sender, MouseEventArgs e)
171171

172172
private void Grid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
173173
{
174-
if (!SettingsManager.Current.TaskbarWidgetClickable || _mainWindow == null) return;
174+
if (_mainWindow == null) return;
175175

176-
// toggle main flyout when clicked if toggle mode is enabled, otherwise just open
177-
_mainWindow.ShowMediaFlyout(toggleMode: SettingsManager.Current.TaskbarWidgetCloseableFlyout, forceShow: true);
176+
// toggle main flyout when clicked
177+
_mainWindow.ShowMediaFlyout(toggleMode: true, forceShow: true);
178178
}
179179

180180
public (double logicalWidth, double logicalHeight) CalculateSize(double dpiScale)
@@ -288,13 +288,13 @@ public void UpdateUi(string title, string artist, BitmapImage? icon, GlobalSyste
288288
}
289289
}
290290

291-
SongTitle.Text = !String.IsNullOrEmpty(title) ? title : "-";
292-
SongArtist.Text = !String.IsNullOrEmpty(artist) ? artist : "-";
291+
SongTitle.Text = !string.IsNullOrEmpty(title) ? title : "-";
292+
SongArtist.Text = !string.IsNullOrEmpty(artist) ? artist : "-";
293293

294294
// Update tooltip with song info
295295
SongInfoStackPanel.ToolTip = string.Empty;
296-
SongInfoStackPanel.ToolTip += !String.IsNullOrEmpty(title) ? title : string.Empty;
297-
SongInfoStackPanel.ToolTip += !String.IsNullOrEmpty(artist) ? "\n\n" + artist : string.Empty;
296+
SongInfoStackPanel.ToolTip += !string.IsNullOrEmpty(title) ? title : string.Empty;
297+
SongInfoStackPanel.ToolTip += !string.IsNullOrEmpty(artist) ? "\n\n" + artist : string.Empty;
298298

299299
if (SettingsManager.Current.TaskbarWidgetControlsEnabled)
300300
{
@@ -333,7 +333,7 @@ public void UpdateUi(string title, string artist, BitmapImage? icon, GlobalSyste
333333
}
334334

335335
SongTitle.Visibility = Visibility.Visible;
336-
SongArtist.Visibility = !String.IsNullOrEmpty(artist) ? Visibility.Visible : Visibility.Collapsed; // hide artist if it's not available
336+
SongArtist.Visibility = !string.IsNullOrEmpty(artist) ? Visibility.Visible : Visibility.Collapsed; // hide artist if it's not available
337337
SongInfoStackPanel.Visibility = Visibility.Visible;
338338
BackgroundImage.Visibility = SettingsManager.Current.TaskbarWidgetBackgroundBlur ? Visibility.Visible : Visibility.Collapsed;
339339

‎FluentFlyoutWPF/Pages/TaskbarWidgetPage.xaml‎

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@
110110
</ui:CardControl.Header>
111111
<controls:ToggleSwitch IsChecked="{Binding TaskbarWidgetEnabled, Mode=TwoWay}" IsEnabled="{Binding IsPremiumUnlocked}" />
112112
</ui:CardControl>
113-
<ui:InfoBar Grid.Row="3" Title="{DynamicResource TaskbarWidgetVisualIssuesWarning}" IsOpen="True" Severity="Warning" IsClosable="False" Margin="0,0,0,3" />
113+
<ui:InfoBar Grid.Row="3" Title="{DynamicResource TaskbarWidgetVisualIssuesWarning}" IsOpen="True" Severity="Informational" IsClosable="False" Margin="0,0,0,3" />
114114

115115
<ui:CardControl Grid.Row="4" Icon="{ui:SymbolIcon ArrowMove24}" Margin="0,0,0,3">
116116
<ui:CardControl.Header>
@@ -189,27 +189,6 @@
189189
</StackPanel>
190190
</ui:CardExpander>
191191

192-
<ui:CardControl Grid.Row="7" Icon="{ui:SymbolIcon ExpandUpRight24}" Margin="0,0,0,3">
193-
<ui:CardControl.Header>
194-
<StackPanel Orientation="Vertical">
195-
<TextBlock Text="{DynamicResource TaskbarWidgetClickableTitle}" FontSize="14" FontWeight="Regular" VerticalAlignment="Center" />
196-
<TextBlock Text="{DynamicResource TaskbarWidgetClickableDescription}" FontSize="12" Opacity="0.5" />
197-
</StackPanel>
198-
</ui:CardControl.Header>
199-
<controls:ToggleSwitch IsChecked="{Binding TaskbarWidgetClickable, Mode=TwoWay}" IsEnabled="{Binding IsPremiumUnlocked}" />
200-
</ui:CardControl>
201-
<ui:CardControl Grid.Row="8" Icon="{ui:SymbolIcon ArrowSwap24}" Margin="0,0,0,12">
202-
<ui:CardControl.Header>
203-
<StackPanel Orientation="Vertical">
204-
<StackPanel Orientation="Horizontal">
205-
<TextBlock Text="{DynamicResource TaskbarWidgetCloseableFlyoutTitle}" FontSize="14" FontWeight="Regular" VerticalAlignment="Center" />
206-
<ui:InfoBadge Value=" NEW " FontWeight="Medium" FontSize="10" Margin="6,-2,0,-2" Severity="Success" />
207-
</StackPanel>
208-
<TextBlock Text="{DynamicResource TaskbarWidgetCloseableFlyoutDescription}" FontSize="12" Opacity="0.5" />
209-
</StackPanel>
210-
</ui:CardControl.Header>
211-
<controls:ToggleSwitch Name="TaskbarWidgetCloseableFlyoutSwitch" IsChecked="{Binding TaskbarWidgetCloseableFlyout, Mode=TwoWay}" IsEnabled="{Binding IsPremiumUnlocked}" />
212-
</ui:CardControl>
213192
<ui:CardControl Grid.Row="9" Icon="{ui:SymbolIcon ColorBackground24}" Margin="0,0,0,3">
214193
<ui:CardControl.Header>
215194
<StackPanel Orientation="Vertical">

‎FluentFlyoutWPF/Resources/Localization/Dictionary-en-US.xaml‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
<System:String x:Key="TextBlockText3">Display a flyout when you press a media key</System:String>
1010
<System:String x:Key="MediaFlyoutExcludeVolumeTitle">Exclude Volume Keys</System:String>
1111
<System:String x:Key="MediaFlyoutExcludeVolumeDescription">Do not display the flyout when pressing volume up/down/mute</System:String>
12-
<System:String x:Key="TaskbarWidgetCloseableFlyoutTitle">Close Flyout on Second Click</System:String>
13-
<System:String x:Key="TaskbarWidgetCloseableFlyoutDescription">Close the flyout if it's already open when clicking the taskbar widget</System:String>
1412
<System:String x:Key="TextBlockText2">Choose from a preset of modern background blur styles</System:String>
1513
<System:String x:Key="BackgroundBlurOption1" xml:space="preserve"> None</System:String>
1614
<System:String x:Key="BackgroundBlurOption2" xml:space="preserve"> Style 1 (Cover Glow)</System:String>
@@ -60,8 +58,6 @@ hides repeat, shuffle and player info</System:String>
6058
<System:String x:Key="TaskbarWidgetPaddingDescription">Turn this feature on if you have Windows Widgets enabled</System:String>
6159
<System:String x:Key="TaskbarWidgetManualPaddingTitle">Custom Padding</System:String>
6260
<System:String x:Key="TaskbarWidgetManualPaddingDescription">Add extra padding (default: 0px)</System:String>
63-
<System:String x:Key="TaskbarWidgetClickableTitle">Click to open Media Flyout when media is Present</System:String>
64-
<System:String x:Key="TaskbarWidgetClickableDescription">Clicking the taskbar widget will open the media flyout</System:String>
6561
<System:String x:Key="TaskbarWidgetBackgroundBlurTitle">Background Blur</System:String>
6662
<System:String x:Key="TaskbarWidgetBackgroundBlurDescription">Add background blur effect to the taskbar widget</System:String>
6763
<System:String x:Key="TaskbarWidgetHideCompletelyTitle">Hide Completely When No Media Is Present</System:String>
@@ -111,7 +107,7 @@ Note: As an open-source project, these features are also available for free via
111107
<System:String x:Key="AllFuturePremiumFeatures">All future Premium features</System:String>
112108
<System:String x:Key="NextUpCustomizationTitle">Next Up Flyout</System:String>
113109
<System:String x:Key="NextUpDescription" xml:space="preserve">A flyout shows what's next when a song/video ends. Only appears if the next item plays automatically, if next/previous is pressed manually, the main flyout appears instead.</System:String>
114-
<System:String x:Key="EnableNextUpTitle">Enable Next Up Flyout (Experimental)</System:String>
110+
<System:String x:Key="EnableNextUpTitle">Enable Next Up Flyout</System:String>
115111
<System:String x:Key="EnableNextUpDescription">Shows what's next when a song/video ends</System:String>
116112
<System:String x:Key="NextUpStayDurationTitle">Next Up Stay Duration</System:String>
117113
<System:String x:Key="NextUpStayDurationDescription">(default: 2000 ms)</System:String>

‎FluentFlyoutWPF/ViewModels/UserSettings.cs‎

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -378,18 +378,6 @@ public string TaskbarWidgetManualPaddingText
378378
}
379379
}
380380

381-
/// <summary>
382-
/// Gets or sets a value indicating whether the taskbar widget is clickable
383-
/// </summary>
384-
[ObservableProperty]
385-
public partial bool TaskbarWidgetClickable { get; set; }
386-
387-
/// <summary>
388-
/// Gets or sets a value indicating whether clicking the taskbar widget toggles the flyout (close if already open)
389-
/// </summary>
390-
[ObservableProperty]
391-
public partial bool TaskbarWidgetCloseableFlyout { get; set; }
392-
393381
/// <summary>
394382
/// Gets or sets a value indication whether the taskbar widget background should have a blur effect
395383
/// </summary>
@@ -572,8 +560,6 @@ public UserSettings()
572560
TaskbarWidgetPosition = 0;
573561
TaskbarWidgetPadding = true;
574562
TaskbarWidgetManualPadding = 0;
575-
TaskbarWidgetClickable = true;
576-
TaskbarWidgetCloseableFlyout = true;
577563
TaskbarWidgetBackgroundBlur = false;
578564
TaskbarWidgetHideCompletely = false;
579565
TaskbarWidgetControlsEnabled = false;
@@ -664,12 +650,6 @@ partial void OnTaskbarWidgetManualPaddingChanged(int oldValue, int newValue)
664650
UpdateTaskbar();
665651
}
666652

667-
partial void OnTaskbarWidgetClickableChanged(bool oldValue, bool newValue)
668-
{
669-
if (oldValue == newValue || _initializing) return;
670-
UpdateTaskbar();
671-
}
672-
673653
partial void OnTaskbarWidgetBackgroundBlurChanged(bool oldValue, bool newValue)
674654
{
675655
if (oldValue == newValue || _initializing) return;

0 commit comments

Comments
 (0)