File tree Expand file tree Collapse file tree 4 files changed +37
-5
lines changed
Flow.Launcher.Infrastructure/UserSettings Expand file tree Collapse file tree 4 files changed +37
-5
lines changed Original file line number Diff line number Diff line change @@ -229,6 +229,8 @@ public enum LauncherPositions
229
229
{
230
230
RememberLastLaunchLocation ,
231
231
MouseScreenCenter ,
232
- MouseScreenCenterTop
232
+ MouseScreenCenterTop ,
233
+ MouseScreenLeftTop ,
234
+ MouseScreenRightTop
233
235
}
234
236
}
Original file line number Diff line number Diff line change 36
36
<system : String x : Key =" LauncherPosition" >Launcher Position</system : String >
37
37
<system : String x : Key =" rememberLastLocation" >Remember last launch location</system : String >
38
38
<system : String x : Key =" LauncherPositionRememberLastLaunchLocation" >Remember Last Launch Location</system : String >
39
- <system : String x : Key =" LauncherPositionMouseScreenCenter" >Mouse Screen Center</system : String >
40
- <system : String x : Key =" LauncherPositionMouseScreenCenterTop" >Mouse Screen Center Top</system : String >
39
+ <system : String x : Key =" LauncherPositionMouseScreenCenter" >Mouse Focused Screen Center</system : String >
40
+ <system : String x : Key =" LauncherPositionMouseScreenCenterTop" >Mouse Focused Screen Center Top</system : String >
41
+ <system : String x : Key =" LauncherPositionMouseScreenLeftTop" >Mouse Focused Screen Left Top</system : String >
42
+ <system : String x : Key =" LauncherPositionMouseScreenRightTop" >Mouse Focused Screen Right Top</system : String >
41
43
<system : String x : Key =" language" >Language</system : String >
42
44
<system : String x : Key =" lastQueryMode" >Last Query Style</system : String >
43
45
<system : String x : Key =" lastQueryModeToolTip" >Show/Hide previous results when Flow Launcher is reactivated.</system : String >
Original file line number Diff line number Diff line change @@ -197,6 +197,16 @@ private void InitializePosition()
197
197
Left = WindowLeft ( ) ;
198
198
Top = 10 ;
199
199
}
200
+ else if ( _settings . LauncherPosition == "MouseScreenLeftTop" )
201
+ {
202
+ Left = 10 ;
203
+ Top = 10 ;
204
+ }
205
+ else if ( _settings . LauncherPosition == "MouseScreenRightTop" )
206
+ {
207
+ Left = WindowRight ( ) ;
208
+ Top = 10 ;
209
+ }
200
210
}
201
211
202
212
private void UpdateNotifyIconText ( )
@@ -438,6 +448,16 @@ private void UpdatePosition()
438
448
Left = WindowLeft ( ) ;
439
449
Top = 10 ;
440
450
}
451
+ else if ( _settings . LauncherPosition == "MouseScreenLeftTop" )
452
+ {
453
+ Left = 10 ;
454
+ Top = 10 ;
455
+ }
456
+ else if ( _settings . LauncherPosition == "MouseScreenRightTop" )
457
+ {
458
+ Left = WindowRight ( ) ;
459
+ Top = 10 ;
460
+ }
441
461
}
442
462
443
463
private void OnLocationChanged ( object sender , EventArgs e )
@@ -482,6 +502,15 @@ public double WindowTop()
482
502
return top ;
483
503
}
484
504
505
+ public double WindowRight ( )
506
+ {
507
+ var screen = Screen . FromPoint ( System . Windows . Forms . Cursor . Position ) ;
508
+ var dip1 = WindowsInteropHelper . TransformPixelsToDIP ( this , screen . WorkingArea . X , 0 ) ;
509
+ var dip2 = WindowsInteropHelper . TransformPixelsToDIP ( this , screen . WorkingArea . Width , 0 ) ;
510
+ var left = ( dip2 . X - ActualWidth ) - 10 ;
511
+ return left ;
512
+ }
513
+
485
514
/// <summary>
486
515
/// Register up and down key
487
516
/// todo: any way to put this in xaml ?
Original file line number Diff line number Diff line change 693
693
<ComboBox
694
694
x : Name =" LauncherPosition"
695
695
Grid.Column=" 2"
696
- MinWidth =" 180 "
696
+ MinWidth =" 220 "
697
697
Margin =" 0,0,18,0"
698
698
VerticalAlignment =" Center"
699
699
DisplayMemberPath =" Display"
702
702
SelectedValue =" {Binding Settings.LauncherPosition}"
703
703
SelectedValuePath =" Value"
704
704
SelectionChanged =" LauncherPositionSelectedIndexChanged" />
705
- <!-- <CheckBox IsChecked="{Binding Settings.RememberLastLaunchLocation}" Style="{DynamicResource SideControlCheckBox}" />-->
706
705
<TextBlock Style =" {StaticResource Glyph}" >
707
706

708
707
</TextBlock >
You can’t perform that action at this time.
0 commit comments