mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-02-23 19:49:43 +01:00
more nits
This commit is contained in:
@@ -58,12 +58,6 @@ public sealed partial class DockViewModel : IDisposable,
|
||||
SetupBands(_settings.StartBands, StartItems);
|
||||
SetupBands(_settings.CenterBands, CenterItems);
|
||||
SetupBands(_settings.EndBands, EndItems);
|
||||
|
||||
// Initialize properties on BG thread
|
||||
Task.Run(() =>
|
||||
{
|
||||
InitializeAllBands();
|
||||
});
|
||||
}
|
||||
|
||||
private void SetupBands(
|
||||
@@ -94,13 +88,27 @@ public sealed partial class DockViewModel : IDisposable,
|
||||
var beforeCount = target.Count;
|
||||
var afterCount = newBands.Count;
|
||||
|
||||
List<DockBandViewModel> removed = new();
|
||||
DoOnUiThread(() =>
|
||||
{
|
||||
ListHelpers.InPlaceUpdateList(target, newBands, out var removed);
|
||||
ListHelpers.InPlaceUpdateList(target, newBands, out removed);
|
||||
var isStartBand = target == StartItems;
|
||||
var label = isStartBand ? "Start bands:" : "End bands:";
|
||||
Logger.LogDebug($"{label} ({beforeCount}) -> ({afterCount}), Removed {removed?.Count ?? 0} items");
|
||||
});
|
||||
|
||||
// Initialize properties on BG thread
|
||||
Task.Run(() =>
|
||||
{
|
||||
foreach (var band in newBands)
|
||||
{
|
||||
band.SafeInitializePropertiesSynchronous();
|
||||
}
|
||||
});
|
||||
foreach (var removedItem in removed)
|
||||
{
|
||||
removedItem.SafeCleanup();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
@@ -612,24 +620,6 @@ public sealed partial class DockViewModel : IDisposable,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeAllBands()
|
||||
{
|
||||
foreach (var band in StartItems)
|
||||
{
|
||||
band.SafeInitializePropertiesSynchronous();
|
||||
}
|
||||
|
||||
foreach (var band in CenterItems)
|
||||
{
|
||||
band.SafeInitializePropertiesSynchronous();
|
||||
}
|
||||
|
||||
foreach (var band in EndItems)
|
||||
{
|
||||
band.SafeInitializePropertiesSynchronous();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#pragma warning restore SA1402 // File may only contain a single type
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
EmptyValue="Collapsed"
|
||||
NotEmptyValue="Visible" />
|
||||
|
||||
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||||
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
xmlns:help="using:Microsoft.CmdPal.UI.Helpers"
|
||||
xmlns:local="using:Microsoft.CmdPal.UI.Dock"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:toolkit="using:CommunityToolkit.WinUI.Controls"
|
||||
xmlns:vm="using:Microsoft.CmdPal.UI.ViewModels"
|
||||
xmlns:winuiex="using:WinUIEx"
|
||||
Title="PowerDock"
|
||||
|
||||
@@ -103,7 +103,9 @@
|
||||
</controls:SettingsCard>
|
||||
|
||||
<!-- Backdrop Style -->
|
||||
<controls:SettingsCard x:Uid="DockAppearance_Backdrop_SettingsCard" HeaderIcon="{ui:FontIcon Glyph=}">
|
||||
<controls:SettingsCard
|
||||
x:Uid="DockAppearance_Backdrop_SettingsCard"
|
||||
HeaderIcon="{ui:FontIcon Glyph=}">
|
||||
<ComboBox
|
||||
x:Name="BackdropComboBox"
|
||||
MinWidth="{StaticResource SettingActionControlMinWidth}"
|
||||
@@ -215,9 +217,7 @@
|
||||
|
||||
<!-- Reset background image properties -->
|
||||
<controls:SettingsCard x:Uid="DockAppearance_BackgroundImage_ResetProperties_SettingsCard" Visibility="{x:Bind ViewModel.DockAppearance.IsBackgroundControlsVisible, Mode=OneWay}">
|
||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||
<Button x:Uid="Settings_GeneralPage_Background_ResetImagePropertiesButton" Command="{x:Bind ViewModel.DockAppearance.ResetBackgroundImagePropertiesCommand}" />
|
||||
</StackPanel>
|
||||
<Button x:Uid="Settings_GeneralPage_Background_ResetImagePropertiesButton" Command="{x:Bind ViewModel.DockAppearance.ResetBackgroundImagePropertiesCommand}" />
|
||||
</controls:SettingsCard>
|
||||
|
||||
</controls:SettingsExpander.Items>
|
||||
|
||||
@@ -767,10 +767,10 @@ Right-click to remove the key combination, thereby deactivating the shortcut.</v
|
||||
<value>Select which theme to display for the dock</value>
|
||||
</data>
|
||||
<data name="DockAppearance_Backdrop_SettingsCard.Header" xml:space="preserve">
|
||||
<value>Backdrop style</value>
|
||||
<value>Material</value>
|
||||
</data>
|
||||
<data name="DockAppearance_Backdrop_SettingsCard.Description" xml:space="preserve">
|
||||
<value>Choose the background effect for the dock</value>
|
||||
<value>Select the visual material used for the dock</value>
|
||||
</data>
|
||||
<data name="DockAppearance_Backdrop_Mica.Content" xml:space="preserve">
|
||||
<value>Mica</value>
|
||||
@@ -910,6 +910,6 @@ Right-click to remove the key combination, thereby deactivating the shortcut.</v
|
||||
<value>Show labels</value>
|
||||
</data>
|
||||
<data name="DockAppearance_ShowLabels_CheckBox.Description" xml:space="preserve">
|
||||
<value>Choose whether to show labels for dock items by default</value>
|
||||
<value>Show labels for dock items by default</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user