Skip to content

Commit 21c944e

Browse files
committed
Fix Conflict
1 parent 88d84b4 commit 21c944e

File tree

3 files changed

+23
-46
lines changed

3 files changed

+23
-46
lines changed

Flow.Launcher/MainWindow.xaml

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@
3232
Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
3333
WindowStartupLocation="Manual"
3434
WindowStyle="None"
35-
mc:Ignorable="d"
36-
Left="{Binding Left, Mode=TwoWay}"
37-
Top="{Binding Top, Mode=TwoWay}">
35+
mc:Ignorable="d">
3836
<Window.Resources>
3937
<converters:QuerySuggestionBoxConverter x:Key="QuerySuggestionBoxConverter" />
4038
<converters:BorderClipConverter x:Key="BorderClipConverter" />
@@ -88,20 +86,20 @@
8886
<KeyBinding Key="Left" Command="{Binding EscCommand}" />
8987
<KeyBinding
9088
Key="OemCloseBrackets"
91-
Modifiers="Control"
92-
Command="{Binding IncreaseWidthCommand}"/>
89+
Command="{Binding IncreaseWidthCommand}"
90+
Modifiers="Control" />
9391
<KeyBinding
9492
Key="OemOpenBrackets"
95-
Modifiers="Control"
96-
Command="{Binding DecreaseWidthCommand}"/>
93+
Command="{Binding DecreaseWidthCommand}"
94+
Modifiers="Control" />
9795
<KeyBinding
9896
Key="OemPlus"
99-
Modifiers="Control"
100-
Command="{Binding IncreaseMaxResultCommand}"/>
97+
Command="{Binding IncreaseMaxResultCommand}"
98+
Modifiers="Control" />
10199
<KeyBinding
102100
Key="OemMinus"
103-
Modifiers="Control"
104-
Command="{Binding DecreaseMaxResultCommand}"/>
101+
Command="{Binding DecreaseMaxResultCommand}"
102+
Modifiers="Control" />
105103
<KeyBinding
106104
Key="H"
107105
Command="{Binding LoadHistoryCommand}"
@@ -195,9 +193,9 @@
195193
AllowDrop="True"
196194
Background="Transparent"
197195
PreviewDragOver="OnPreviewDragOver"
196+
PreviewKeyUp="QueryTextBox_KeyUp"
198197
Style="{DynamicResource QueryBoxStyle}"
199198
Text="{Binding QueryText, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
200-
PreviewKeyUp="QueryTextBox_KeyUp"
201199
Visibility="Visible">
202200
<TextBox.CommandBindings>
203201
<CommandBinding Command="ApplicationCommands.Copy" Executed="OnCopy" />

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ private void OnLoaded(object sender, RoutedEventArgs _)
108108
animationSound.Position = TimeSpan.Zero;
109109
animationSound.Play();
110110
}
111-
112111
UpdatePosition();
113112
Activate();
114113
QueryTextBox.Focus();
@@ -161,6 +160,7 @@ private void OnLoaded(object sender, RoutedEventArgs _)
161160
_viewModel.QueryTextCursorMovedToEnd = false;
162161
}
163162
break;
163+
164164
}
165165
};
166166
_settings.PropertyChanged += (o, e) =>
@@ -176,6 +176,12 @@ private void OnLoaded(object sender, RoutedEventArgs _)
176176
case nameof(Settings.Hotkey):
177177
UpdateNotifyIconText();
178178
break;
179+
case nameof(Settings.WindowLeft):
180+
Left = _settings.WindowLeft;
181+
break;
182+
case nameof(Settings.WindowTop):
183+
Top = _settings.WindowTop;
184+
break;
179185
}
180186
};
181187
}
@@ -311,9 +317,10 @@ private void ToggleGameMode()
311317
}
312318
private void PositionReset()
313319
{
314-
Left = WindowLeft();
315-
Top = WindowTop();
316-
320+
_settings.WindowLeft = WindowLeft();
321+
_settings.WindowTop = WindowTop();
322+
// Left = _settings.WindowLeft;
323+
//Top = _settings.WindowTop;
317324
}
318325
private void InitProgressbarAnimation()
319326
{
@@ -469,15 +476,6 @@ public void HideStartup()
469476
_viewModel.Show();
470477
}
471478
}
472-
473-
private void InitializePosition()
474-
{
475-
if (!_settings.RememberLastLaunchLocation)
476-
{
477-
Left = WindowLeft();
478-
Top = WindowTop();
479-
}
480-
}
481479

482480
public double WindowLeft()
483481
{

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -341,25 +341,6 @@ public string QueryText
341341
}
342342

343343

344-
public double Top
345-
{
346-
get => _settings.WindowTop;
347-
set
348-
{
349-
_settings.WindowTop = value;
350-
OnPropertyChanged();
351-
}
352-
}
353-
public double Left
354-
{
355-
get => _settings.WindowLeft;
356-
set
357-
{
358-
_settings.WindowLeft = value;
359-
OnPropertyChanged();
360-
}
361-
}
362-
363344
[RelayCommand]
364345
private void IncreaseWidth()
365346
{
@@ -370,7 +351,7 @@ private void IncreaseWidth()
370351
else
371352
{
372353
_settings.WindowSize += 100;
373-
Left -= 50;
354+
_settings.WindowLeft -= 50;
374355
}
375356
OnPropertyChanged();
376357
}
@@ -384,7 +365,7 @@ private void DecreaseWidth()
384365
}
385366
else
386367
{
387-
Left += 50;
368+
_settings.WindowLeft += 50;
388369
_settings.WindowSize -= 100;
389370
}
390371
OnPropertyChanged();

0 commit comments

Comments
 (0)