summaryrefslogtreecommitdiff
path: root/windows/WinUI
diff options
context:
space:
mode:
authorGrant Limberg <grant.limberg@zerotier.com>2016-11-21 15:31:32 -0800
committerGrant Limberg <grant.limberg@zerotier.com>2016-11-21 15:31:32 -0800
commit3a3a23db344fa580aa016464bc265843254c98e2 (patch)
tree3ef9e594ef080f712b2f691b8049a489ace4bec1 /windows/WinUI
parentd3bd10952ece51a213a7fae27db7c329375c8905 (diff)
downloadinfinitytier-3a3a23db344fa580aa016464bc265843254c98e2.tar.gz
infinitytier-3a3a23db344fa580aa016464bc265843254c98e2.zip
hacky way to set window position but it works
Diffstat (limited to 'windows/WinUI')
-rw-r--r--windows/WinUI/AboutView.xaml2
-rw-r--r--windows/WinUI/ToolbarItem.xaml.cs27
2 files changed, 27 insertions, 2 deletions
diff --git a/windows/WinUI/AboutView.xaml b/windows/WinUI/AboutView.xaml
index 635c9ef7..5def46a6 100644
--- a/windows/WinUI/AboutView.xaml
+++ b/windows/WinUI/AboutView.xaml
@@ -8,7 +8,7 @@
Title="AboutView" Height="460" Width="300" Icon="ZeroTierIcon.ico">
<Grid>
<Image x:Name="image" HorizontalAlignment="Center" Height="100" Margin="0,10,0,0" VerticalAlignment="Top" Width="100" Source="ZeroTierIcon.ico"/>
- <RichTextBox x:Name="richTextBox" HorizontalAlignment="Left" Height="307" Margin="10,115,0,0" VerticalAlignment="Top" Width="275" IsReadOnly="True" IsDocumentEnabled="True">
+ <RichTextBox x:Name="richTextBox" HorizontalAlignment="Left" Height="307" Margin="10,115,0,0" VerticalAlignment="Top" Width="275" IsReadOnly="True" IsDocumentEnabled="True" BorderThickness="0">
<RichTextBox.Resources>
<Style TargetType="Hyperlink">
<Setter Property="Cursor" Value="Hand" />
diff --git a/windows/WinUI/ToolbarItem.xaml.cs b/windows/WinUI/ToolbarItem.xaml.cs
index 3de573b7..e8409de4 100644
--- a/windows/WinUI/ToolbarItem.xaml.cs
+++ b/windows/WinUI/ToolbarItem.xaml.cs
@@ -123,8 +123,10 @@ namespace WinUI
netListView = new WinUI.NetworkListView();
netListView.Closed += ShowNetworksClosed;
}
-
+
netListView.Show();
+
+ setWindowPosition(netListView);
}
private void ShowNetworksClosed(object sender, System.EventArgs e)
@@ -138,7 +140,10 @@ namespace WinUI
{
joinNetView = new JoinNetworkView();
joinNetView.Closed += JoinNetworkClosed;
+
joinNetView.Show();
+
+ setWindowPosition(joinNetView);
}
}
@@ -153,7 +158,9 @@ namespace WinUI
{
aboutView = new AboutView();
aboutView.Closed += AboutClosed;
+
aboutView.Show();
+ setWindowPosition(aboutView);
}
}
@@ -168,7 +175,10 @@ namespace WinUI
{
prefsView = new PreferencesView();
prefsView.Closed += PreferencesClosed;
+
prefsView.Show();
+
+ setWindowPosition(prefsView);
}
}
@@ -203,5 +213,20 @@ namespace WinUI
}
}
}
+
+ private void setWindowPosition(Window w)
+ {
+ double width = w.ActualWidth;
+ double height = w.ActualHeight;
+
+ double screenHeight = SystemParameters.PrimaryScreenHeight;
+ double screenWidth = SystemParameters.PrimaryScreenWidth;
+
+ double top = screenHeight - height - 40;
+ double left = screenWidth - width - 20;
+
+ w.Top = top;
+ w.Left = left;
+ }
}
}