File tree Expand file tree Collapse file tree 5 files changed +23
-0
lines changed Expand file tree Collapse file tree 5 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Windows . Input ;
3+
34using Avalonia . Controls ;
5+ using Avalonia . Controls . ApplicationLifetimes ;
46
57namespace SourceGit
68{
@@ -53,5 +55,17 @@ public static bool IsCheckForUpdateCommandVisible
5355 else if ( ! string . IsNullOrEmpty ( textBlock . Text ) )
5456 await CopyTextAsync ( textBlock . Text ) ;
5557 } ) ;
58+
59+ public static readonly Command HideAppCommand = new Command ( _ =>
60+ {
61+ if ( Current is App app && app . TryGetFeature ( typeof ( IActivatableLifetime ) ) is IActivatableLifetime lifetime )
62+ lifetime . TryEnterBackground ( ) ;
63+ } ) ;
64+
65+ public static readonly Command ShowAppCommand = new Command ( _ =>
66+ {
67+ if ( Current is App app && app . TryGetFeature ( typeof ( IActivatableLifetime ) ) is IActivatableLifetime lifetime )
68+ lifetime . TryLeaveBackground ( ) ;
69+ } ) ;
5670 }
5771}
Original file line number Diff line number Diff line change 4242 <NativeMenuItem Header =" {DynamicResource Text.Preferences}" Command =" {x:Static s:App.OpenPreferencesCommand}" Gesture =" ⌘+," />
4343 <NativeMenuItem Header =" {DynamicResource Text.OpenAppDataDir}" Command =" {x:Static s:App.OpenAppDataDirCommand}" />
4444 <NativeMenuItemSeparator />
45+ <NativeMenuItem Header =" {DynamicResource Text.App.Hide}" Command =" {x:Static s:App.HideAppCommand}" Gesture =" ⌘+H" />
46+ <NativeMenuItem Header =" {DynamicResource Text.App.ShowAll}" Command =" {x:Static s:App.ShowAppCommand}" />
47+ <NativeMenuItemSeparator />
4548 <NativeMenuItem Header =" {DynamicResource Text.Quit}" Command =" {x:Static s:App.QuitCommand}" Gesture =" ⌘+Q" />
4649 </NativeMenu >
4750 </NativeMenu .Menu>
Original file line number Diff line number Diff line change 1919 <x : String x : Key =" Text.AIAssistant.Regen" xml : space =" preserve" >RE-GENERATE</x : String >
2020 <x : String x : Key =" Text.AIAssistant.Tip" xml : space =" preserve" >Use AI to generate commit message</x : String >
2121 <x : String x : Key =" Text.AIAssistant.Use" xml : space =" preserve" >APPLY AS COMMIT MESSAGE</x : String >
22+ <x : String x : Key =" Text.App.Hide" xml : space =" preserve" >Hide SourceGit</x : String >
23+ <x : String x : Key =" Text.App.ShowAll" xml : space =" preserve" >Show All</x : String >
2224 <x : String x : Key =" Text.Apply" xml : space =" preserve" >Patch</x : String >
2325 <x : String x : Key =" Text.Apply.File" xml : space =" preserve" >Patch File:</x : String >
2426 <x : String x : Key =" Text.Apply.File.Placeholder" xml : space =" preserve" >Select .patch file to apply</x : String >
Original file line number Diff line number Diff line change 2323 <x : String x : Key =" Text.AIAssistant.Regen" xml : space =" preserve" >重新生成</x : String >
2424 <x : String x : Key =" Text.AIAssistant.Tip" xml : space =" preserve" >使用AI助手生成提交信息</x : String >
2525 <x : String x : Key =" Text.AIAssistant.Use" xml : space =" preserve" >应用本次生成</x : String >
26+ <x : String x : Key =" Text.App.Hide" xml : space =" preserve" >隐藏 SourceGit</x : String >
27+ <x : String x : Key =" Text.App.ShowAll" xml : space =" preserve" >显示所有窗口</x : String >
2628 <x : String x : Key =" Text.Apply" xml : space =" preserve" >应用补丁(apply)</x : String >
2729 <x : String x : Key =" Text.Apply.File" xml : space =" preserve" >补丁文件 :</x : String >
2830 <x : String x : Key =" Text.Apply.File.Placeholder" xml : space =" preserve" >选择补丁文件</x : String >
Original file line number Diff line number Diff line change 2323 <x : String x : Key =" Text.AIAssistant.Regen" xml : space =" preserve" >重新產生</x : String >
2424 <x : String x : Key =" Text.AIAssistant.Tip" xml : space =" preserve" >使用 AI 產生提交訊息</x : String >
2525 <x : String x : Key =" Text.AIAssistant.Use" xml : space =" preserve" >套用為提交訊息</x : String >
26+ <x : String x : Key =" Text.App.Hide" xml : space =" preserve" >隱藏 SourceGit</x : String >
27+ <x : String x : Key =" Text.App.ShowAll" xml : space =" preserve" >顯示所有</x : String >
2628 <x : String x : Key =" Text.Apply" xml : space =" preserve" >套用修補檔 (apply patch)</x : String >
2729 <x : String x : Key =" Text.Apply.File" xml : space =" preserve" >修補檔:</x : String >
2830 <x : String x : Key =" Text.Apply.File.Placeholder" xml : space =" preserve" >選擇修補檔</x : String >
You can’t perform that action at this time.
0 commit comments