2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Show reset scale button if window doesn't fit.

This commit is contained in:
John Preston
2018-10-20 23:04:10 +04:00
parent 17cde3426a
commit 01b4e1946a
4 changed files with 144 additions and 14 deletions

View File

@@ -340,7 +340,15 @@ void MainWindow::initSize() {
auto avail = QDesktopWidget().availableGeometry();
bool maximized = false;
auto geom = QRect(avail.x() + (avail.width() - st::windowDefaultWidth) / 2, avail.y() + (avail.height() - st::windowDefaultHeight) / 2, st::windowDefaultWidth, st::windowDefaultHeight);
auto geom = QRect(
avail.x() + std::max(
(avail.width() - st::windowDefaultWidth) / 2,
0),
avail.y() + std::max(
(avail.height() - st::windowDefaultHeight) / 2,
0),
st::windowDefaultWidth,
st::windowDefaultHeight);
if (position.w && position.h) {
for (auto screen : QGuiApplication::screens()) {
if (position.moncrc == screenNameChecksum(screen->name())) {