Skip to content

Commit

Permalink
Added window size in tooltip (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
lpeyr committed Sep 4, 2023
1 parent 8956887 commit 9e5f51c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions PermaTop/UserControls/WindowPropertyItem.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ public WindowPropertyItem(WindowInfo windowInfo, StackPanel parent)
private void InitUI()
{
TitleTxt.Text = WindowInfo.Title.Length > 50 ? WindowInfo.Title[0..50] + "..." : WindowInfo.Title;
TitleToolTip.Content = WindowInfo.Title;

GetWindowRect(WindowInfo.Hwnd, out Global.RECT bounds);

TitleToolTip.Content = $"{WindowInfo.Title}\n{bounds.Right - bounds.Left}x{bounds.Bottom - bounds.Top}";

PinBtn.Content = WindowInfo.IsPinned ? "\uF604" : "\uF602";

Expand Down Expand Up @@ -217,7 +220,7 @@ private void MoveBtn_Click(object sender, RoutedEventArgs e)
// Adjust the coordinates to account for the window size
int windowX = centerX - (int)(width / 2);
int windowY = centerY - (int)(height / 2);

MoveWindow(WindowInfo.Hwnd, windowX, windowY);
}
}
Expand Down

0 comments on commit 9e5f51c

Please sign in to comment.