mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 19:57:57 +01:00
Shit is working y'all
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
xmlns:helpers="using:Microsoft.CmdPal.UI.Helpers"
|
xmlns:helpers="using:Microsoft.CmdPal.UI.Helpers"
|
||||||
xmlns:local="using:Microsoft.CmdPal.UI.Controls"
|
xmlns:local="using:Microsoft.CmdPal.UI.Controls"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
Loaded="UserControl_Loaded"
|
||||||
mc:Ignorable="d">
|
mc:Ignorable="d">
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -71,68 +72,71 @@
|
|||||||
</Grid>
|
</Grid>
|
||||||
</Flyout>
|
</Flyout>
|
||||||
|
|
||||||
<!-- Flyout for editing a pinned dock item -->
|
|
||||||
<Flyout
|
|
||||||
x:Key="DockItemOptionsFlyout"
|
|
||||||
Closed="DockItemOptionsFlyout_Closed"
|
|
||||||
Placement="Bottom">
|
|
||||||
<Grid Width="280">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
<RowDefinition Height="Auto" />
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<TextBlock
|
|
||||||
x:Name="OptionsFlyoutTitle"
|
|
||||||
Margin="0,0,0,16"
|
|
||||||
FontSize="16"
|
|
||||||
FontWeight="SemiBold"
|
|
||||||
Text="Dock Item Options" />
|
|
||||||
|
|
||||||
<StackPanel Grid.Row="1" Margin="0,0,0,16">
|
|
||||||
<TextBlock
|
|
||||||
Margin="0,0,0,8"
|
|
||||||
FontSize="12"
|
|
||||||
Text="Show Labels" />
|
|
||||||
<ComboBox
|
|
||||||
x:Name="ShowLabelsComboBox"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
SelectionChanged="ShowLabelsComboBox_SelectionChanged">
|
|
||||||
<ComboBoxItem Content="Default" Tag="0" />
|
|
||||||
<ComboBoxItem Content="Show Labels" Tag="1" />
|
|
||||||
<ComboBoxItem Content="Hide Labels" Tag="2" />
|
|
||||||
</ComboBox>
|
|
||||||
</StackPanel>
|
|
||||||
|
|
||||||
<Border
|
|
||||||
Grid.Row="2"
|
|
||||||
Height="1"
|
|
||||||
Margin="0,0,0,16"
|
|
||||||
Background="{ThemeResource DividerStrokeColorDefaultBrush}" />
|
|
||||||
|
|
||||||
<Button
|
|
||||||
Grid.Row="3"
|
|
||||||
HorizontalAlignment="Stretch"
|
|
||||||
Click="UnpinButton_Click"
|
|
||||||
Content="Unpin from dock" />
|
|
||||||
</Grid>
|
|
||||||
</Flyout>
|
|
||||||
|
|
||||||
<!-- Template for dock band items in the editor -->
|
<!-- Template for dock band items in the editor -->
|
||||||
<DataTemplate x:Key="DockBandItemTemplate" x:DataType="dockVm:DockBandSettingsViewModel">
|
<DataTemplate x:Key="DockBandItemTemplate" x:DataType="dockVm:DockBandSettingsViewModel">
|
||||||
<Grid
|
<Grid
|
||||||
Padding="8,4"
|
Padding="8,4"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
|
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="4"
|
||||||
ToolTipService.ToolTip="{x:Bind Title}">
|
ToolTipService.ToolTip="{x:Bind Title}">
|
||||||
<StackPanel
|
<Button Style="{StaticResource SubtleButtonStyle}">
|
||||||
HorizontalAlignment="Center"
|
<Button.Flyout>
|
||||||
BorderBrush="{ThemeResource DividerStrokeColorDefaultBrush}"
|
<Flyout Placement="Bottom">
|
||||||
BorderThickness="1"
|
<Grid Width="280">
|
||||||
CornerRadius="4"
|
<Grid.RowDefinitions>
|
||||||
Orientation="Vertical"
|
<RowDefinition Height="Auto" />
|
||||||
Spacing="4">
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<StackPanel
|
||||||
|
Margin="0,0,0,16"
|
||||||
|
Orientation="Horizontal"
|
||||||
|
Spacing="8">
|
||||||
|
<local:IconBox
|
||||||
|
x:Name="OptionsFlyoutIcons"
|
||||||
|
Width="24"
|
||||||
|
Height="24"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
SourceKey="{x:Bind Icon, Mode=OneWay}"
|
||||||
|
SourceRequested="{x:Bind helpers:IconCacheProvider.SourceRequested}" />
|
||||||
|
<TextBlock
|
||||||
|
x:Name="OptionsFlyoutTitle"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Foreground="{ThemeResource TextFillColorSecondaryBrush}"
|
||||||
|
Text="{x:Bind Title, Mode=OneWay}" />
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Grid.Row="1" Margin="0,0,0,16">
|
||||||
|
<TextBlock
|
||||||
|
Margin="0,0,0,8"
|
||||||
|
FontSize="12"
|
||||||
|
Text="Show labels" />
|
||||||
|
<ComboBox
|
||||||
|
x:Name="ShowLabelsComboBox"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
SelectedIndex="{x:Bind ShowLabelsIndex, Mode=TwoWay}">
|
||||||
|
<ComboBoxItem Content="Default" />
|
||||||
|
<ComboBoxItem Content="Show" />
|
||||||
|
<ComboBoxItem Content="Hide" />
|
||||||
|
</ComboBox>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<Border
|
||||||
|
Grid.Row="2"
|
||||||
|
Height="1"
|
||||||
|
Margin="0,0,0,16"
|
||||||
|
Background="{ThemeResource DividerStrokeColorDefaultBrush}" />
|
||||||
|
<Button
|
||||||
|
Grid.Row="3"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Click="UnpinButton_Click"
|
||||||
|
Content="Unpin from dock" />
|
||||||
|
</Grid>
|
||||||
|
</Flyout>
|
||||||
|
</Button.Flyout>
|
||||||
<local:IconBox
|
<local:IconBox
|
||||||
Width="24"
|
Width="24"
|
||||||
Height="24"
|
Height="24"
|
||||||
@@ -140,15 +144,7 @@
|
|||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
SourceKey="{x:Bind Icon, Mode=OneWay}"
|
SourceKey="{x:Bind Icon, Mode=OneWay}"
|
||||||
SourceRequested="{x:Bind helpers:IconCacheProvider.SourceRequested}" />
|
SourceRequested="{x:Bind helpers:IconCacheProvider.SourceRequested}" />
|
||||||
<!--<TextBlock
|
</Button>
|
||||||
MaxWidth="60"
|
|
||||||
HorizontalAlignment="Center"
|
|
||||||
FontSize="10"
|
|
||||||
Text="{x:Bind Title}"
|
|
||||||
TextAlignment="Center"
|
|
||||||
TextTrimming="CharacterEllipsis"
|
|
||||||
TextWrapping="NoWrap" />-->
|
|
||||||
</StackPanel>
|
|
||||||
</Grid>
|
</Grid>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
|
|
||||||
@@ -165,21 +161,21 @@
|
|||||||
</Grid.Resources>
|
</Grid.Resources>
|
||||||
|
|
||||||
<!-- Main dock editor bar -->
|
<!-- Main dock editor bar -->
|
||||||
<Grid
|
<Grid Padding="4">
|
||||||
Height="64"
|
|
||||||
Padding="12,8"
|
|
||||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
|
||||||
BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}"
|
|
||||||
BorderThickness="1"
|
|
||||||
CornerRadius="8">
|
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition Width="*" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="*" />
|
<ColumnDefinition x:Name="EndColumn" Width="*" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*" />
|
||||||
|
<RowDefinition Height="Auto" />
|
||||||
|
<RowDefinition x:Name="EndRow" Height="Auto" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Start (Left) Section -->
|
<!-- Start (Left) Section -->
|
||||||
<StackPanel
|
<StackPanel
|
||||||
|
x:Name="StartPanel"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
@@ -187,6 +183,7 @@
|
|||||||
<ListView
|
<ListView
|
||||||
x:Name="StartListView"
|
x:Name="StartListView"
|
||||||
MinWidth="48"
|
MinWidth="48"
|
||||||
|
VerticalAlignment="Center"
|
||||||
AllowDrop="True"
|
AllowDrop="True"
|
||||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
CanDragItems="True"
|
CanDragItems="True"
|
||||||
@@ -196,8 +193,7 @@
|
|||||||
DragItemsStarting="ListView_DragItemsStarting"
|
DragItemsStarting="ListView_DragItemsStarting"
|
||||||
DragOver="ListView_DragOver"
|
DragOver="ListView_DragOver"
|
||||||
Drop="StartListView_Drop"
|
Drop="StartListView_Drop"
|
||||||
IsItemClickEnabled="True"
|
IsItemClickEnabled="False"
|
||||||
ItemClick="DockItem_Click"
|
|
||||||
ItemContainerStyle="{StaticResource DockEditorListViewItemStyle}"
|
ItemContainerStyle="{StaticResource DockEditorListViewItemStyle}"
|
||||||
ItemTemplate="{StaticResource DockBandItemTemplate}"
|
ItemTemplate="{StaticResource DockBandItemTemplate}"
|
||||||
ItemsSource="{x:Bind StartItems, Mode=OneWay}"
|
ItemsSource="{x:Bind StartItems, Mode=OneWay}"
|
||||||
@@ -215,16 +211,19 @@
|
|||||||
Flyout="{StaticResource AddItemsFlyout}"
|
Flyout="{StaticResource AddItemsFlyout}"
|
||||||
Style="{StaticResource SubtleButtonStyle}"
|
Style="{StaticResource SubtleButtonStyle}"
|
||||||
ToolTipService.ToolTip="Add item to start">
|
ToolTipService.ToolTip="Add item to start">
|
||||||
<FontIcon FontSize="12" Glyph="" />
|
<FontIcon FontSize="16" Glyph="" />
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Center Section -->
|
<!-- Center Section (hidden for now) -->
|
||||||
<StackPanel
|
<StackPanel
|
||||||
|
x:Name="CenterPanel"
|
||||||
Grid.Column="1"
|
Grid.Column="1"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
Spacing="4">
|
Spacing="4"
|
||||||
|
Visibility="Collapsed">
|
||||||
<Button
|
<Button
|
||||||
x:Name="CenterAddButtonLeft"
|
x:Name="CenterAddButtonLeft"
|
||||||
VerticalAlignment="Center"
|
VerticalAlignment="Center"
|
||||||
@@ -233,11 +232,12 @@
|
|||||||
Style="{StaticResource SubtleButtonStyle}"
|
Style="{StaticResource SubtleButtonStyle}"
|
||||||
ToolTipService.ToolTip="Add item to center"
|
ToolTipService.ToolTip="Add item to center"
|
||||||
Visibility="Collapsed">
|
Visibility="Collapsed">
|
||||||
<FontIcon FontSize="12" Glyph="" />
|
<FontIcon FontSize="16" Glyph="" />
|
||||||
</Button>
|
</Button>
|
||||||
<ListView
|
<ListView
|
||||||
x:Name="CenterListView"
|
x:Name="CenterListView"
|
||||||
MinWidth="48"
|
MinWidth="48"
|
||||||
|
VerticalAlignment="Center"
|
||||||
AllowDrop="True"
|
AllowDrop="True"
|
||||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
CanDragItems="True"
|
CanDragItems="True"
|
||||||
@@ -247,8 +247,7 @@
|
|||||||
DragItemsStarting="ListView_DragItemsStarting"
|
DragItemsStarting="ListView_DragItemsStarting"
|
||||||
DragOver="ListView_DragOver"
|
DragOver="ListView_DragOver"
|
||||||
Drop="CenterListView_Drop"
|
Drop="CenterListView_Drop"
|
||||||
IsItemClickEnabled="True"
|
IsItemClickEnabled="False"
|
||||||
ItemClick="DockItem_Click"
|
|
||||||
ItemContainerStyle="{StaticResource DockEditorListViewItemStyle}"
|
ItemContainerStyle="{StaticResource DockEditorListViewItemStyle}"
|
||||||
ItemTemplate="{StaticResource DockBandItemTemplate}"
|
ItemTemplate="{StaticResource DockBandItemTemplate}"
|
||||||
ItemsSource="{x:Bind CenterItems, Mode=OneWay}"
|
ItemsSource="{x:Bind CenterItems, Mode=OneWay}"
|
||||||
@@ -265,12 +264,13 @@
|
|||||||
Click="AddButton_Click"
|
Click="AddButton_Click"
|
||||||
Style="{StaticResource SubtleButtonStyle}"
|
Style="{StaticResource SubtleButtonStyle}"
|
||||||
ToolTipService.ToolTip="Add item to center">
|
ToolTipService.ToolTip="Add item to center">
|
||||||
<FontIcon FontSize="12" Glyph="" />
|
<FontIcon FontSize="16" Glyph="" />
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- End (Right) Section -->
|
<!-- End (Right) Section -->
|
||||||
<StackPanel
|
<StackPanel
|
||||||
|
x:Name="EndPanel"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
HorizontalAlignment="Right"
|
HorizontalAlignment="Right"
|
||||||
Orientation="Horizontal"
|
Orientation="Horizontal"
|
||||||
@@ -282,11 +282,12 @@
|
|||||||
Flyout="{StaticResource AddItemsFlyout}"
|
Flyout="{StaticResource AddItemsFlyout}"
|
||||||
Style="{StaticResource SubtleButtonStyle}"
|
Style="{StaticResource SubtleButtonStyle}"
|
||||||
ToolTipService.ToolTip="Add item to end">
|
ToolTipService.ToolTip="Add item to end">
|
||||||
<FontIcon FontSize="12" Glyph="" />
|
<FontIcon FontSize="16" Glyph="" />
|
||||||
</Button>
|
</Button>
|
||||||
<ListView
|
<ListView
|
||||||
x:Name="EndListView"
|
x:Name="EndListView"
|
||||||
MinWidth="48"
|
MinWidth="48"
|
||||||
|
VerticalAlignment="Center"
|
||||||
AllowDrop="True"
|
AllowDrop="True"
|
||||||
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
Background="{ThemeResource CardBackgroundFillColorDefaultBrush}"
|
||||||
CanDragItems="True"
|
CanDragItems="True"
|
||||||
@@ -296,8 +297,7 @@
|
|||||||
DragItemsStarting="ListView_DragItemsStarting"
|
DragItemsStarting="ListView_DragItemsStarting"
|
||||||
DragOver="ListView_DragOver"
|
DragOver="ListView_DragOver"
|
||||||
Drop="EndListView_Drop"
|
Drop="EndListView_Drop"
|
||||||
IsItemClickEnabled="True"
|
IsItemClickEnabled="False"
|
||||||
ItemClick="DockItem_Click"
|
|
||||||
ItemContainerStyle="{StaticResource DockEditorListViewItemStyle}"
|
ItemContainerStyle="{StaticResource DockEditorListViewItemStyle}"
|
||||||
ItemTemplate="{StaticResource DockBandItemTemplate}"
|
ItemTemplate="{StaticResource DockBandItemTemplate}"
|
||||||
ItemsSource="{x:Bind EndItems, Mode=OneWay}"
|
ItemsSource="{x:Bind EndItems, Mode=OneWay}"
|
||||||
@@ -310,5 +310,23 @@
|
|||||||
</ListView>
|
</ListView>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
<VisualStateManager.VisualStateGroups>
|
||||||
|
<VisualStateGroup x:Name="OrientationStates">
|
||||||
|
<VisualState x:Name="Horizontal" />
|
||||||
|
<VisualState x:Name="Vertical">
|
||||||
|
<VisualState.Setters>
|
||||||
|
<Setter Target="StartPanel.Orientation" Value="Vertical" />
|
||||||
|
<Setter Target="CenterPanel.Orientation" Value="Vertical" />
|
||||||
|
<Setter Target="EndPanel.Orientation" Value="Vertical" />
|
||||||
|
<Setter Target="CenterPanel.(Grid.Column)" Value="0" />
|
||||||
|
<Setter Target="CenterPanel.(Grid.Row)" Value="1" />
|
||||||
|
<Setter Target="CenterPanel.(Grid.Column)" Value="0" />
|
||||||
|
<Setter Target="CenterPanel.(Grid.Row)" Value="2" />
|
||||||
|
<Setter Target="EndColumn.Width" Value="Auto" />
|
||||||
|
<Setter Target="EndRow.Height" Value="*" />
|
||||||
|
</VisualState.Setters>
|
||||||
|
</VisualState>
|
||||||
|
</VisualStateGroup>
|
||||||
|
</VisualStateManager.VisualStateGroups>
|
||||||
</Grid>
|
</Grid>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
|
|||||||
@@ -20,6 +20,19 @@ public sealed partial class DockEditor : UserControl
|
|||||||
private DockEditorPinArea _targetArea;
|
private DockEditorPinArea _targetArea;
|
||||||
private DockBandSettingsViewModel? _currentContextItem;
|
private DockBandSettingsViewModel? _currentContextItem;
|
||||||
|
|
||||||
|
public Orientation Orientation
|
||||||
|
{
|
||||||
|
get => (Orientation)GetValue(OrientationProperty);
|
||||||
|
set => SetValue(OrientationProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty OrientationProperty =
|
||||||
|
DependencyProperty.Register(
|
||||||
|
nameof(Orientation),
|
||||||
|
typeof(Orientation),
|
||||||
|
typeof(DockEditor),
|
||||||
|
new PropertyMetadata(Orientation.Horizontal, OnOrientationChanged));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets or sets the collection of all dock band items to display and manage.
|
/// Gets or sets the collection of all dock band items to display and manage.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -69,6 +82,21 @@ public sealed partial class DockEditor : UserControl
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void OnOrientationChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (d is DockEditor editor)
|
||||||
|
{
|
||||||
|
if (editor.Orientation == Orientation.Horizontal)
|
||||||
|
{
|
||||||
|
VisualStateManager.GoToState(editor, "HorizontalState", true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
VisualStateManager.GoToState(editor, "VerticalState", true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void LoadItems()
|
private void LoadItems()
|
||||||
{
|
{
|
||||||
StartItems.Clear();
|
StartItems.Clear();
|
||||||
@@ -82,7 +110,7 @@ public sealed partial class DockEditor : UserControl
|
|||||||
|
|
||||||
foreach (var item in DockItems)
|
foreach (var item in DockItems)
|
||||||
{
|
{
|
||||||
// Use PinSideIndex: 0 = None, 1 = Start, 2 = End
|
// PinSideIndex: 0 = None, 1 = Start, 2 = End
|
||||||
switch (item.PinSideIndex)
|
switch (item.PinSideIndex)
|
||||||
{
|
{
|
||||||
case 1: // Start
|
case 1: // Start
|
||||||
@@ -154,7 +182,6 @@ public sealed partial class DockEditor : UserControl
|
|||||||
selectedItem.PinSideIndex = _targetArea switch
|
selectedItem.PinSideIndex = _targetArea switch
|
||||||
{
|
{
|
||||||
DockEditorPinArea.Start => 1,
|
DockEditorPinArea.Start => 1,
|
||||||
DockEditorPinArea.Center => 1, // Center maps to Start
|
|
||||||
DockEditorPinArea.End => 2,
|
DockEditorPinArea.End => 2,
|
||||||
_ => 0,
|
_ => 0,
|
||||||
};
|
};
|
||||||
@@ -177,42 +204,6 @@ public sealed partial class DockEditor : UserControl
|
|||||||
CloseFlyoutFromSender(sender);
|
CloseFlyoutFromSender(sender);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void DockItem_Click(object sender, ItemClickEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.ClickedItem is not DockBandSettingsViewModel clickedItem)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_currentContextItem = clickedItem;
|
|
||||||
|
|
||||||
// Update the flyout title
|
|
||||||
OptionsFlyoutTitle.Text = clickedItem.Title;
|
|
||||||
|
|
||||||
// Set the combo box to the current show labels setting
|
|
||||||
ShowLabelsComboBox.SelectedIndex = clickedItem.ShowLabelsIndex;
|
|
||||||
|
|
||||||
// Show the flyout attached to the clicked item
|
|
||||||
if (sender is ListView listView)
|
|
||||||
{
|
|
||||||
var container = listView.ContainerFromItem(clickedItem) as ListViewItem;
|
|
||||||
if (container != null && Resources.TryGetValue("DockItemOptionsFlyout", out var flyoutResource) && flyoutResource is Flyout flyout)
|
|
||||||
{
|
|
||||||
flyout.ShowAt(container);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void ShowLabelsComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (_currentContextItem == null || sender is not ComboBox comboBox)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
_currentContextItem.ShowLabelsIndex = comboBox.SelectedIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UnpinButton_Click(object sender, RoutedEventArgs e)
|
private void UnpinButton_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (_currentContextItem == null)
|
if (_currentContextItem == null)
|
||||||
@@ -323,7 +314,6 @@ public sealed partial class DockEditor : UserControl
|
|||||||
_draggedItem.PinSideIndex = targetArea switch
|
_draggedItem.PinSideIndex = targetArea switch
|
||||||
{
|
{
|
||||||
DockEditorPinArea.Start => 1,
|
DockEditorPinArea.Start => 1,
|
||||||
DockEditorPinArea.Center => 1, // Center maps to Start
|
|
||||||
DockEditorPinArea.End => 2,
|
DockEditorPinArea.End => 2,
|
||||||
_ => 0,
|
_ => 0,
|
||||||
};
|
};
|
||||||
@@ -395,6 +385,11 @@ public sealed partial class DockEditor : UserControl
|
|||||||
element = VisualTreeHelper.GetParent(element);
|
element = VisualTreeHelper.GetParent(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void UserControl_Loaded(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
AvailableItemsListView.ItemsSource = AvailableItems;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -163,7 +163,6 @@
|
|||||||
ItemTemplate="{StaticResource DockBandTemplate}"
|
ItemTemplate="{StaticResource DockBandTemplate}"
|
||||||
ItemsSource="{x:Bind ViewModel.StartItems, Mode=OneWay}"
|
ItemsSource="{x:Bind ViewModel.StartItems, Mode=OneWay}"
|
||||||
Layout="{StaticResource ItemsOrientation}">
|
Layout="{StaticResource ItemsOrientation}">
|
||||||
|
|
||||||
<ItemsRepeater.Transitions>
|
<ItemsRepeater.Transitions>
|
||||||
<TransitionCollection />
|
<TransitionCollection />
|
||||||
</ItemsRepeater.Transitions>
|
</ItemsRepeater.Transitions>
|
||||||
@@ -180,6 +179,10 @@
|
|||||||
<TransitionCollection />
|
<TransitionCollection />
|
||||||
</ItemsRepeater.Transitions>
|
</ItemsRepeater.Transitions>
|
||||||
</ItemsRepeater>
|
</ItemsRepeater>
|
||||||
|
<cpcontrols:DockEditor
|
||||||
|
Grid.RowSpan="2"
|
||||||
|
Grid.ColumnSpan="2"
|
||||||
|
Visibility="Collapsed" />
|
||||||
</Grid>
|
</Grid>
|
||||||
<VisualStateManager.VisualStateGroups>
|
<VisualStateManager.VisualStateGroups>
|
||||||
<VisualStateGroup x:Name="DockOrientation">
|
<VisualStateGroup x:Name="DockOrientation">
|
||||||
|
|||||||
@@ -68,7 +68,7 @@
|
|||||||
</ComboBoxItem>
|
</ComboBoxItem>
|
||||||
<ComboBoxItem>
|
<ComboBoxItem>
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
<FontIcon Glyph="" Rotation="180" />
|
<FontIcon Glyph="" />
|
||||||
<TextBlock Text="Top" />
|
<TextBlock Text="Top" />
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ComboBoxItem>
|
</ComboBoxItem>
|
||||||
@@ -111,10 +111,11 @@
|
|||||||
|
|
||||||
<!-- Bands Section -->
|
<!-- Bands Section -->
|
||||||
<TextBlock x:Uid="DockBandsSettingsHeader" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
<TextBlock x:Uid="DockBandsSettingsHeader" Style="{StaticResource SettingsSectionHeaderTextBlockStyle}" />
|
||||||
|
<Grid BorderBrush="{ThemeResource CardStrokeColorDefaultBrush}" BorderThickness="1">
|
||||||
|
<cpControls:DockEditor Height="148" DockItems="{x:Bind AllDockBandItems, Mode=OneWay}" />
|
||||||
|
</Grid>
|
||||||
|
|
||||||
<cpControls:DockEditor Height="150" DockItems="{x:Bind AllDockBandItems, Mode=OneWay}" />
|
<!--<ItemsRepeater ItemsSource="{x:Bind AllDockBandItems, Mode=OneWay}">
|
||||||
|
|
||||||
<ItemsRepeater ItemsSource="{x:Bind AllDockBandItems, Mode=OneWay}">
|
|
||||||
<ItemsRepeater.ItemTemplate>
|
<ItemsRepeater.ItemTemplate>
|
||||||
<DataTemplate x:DataType="dockVm:DockBandSettingsViewModel">
|
<DataTemplate x:DataType="dockVm:DockBandSettingsViewModel">
|
||||||
<controls:SettingsCard Description="{x:Bind Description, Mode=OneWay}" Header="{x:Bind Title, Mode=OneWay}">
|
<controls:SettingsCard Description="{x:Bind Description, Mode=OneWay}" Header="{x:Bind Title, Mode=OneWay}">
|
||||||
@@ -165,7 +166,7 @@
|
|||||||
</controls:SettingsCard>
|
</controls:SettingsCard>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsRepeater.ItemTemplate>
|
</ItemsRepeater.ItemTemplate>
|
||||||
</ItemsRepeater>
|
</ItemsRepeater>-->
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|||||||
Reference in New Issue
Block a user