mirror of
https://github.com/DreamSourceLab/DSView.git
synced 2025-01-23 13:42:55 +08:00
fix: When the display scale is 150%,window can't be maximized
This commit is contained in:
parent
8dc9c4a6d7
commit
14e1753879
@ -179,8 +179,8 @@ void DecoderOptionsDlg::load_options(view::DecodeTrace *trace)
|
||||
|
||||
double sk = QGuiApplication::primaryScreen()->devicePixelRatio();
|
||||
int srcHeight = QGuiApplication::primaryScreen()->availableSize().height();
|
||||
if (srcHeight > 700)
|
||||
srcHeight = 700;
|
||||
if (srcHeight > 600)
|
||||
srcHeight = 600;
|
||||
|
||||
if (h * sk > srcHeight)
|
||||
{
|
||||
|
@ -93,6 +93,7 @@ DeviceOptions::DeviceOptions(QWidget *parent, DevInst *dev_inst) :
|
||||
|
||||
_mode_check.setInterval(100);
|
||||
_mode_check.start();
|
||||
|
||||
}
|
||||
|
||||
DeviceOptions::~DeviceOptions(){
|
||||
|
@ -206,7 +206,18 @@ void MainFrame::showNormal()
|
||||
void MainFrame::showMaximized()
|
||||
{
|
||||
hide_border();
|
||||
QFrame::showMaximized();
|
||||
|
||||
#ifdef _WIN32
|
||||
double sk = QGuiApplication::primaryScreen()->devicePixelRatio();
|
||||
if (sk >= 1.5)
|
||||
{
|
||||
auto rect = QGuiApplication::primaryScreen()->availableGeometry();
|
||||
this->move(rect.left(), rect.top());
|
||||
this->resize(rect.width(), rect.height());
|
||||
}
|
||||
#endif
|
||||
|
||||
QFrame::showMaximized();
|
||||
}
|
||||
|
||||
void MainFrame::showMinimized()
|
||||
@ -426,6 +437,7 @@ void MainFrame::readSettings()
|
||||
|
||||
bool bReset = false;
|
||||
|
||||
//size from config is error
|
||||
if (right == 0)
|
||||
{
|
||||
bReset = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user