!25 将时区界面内世界地图尺寸改为根据分辨率自动缩放,以免显示不全

Merge pull request !25 from 杨东海/openkylin/yangtze:将时区界面内世界地图尺寸改为根据分辨率自动缩放,以免显示不全
This commit is contained in:
liushanwen 2023-07-21 09:52:41 +00:00 committed by Gitee
commit b68f98ab30
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 25 additions and 0 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
kylin-os-installer (0.2.1-0k21) yangtze; urgency=medium
*openKylin 1.0版本时区界面内世界地图尺寸改为根据分辨率自动缩放,以免显示不全
-- yangdonghai <yangdonghai@kylinos.cn> Fri, 21 Jul 2023 17:29:16 +0800
kylin-os-installer (0.2.1-0k20ubuntu1) yangtze; urgency=medium
* openKylin 1.0版本,解决低分辨率下用户设置界面显示不全问题

View File

@ -7,6 +7,8 @@
#include <QEvent>
#include <QDebug>
#include <QPicture>
#include <QGuiApplication>
#include <QScreen>
#ifndef M_PI
#define M_PI 3.14159265358979323846
@ -14,7 +16,24 @@
MapWidget::MapWidget(QWidget *parent) : QWidget(parent)
{
this->setObjectName("MapWidget");
m_backgroundImage = QImage(":/res/png/bg.jpg");
//当显示器分辨率太小时,就缩小世界地图
QScreen* NowScreen=QGuiApplication::primaryScreen();
int SCreenHeight=NowScreen->size().height();
int SCreenWidth=NowScreen->size().width();
if(1024 > SCreenWidth)
{
if(600 < SCreenWidth)
{
m_backgroundImage = m_backgroundImage.scaled(m_backgroundImage.width()*0.6, m_backgroundImage.height()*0.6, Qt::KeepAspectRatio);
}
else
{
m_backgroundImage = m_backgroundImage.scaled(m_backgroundImage.width()*0.3, m_backgroundImage.height()*0.3, Qt::KeepAspectRatio);
}
}
m_pointpng = QImage(":/res/png/point.png");
this->setMinimumSize(m_backgroundImage.size());
this->setMaximumSize(m_backgroundImage.size());