feat(ui): open ListSettingsModal via context menu and gear button
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
</StackPanel>
|
||||
<!-- More button -->
|
||||
<Button Grid.Column="2" Classes="icon-btn" VerticalAlignment="Center"
|
||||
Command="{Binding OpenSettingsCommand}"
|
||||
Command="{Binding OpenListSettingsCommand}"
|
||||
ToolTip.Tip="Settings">
|
||||
<PathIcon Data="{StaticResource Icon.MoreHorizontal}"
|
||||
Width="14" Height="14"
|
||||
@@ -130,9 +130,16 @@
|
||||
<DataTemplate DataType="vm:ListNavItemViewModel">
|
||||
<Border Classes="list-item" Classes.active="{Binding IsActive}"
|
||||
Tapped="OnItemTapped">
|
||||
<Grid ColumnDefinitions="20,*,Auto">
|
||||
<Border.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Header="Settings..."
|
||||
Command="{Binding $parent[UserControl].((vm:ListsIslandViewModel)DataContext).OpenListSettingsCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</ContextMenu>
|
||||
</Border.ContextMenu>
|
||||
<Grid ColumnDefinitions="20,*,Auto,Auto">
|
||||
<!-- Left accent bar for active state -->
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="4"
|
||||
Background="Transparent"
|
||||
CornerRadius="8" IsHitTestVisible="False"
|
||||
IsVisible="{Binding IsActive}">
|
||||
@@ -158,6 +165,18 @@
|
||||
FontFamily="{DynamicResource MonoFamily}" FontSize="10"
|
||||
Foreground="{DynamicResource TextFaintBrush}"
|
||||
VerticalAlignment="Center"/>
|
||||
<!-- Gear button -->
|
||||
<Button Grid.Column="3"
|
||||
Content="⚙"
|
||||
ToolTip.Tip="Settings..."
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
Padding="4,0"
|
||||
FontSize="11"
|
||||
Foreground="{DynamicResource TextFaintBrush}"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding $parent[UserControl].((vm:ListsIslandViewModel)DataContext).OpenListSettingsCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
</DataTemplate>
|
||||
|
||||
@@ -17,6 +17,14 @@ public partial class ListsIslandView : UserControl
|
||||
{
|
||||
vm.FocusSearchRequested += (_, _) => SearchBox.Focus();
|
||||
vm.ShowSettingsModal = ShowSettingsAsync;
|
||||
vm.ShowListSettingsModal = async modal =>
|
||||
{
|
||||
var window = new ListSettingsModalView { DataContext = modal };
|
||||
modal.CloseAction = () => window.Close();
|
||||
var top = TopLevel.GetTopLevel(this) as Window;
|
||||
if (top is null) window.Show();
|
||||
else await window.ShowDialog(top);
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user