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 1
1
using System ;
2
2
using System . Windows . Input ;
3
+
3
4
using Avalonia . Controls ;
5
+ using Avalonia . Controls . ApplicationLifetimes ;
4
6
5
7
namespace SourceGit
6
8
{
@@ -53,5 +55,17 @@ public static bool IsCheckForUpdateCommandVisible
53
55
else if ( ! string . IsNullOrEmpty ( textBlock . Text ) )
54
56
await CopyTextAsync ( textBlock . Text ) ;
55
57
} ) ;
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
+ } ) ;
56
70
}
57
71
}
Original file line number Diff line number Diff line change 42
42
<NativeMenuItem Header =" {DynamicResource Text.Preferences}" Command =" {x:Static s:App.OpenPreferencesCommand}" Gesture =" ⌘+," />
43
43
<NativeMenuItem Header =" {DynamicResource Text.OpenAppDataDir}" Command =" {x:Static s:App.OpenAppDataDirCommand}" />
44
44
<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 />
45
48
<NativeMenuItem Header =" {DynamicResource Text.Quit}" Command =" {x:Static s:App.QuitCommand}" Gesture =" ⌘+Q" />
46
49
</NativeMenu >
47
50
</NativeMenu .Menu>
Original file line number Diff line number Diff line change 19
19
<x : String x : Key =" Text.AIAssistant.Regen" xml : space =" preserve" >RE-GENERATE</x : String >
20
20
<x : String x : Key =" Text.AIAssistant.Tip" xml : space =" preserve" >Use AI to generate commit message</x : String >
21
21
<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 >
22
24
<x : String x : Key =" Text.Apply" xml : space =" preserve" >Patch</x : String >
23
25
<x : String x : Key =" Text.Apply.File" xml : space =" preserve" >Patch File:</x : String >
24
26
<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 23
23
<x : String x : Key =" Text.AIAssistant.Regen" xml : space =" preserve" >重新生成</x : String >
24
24
<x : String x : Key =" Text.AIAssistant.Tip" xml : space =" preserve" >使用AI助手生成提交信息</x : String >
25
25
<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 >
26
28
<x : String x : Key =" Text.Apply" xml : space =" preserve" >应用补丁(apply)</x : String >
27
29
<x : String x : Key =" Text.Apply.File" xml : space =" preserve" >补丁文件 :</x : String >
28
30
<x : String x : Key =" Text.Apply.File.Placeholder" xml : space =" preserve" >选择补丁文件</x : String >
Original file line number Diff line number Diff line change 23
23
<x : String x : Key =" Text.AIAssistant.Regen" xml : space =" preserve" >重新產生</x : String >
24
24
<x : String x : Key =" Text.AIAssistant.Tip" xml : space =" preserve" >使用 AI 產生提交訊息</x : String >
25
25
<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 >
26
28
<x : String x : Key =" Text.Apply" xml : space =" preserve" >套用修補檔 (apply patch)</x : String >
27
29
<x : String x : Key =" Text.Apply.File" xml : space =" preserve" >修補檔:</x : String >
28
30
<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