!25 将时区界面内世界地图尺寸改为根据分辨率自动缩放,以免显示不全
Merge pull request !25 from 杨东海/openkylin/yangtze:将时区界面内世界地图尺寸改为根据分辨率自动缩放,以免显示不全
This commit is contained in:
commit
b68f98ab30
|
@ -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版本,解决低分辨率下用户设置界面显示不全问题
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in New Issue