feat(ui): open Mission Control from the title bar
This commit is contained in:
@@ -88,6 +88,11 @@
|
||||
<!-- Right: window controls -->
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal" Spacing="0"
|
||||
VerticalAlignment="Center" Margin="0,0,4,0">
|
||||
<Button Classes="title-ctrl"
|
||||
Command="{Binding OpenMissionControlCommand}"
|
||||
ToolTip.Tip="{loc:Tr missionControl.windowTitle}">
|
||||
<PathIcon Data="{StaticResource Icon.Grid}" Width="12" Height="12"/>
|
||||
</Button>
|
||||
<Button Classes="title-ctrl" Click="OnMinimize">
|
||||
<PathIcon Data="{StaticResource Icon.WinMin}" Width="10" Height="10"/>
|
||||
</Button>
|
||||
|
||||
@@ -42,6 +42,12 @@ public partial class MainWindow : Window
|
||||
if (DataContext is IslandsShellViewModel vm)
|
||||
{
|
||||
vm.Dialogs = new WindowDialogService(this);
|
||||
vm.BringToFront = () =>
|
||||
{
|
||||
if (WindowState == WindowState.Minimized)
|
||||
WindowState = WindowState.Normal;
|
||||
Activate();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ using ClaudeDo.Ui.ViewModels;
|
||||
using ClaudeDo.Ui.ViewModels.Conflicts;
|
||||
using ClaudeDo.Ui.ViewModels.Modals;
|
||||
using ClaudeDo.Ui.Views.Conflicts;
|
||||
using ClaudeDo.Ui.Views.MissionControl;
|
||||
using ClaudeDo.Ui.Views.Modals;
|
||||
|
||||
namespace ClaudeDo.Ui.Views;
|
||||
@@ -22,6 +23,7 @@ namespace ClaudeDo.Ui.Views;
|
||||
public sealed class WindowDialogService : IDialogService
|
||||
{
|
||||
private readonly Window _owner;
|
||||
private MissionControlWindow? _missionControl;
|
||||
|
||||
public WindowDialogService(Window owner) => _owner = owner;
|
||||
|
||||
@@ -111,6 +113,14 @@ public sealed class WindowDialogService : IDialogService
|
||||
await dlg.ShowDialog(_owner);
|
||||
}
|
||||
|
||||
public void ShowMissionControl(MissionControlViewModel vm)
|
||||
{
|
||||
_missionControl ??= new MissionControlWindow { DataContext = vm };
|
||||
if (!_missionControl.IsVisible)
|
||||
_missionControl.Show(); // modeless, independent top-level window
|
||||
_missionControl.Activate(); // bring to front / focus
|
||||
}
|
||||
|
||||
public Task<bool> ConfirmAsync(string message)
|
||||
{
|
||||
var tcs = new TaskCompletionSource<bool>();
|
||||
|
||||
Reference in New Issue
Block a user