fix: When the display scale is 150%,window can't be maximized

This commit is contained in:
dreamsourcelabTAI 2022-06-02 17:56:28 +08:00
parent 8dc9c4a6d7
commit 14e1753879
3 changed files with 16 additions and 3 deletions

View File

@ -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)
{

View File

@ -93,6 +93,7 @@ DeviceOptions::DeviceOptions(QWidget *parent, DevInst *dev_inst) :
_mode_check.setInterval(100);
_mode_check.start();
}
DeviceOptions::~DeviceOptions(){

View File

@ -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;