Skip to content

Commit 37ccf25

Browse files
committed
Add Top Positioning per monitor
1 parent 7af3bd1 commit 37ccf25

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Flow.Launcher/MainWindow.xaml.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,15 +306,15 @@ private void InitializePosition()
306306
break;
307307
case SearchWindowAligns.CenterTop:
308308
Left = HorizonCenter(screen);
309-
Top = 10;
309+
Top = VerticalTop(screen);
310310
break;
311311
case SearchWindowAligns.LeftTop:
312312
Left = HorizonLeft(screen);
313-
Top = 10;
313+
Top = VerticalTop(screen);
314314
break;
315315
case SearchWindowAligns.RightTop:
316316
Left = HorizonRight(screen);
317-
Top = 10;
317+
Top = VerticalTop(screen);
318318
break;
319319
case SearchWindowAligns.Custom:
320320
Left = WindowsInteropHelper.TransformPixelsToDIP(this, screen.WorkingArea.X + _settings.CustomWindowLeft, 0).X;
@@ -727,6 +727,13 @@ public double HorizonLeft(Screen screen)
727727
return left;
728728
}
729729

730+
public double VerticalTop(Screen screen)
731+
{
732+
var dip1 = WindowsInteropHelper.TransformPixelsToDIP(this, 0, screen.WorkingArea.Y);
733+
var top = dip1.Y +10;
734+
return top;
735+
}
736+
730737
/// <summary>
731738
/// Register up and down key
732739
/// todo: any way to put this in xaml ?

0 commit comments

Comments
 (0)