Skip to content

Commit 7ccf109

Browse files
authored
Merge pull request #2674 from onesounds/040427SplitSettingWindow
Code separation in the settings window
2 parents a68b180 + 2202fce commit 7ccf109

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+6192
-4961
lines changed

Flow.Launcher/App.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
</ui:ThemeResources>
2525
<ui:XamlControlsResources />
2626
<ResourceDictionary Source="pack://application:,,,/Resources/CustomControlTemplate.xaml" />
27+
<ResourceDictionary Source="pack://application:,,,/Resources/SettingWindowStyle.xaml" />
2728
<ResourceDictionary Source="pack://application:,,,/Themes/Win11System.xaml" />
2829
<ResourceDictionary Source="pack://application:,,,/Languages/en.xaml" />
2930
</ResourceDictionary.MergedDictionaries>

Flow.Launcher/CustomShortcutSetting.xaml.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ namespace Flow.Launcher
88
{
99
public partial class CustomShortcutSetting : Window
1010
{
11-
private SettingWindowViewModel viewModel;
1211
public string Key { get; set; } = String.Empty;
1312
public string Value { get; set; } = String.Empty;
1413
private string originalKey { get; init; } = null;
@@ -17,13 +16,11 @@ public partial class CustomShortcutSetting : Window
1716

1817
public CustomShortcutSetting(SettingWindowViewModel vm)
1918
{
20-
viewModel = vm;
2119
InitializeComponent();
2220
}
2321

24-
public CustomShortcutSetting(string key, string value, SettingWindowViewModel vm)
22+
public CustomShortcutSetting(string key, string value)
2523
{
26-
viewModel = vm;
2724
Key = key;
2825
Value = value;
2926
originalKey = key;
@@ -46,8 +43,7 @@ private void BtnAdd_OnClick(object sender, RoutedEventArgs e)
4643
return;
4744
}
4845
// Check if key is modified or adding a new one
49-
if (((update && originalKey != Key) || !update)
50-
&& viewModel.ShortcutExists(Key))
46+
if ((update && originalKey != Key) || !update)
5147
{
5248
MessageBox.Show(InternationalizationManager.Instance.GetTranslation("duplicateShortcut"));
5349
return;

Flow.Launcher/Images/info.png

1.33 KB
Loading

Flow.Launcher/Images/keyboard.png

873 Bytes
Loading

Flow.Launcher/Images/plugins.png

804 Bytes
Loading

Flow.Launcher/Images/proxy.png

1.72 KB
Loading

Flow.Launcher/Images/store.png

763 Bytes
Loading

Flow.Launcher/Images/theme.png

1.05 KB
Loading

Flow.Launcher/Resources/Controls/Card.xaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<Setter Property="BorderThickness" Value="1" />
2121
<Setter Property="CornerRadius" Value="5" />
2222
<Setter Property="MinHeight" Value="68" />
23+
<Setter Property="Padding" Value="0,15,0,15" />
2324
<Setter Property="Margin" Value="0,4,0,0" />
2425
<Setter Property="SnapsToDevicePixels" Value="True" />
2526
<Style.Triggers>
@@ -36,6 +37,27 @@
3637
<Setter Property="Padding" Value="38,0,26,0" />
3738
<Setter Property="Background" Value="Transparent" />
3839
</DataTrigger>
40+
41+
<DataTrigger Binding="{Binding (local:CardGroup.Position), RelativeSource={RelativeSource AncestorType=local:Card}}" Value="First">
42+
<Setter Property="Margin" Value="0" />
43+
<Setter Property="CornerRadius" Value="0" />
44+
<Setter Property="Background" Value="Transparent" />
45+
<Setter Property="BorderThickness" Value="0" />
46+
</DataTrigger>
47+
48+
<DataTrigger Binding="{Binding (local:CardGroup.Position), RelativeSource={RelativeSource AncestorType=local:Card}}" Value="Middle">
49+
<Setter Property="Margin" Value="0" />
50+
<Setter Property="CornerRadius" Value="0" />
51+
<Setter Property="Background" Value="Transparent" />
52+
<Setter Property="BorderThickness" Value="0 1 0 0" />
53+
</DataTrigger>
54+
55+
<DataTrigger Binding="{Binding (local:CardGroup.Position), RelativeSource={RelativeSource AncestorType=local:Card}}" Value="Last">
56+
<Setter Property="Margin" Value="0" />
57+
<Setter Property="CornerRadius" Value="0" />
58+
<Setter Property="Background" Value="Transparent" />
59+
<Setter Property="BorderThickness" Value="0 1 0 0" />
60+
</DataTrigger>
3961
</Style.Triggers>
4062
</Style>
4163
</Border.Style>

Flow.Launcher/Resources/Controls/Card.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public Card()
1616
{
1717
InitializeComponent();
1818
}
19+
1920
public string Title
2021
{
2122
get { return (string)GetValue(TitleProperty); }

0 commit comments

Comments
 (0)