mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-30 16:44:59 +00:00
feature: move main menu to macOS system menu bar
This commit is contained in:
parent
764cf24284
commit
e0d35409b4
7 changed files with 66 additions and 34 deletions
|
@ -2,6 +2,7 @@
|
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:s="using:SourceGit"
|
||||
xmlns:vm="using:SourceGit.ViewModels"
|
||||
xmlns:m="using:SourceGit.Models"
|
||||
xmlns:c="using:SourceGit.Converters"
|
||||
|
@ -49,31 +50,31 @@
|
|||
</Border>
|
||||
|
||||
<!-- Menu -->
|
||||
<Button Grid.Column="{OnPlatform 0, macOS=2}" Classes="icon_button" VerticalAlignment="Bottom">
|
||||
<Button Grid.Column="0" Classes="icon_button" VerticalAlignment="Bottom" IsVisible="{OnPlatform True, macOS=False}">
|
||||
<Button.Margin>
|
||||
<OnPlatform Default="4,0,2,3" macOS="4,0,6,3"/>
|
||||
</Button.Margin>
|
||||
|
||||
<Button.Flyout>
|
||||
<MenuFlyout Placement="BottomEdgeAlignedLeft" VerticalOffset="-8">
|
||||
<MenuItem Header="{DynamicResource Text.Preference}" Click="OpenPreference">
|
||||
<MenuItem Header="{DynamicResource Text.Preference}" Command="{x:Static s:App.OpenPreferenceCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Path Width="14" Height="14" Data="{StaticResource Icons.Settings2}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="{DynamicResource Text.Hotkeys}" Click="OpenHotkeys">
|
||||
<MenuItem Header="{DynamicResource Text.Hotkeys}" Command="{x:Static s:App.OpenHotkeysCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Path Width="14" Height="14" Data="{StaticResource Icons.Hotkeys}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="-"/>
|
||||
<MenuItem Header="{DynamicResource Text.SelfUpdate}" Click="Check4Update">
|
||||
<MenuItem Header="{DynamicResource Text.SelfUpdate}" Command="{x:Static s:App.CheckForUpdateCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Path Width="14" Height="14" Data="{StaticResource Icons.SoftwareUpdate}"/>
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Header="-"/>
|
||||
<MenuItem Header="{DynamicResource Text.About}" Click="OpenAboutDialog">
|
||||
<MenuItem Header="{DynamicResource Text.About}" Command="{x:Static s:App.OpenAboutCommand}">
|
||||
<MenuItem.Icon>
|
||||
<Path Width="14" Height="14" Data="{StaticResource Icons.Info}"/>
|
||||
</MenuItem.Icon>
|
||||
|
|
|
@ -337,33 +337,6 @@ namespace SourceGit.Views
|
|||
OnPopupCancel(sender, e);
|
||||
}
|
||||
|
||||
private async void OpenPreference(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dialog = new Preference();
|
||||
await dialog.ShowDialog(this);
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private async void OpenHotkeys(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dialog = new Hotkeys();
|
||||
await dialog.ShowDialog(this);
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void Check4Update(object sender, RoutedEventArgs e)
|
||||
{
|
||||
App.Check4Update(true);
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private async void OpenAboutDialog(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var dialog = new About();
|
||||
await dialog.ShowDialog(this);
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private bool _pressedTab = false;
|
||||
private Point _pressedTabPosition = new Point();
|
||||
private bool _startDrag = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue