Skip to content

Commit

Permalink
Add currentAvailableScreenRect convenience method
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra authored and camilasan committed Jan 17, 2024
1 parent b030beb commit 6cd0bcd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/gui/systray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,6 +703,13 @@ QRect Systray::currentScreenRect() const
return screen->geometry();
}

QRect Systray::currentAvailableScreenRect() const
{
const auto screen = currentScreen();
Q_ASSERT(screen);
return screen->availableGeometry();
}

QPoint Systray::computeWindowReferencePoint() const
{
constexpr auto spacing = 4;
Expand Down
1 change: 1 addition & 0 deletions src/gui/systray.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ private slots:

[[nodiscard]] QScreen *currentScreen() const;
[[nodiscard]] QRect currentScreenRect() const;
[[nodiscard]] QRect currentAvailableScreenRect() const;
[[nodiscard]] QPoint computeWindowReferencePoint() const;
[[nodiscard]] QPoint computeNotificationReferencePoint(int spacing = 20, NotificationPosition position = NotificationPosition::Default) const;
[[nodiscard]] QPoint calcTrayIconCenter() const;
Expand Down

0 comments on commit 6cd0bcd

Please sign in to comment.