Skip to content

Commit

Permalink
Remove now unused method for calculating taskbar geometry
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 2766bd8 commit f0f57fe
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
27 changes: 0 additions & 27 deletions src/gui/systray.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -696,33 +696,6 @@ Systray::TaskBarPosition Systray::taskbarOrientation() const
#endif
}

// TODO: Get real taskbar dimensions Linux as well
QRect Systray::taskbarGeometry() const
{
#if defined(Q_OS_WIN)
QRect tbRect = Utility::getTaskbarDimensions();
//QML side expects effective pixels, convert taskbar dimensions if necessary
auto pixelRatio = currentScreen()->devicePixelRatio();
if (pixelRatio != 1) {
tbRect.setHeight(tbRect.height() / pixelRatio);
tbRect.setWidth(tbRect.width() / pixelRatio);
}
return tbRect;
#elif defined(Q_OS_MACOS)
const auto screenWidth = currentScreenRect().width();
const auto statusBarHeight = static_cast<int>(OCC::menuBarThickness());
return {0, 0, screenWidth, statusBarHeight};
#else
if (taskbarOrientation() == TaskBarPosition::Bottom || taskbarOrientation() == TaskBarPosition::Top) {
auto screenWidth = currentScreenRect().width();
return {0, 0, screenWidth, 32};
} else {
auto screenHeight = currentScreenRect().height();
return {0, 0, 32, screenHeight};
}
#endif
}

QRect Systray::currentScreenRect() const
{
const auto screen = currentScreen();
Expand Down
1 change: 0 additions & 1 deletion src/gui/systray.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ private slots:
[[nodiscard]] QPoint computeNotificationReferencePoint(int spacing = 20, NotificationPosition position = NotificationPosition::Default) const;
[[nodiscard]] QPoint calcTrayIconCenter() const;
[[nodiscard]] TaskBarPosition taskbarOrientation() const;
[[nodiscard]] QRect taskbarGeometry() const;
[[nodiscard]] QRect computeWindowRect(int spacing, const QPoint &topLeft, const QPoint &bottomRight) const;
[[nodiscard]] QPoint computeWindowPosition(int width, int height) const;
[[nodiscard]] QPoint computeNotificationPosition(int width, int height, int spacing = 20, NotificationPosition position = NotificationPosition::Default) const;
Expand Down

0 comments on commit f0f57fe

Please sign in to comment.