mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Stop using availableGeometry
This commit is contained in:
parent
b07ec73ccc
commit
2a90b1c6ef
@ -3,9 +3,9 @@
|
||||
#include <QGridLayout>
|
||||
#include <QLabel>
|
||||
#include <QApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QFrame>
|
||||
#include <QImage>
|
||||
#include <QScreen>
|
||||
|
||||
#include "bookmarks.h"
|
||||
|
||||
@ -32,7 +32,12 @@ BookmarksDialog::BookmarksDialog(QWidget *parent)
|
||||
label->setStyleSheet(labelsStyle);
|
||||
}
|
||||
|
||||
int heightDesktopResolution = QApplication::desktop()->screenGeometry().height();
|
||||
QScreen *screen = parent != nullptr ? parent->window()->screen() : nullptr;
|
||||
if (screen == nullptr) {
|
||||
screen = QApplication::screens().constFirst();
|
||||
}
|
||||
|
||||
int heightDesktopResolution = screen != nullptr ? screen->size().height() : 600;
|
||||
int height, width;
|
||||
height = heightDesktopResolution * 0.50;
|
||||
width = height * 0.65;
|
||||
|
@ -26,7 +26,6 @@
|
||||
#include <algorithm>
|
||||
#include <QApplication>
|
||||
#include <QCoreApplication>
|
||||
#include <QDesktopWidget>
|
||||
#include <QToolButton>
|
||||
#include <QMenu>
|
||||
#include <QFileDialog>
|
||||
@ -146,8 +145,13 @@ void MainWindowViewer::setupUI()
|
||||
connect(viewer, &Viewer::openPreviousComic, this, &MainWindowViewer::openPreviousComic);
|
||||
|
||||
setCentralWidget(viewer);
|
||||
int heightDesktopResolution = QApplication::desktop()->screenGeometry().height();
|
||||
int widthDesktopResolution = QApplication::desktop()->screenGeometry().width();
|
||||
QScreen *screen = window()->screen();
|
||||
if (screen == nullptr) {
|
||||
screen = QApplication::screens().constFirst();
|
||||
}
|
||||
|
||||
int heightDesktopResolution = screen != nullptr ? screen->size().height() : 600;
|
||||
int widthDesktopResolution = screen != nullptr ? screen->size().height() : 1024;
|
||||
int height, width;
|
||||
height = static_cast<int>(heightDesktopResolution * 0.84);
|
||||
width = static_cast<int>(height * 0.70);
|
||||
|
@ -9,10 +9,15 @@ PageLabelWidget::PageLabelWidget(QWidget *parent)
|
||||
animation->setDuration(150);
|
||||
animation->setEndValue(QPoint((parent->geometry().size().width() - this->width()), -this->height()));
|
||||
|
||||
int verticalRes = QApplication::desktop()->screenGeometry().height();
|
||||
QScreen *screen = parent != nullptr ? parent->window()->screen() : nullptr;
|
||||
if (screen == nullptr) {
|
||||
screen = QApplication::screens().constFirst();
|
||||
}
|
||||
|
||||
int verticalRes = screen != nullptr ? screen->size().height() : 600;
|
||||
|
||||
auto layout = new QHBoxLayout;
|
||||
layout->setMargin(0);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QSize labelSize;
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <QFile>
|
||||
#include <QTextStream>
|
||||
#include <QTextCodec>
|
||||
#include <QDesktopWidget>
|
||||
#include <QScreen>
|
||||
|
||||
#include "yacreader_global.h"
|
||||
|
||||
@ -31,7 +31,15 @@ HelpAboutDialog::HelpAboutDialog(QWidget *parent)
|
||||
layout->setContentsMargins(1, 3, 1, 1);
|
||||
|
||||
setLayout(layout);
|
||||
resize(500, QApplication::desktop()->availableGeometry().height() * 0.83);
|
||||
|
||||
QScreen *screen = parent != nullptr ? parent->window()->screen() : nullptr;
|
||||
if (screen == nullptr) {
|
||||
screen = QApplication::screens().constFirst();
|
||||
}
|
||||
|
||||
int heightDesktopResolution = screen != nullptr ? screen->size().height() : 600;
|
||||
|
||||
resize(500, heightDesktopResolution * 0.83);
|
||||
}
|
||||
|
||||
HelpAboutDialog::~HelpAboutDialog()
|
||||
|
Loading…
Reference in New Issue
Block a user