Compare commits

...

2 Commits

Author SHA1 Message Date
3101f1fe70 Restore Patches 2020-12-17 00:18:10 +08:00
58f32c119a Bump version to 3.0 2020-12-16 23:49:54 +08:00
3 changed files with 32 additions and 21 deletions

View File

@@ -29,13 +29,13 @@ downloadlist::downloadlist(QWidget *parent) :
connect(action_gdebi,&QAction::triggered,[=](){downloadlist::install(2);}); connect(action_gdebi,&QAction::triggered,[=](){downloadlist::install(2);});
//ssinstall命令存在时再加入该选项 //ssinstall命令存在时再加入该选项
QFile ssinstall("/bin/ssinstall"); QFile ssinstall("/usr/local/bin/ssinstall");
ssinstall.open(QIODevice::ReadOnly); ssinstall.open(QIODevice::ReadOnly);
if(ssinstall.isOpen()){ if(ssinstall.isOpen()){
menu_install->addAction(action_dpkg); menu_install->addAction(action_dpkg);
} }
QFile deepin("/bin/deepin-deb-installer"); QFile deepin("/usr/bin/deepin-deb-installer");
deepin.open(QIODevice::ReadOnly); deepin.open(QIODevice::ReadOnly);
if(deepin.isOpen()){ if(deepin.isOpen()){
menu_install->addAction(action_deepin); menu_install->addAction(action_deepin);

View File

@@ -1,16 +1,19 @@
#include "image_show.h" #include "image_show.h"
#include <QScreen> // Qt5 不再建议使用 QDesktopWidget
#include <QHBoxLayout> #include <QHBoxLayout>
#include <QDebug>
#include <QPainter> #include <QPainter>
#include <DDialog> #include <DDialog>
#include <DBlurEffectWidget> #include <DBlurEffectWidget>
#include <DWidgetUtil> #include <DWidgetUtil>
#include <DApplication> #include <DApplication>
#include <QDesktopWidget>
DWIDGET_USE_NAMESPACE DWIDGET_USE_NAMESPACE
image_show::image_show(QWidget *parent) : QWidget(parent) image_show::image_show(QWidget *parent) : QWidget(parent)
{ {
QHBoxLayout *layout=new QHBoxLayout; QHBoxLayout *layout = new QHBoxLayout;
layout->addWidget(m_label); layout->addWidget(m_label);
setLayout(layout); setLayout(layout);
m_label->setText("layout"); m_label->setText("layout");
@@ -19,17 +22,23 @@ image_show::image_show(QWidget *parent) : QWidget(parent)
void image_show::setImage(QPixmap image) void image_show::setImage(QPixmap image)
{ {
QImage screen0; QImage screen0;
screen0=image.toImage(); screen0 = image.toImage();
// QPainter painter(&screen0); // QPainter painter(&screen0);
QImage re_screen1; QImage re_screen1;
QImage re_screen0=screen0.scaled(QSize(400,300),Qt::KeepAspectRatio,Qt::SmoothTransformation); QImage re_screen0 = screen0.scaled(QSize(400, 300), Qt::KeepAspectRatio, Qt::SmoothTransformation);
desktop_w=DApplication::desktop()->width();
desktop_h=DApplication::desktop()->height(); // 获取主屏幕尺寸
if(screen0.width()>(desktop_w-20) || screen0.height()>(desktop_h-20)){ desktop_w = DApplication::primaryScreen()->geometry().width();
re_screen1=screen0.scaled(QSize(desktop_w-20,desktop_h-20),Qt::KeepAspectRatio,Qt::SmoothTransformation); desktop_h = DApplication::primaryScreen()->geometry().height();
m_image=QPixmap::fromImage(re_screen1);
}else { if(screen0.width() > (desktop_w - 20) || screen0.height() > (desktop_h - 20))
m_image=image; {
re_screen1 = screen0.scaled(QSize(desktop_w - 20, desktop_h - 20), Qt::KeepAspectRatio, Qt::SmoothTransformation);
m_image = QPixmap::fromImage(re_screen1);
}
else
{
m_image = image;
} }
m_label->setPixmap(QPixmap::fromImage(re_screen0)); m_label->setPixmap(QPixmap::fromImage(re_screen0));
@@ -39,8 +48,10 @@ void image_show::mousePressEvent(QMouseEvent *)
{ {
m_dialog->setimage(m_image); m_dialog->setimage(m_image);
m_dialog->showFullScreen(); m_dialog->showFullScreen();
m_dialog->setFixedSize(desktop_w,desktop_h);
m_dialog->move(0,0);/*
moveToCenter(m_dialog);*/
// 识别主屏幕尺寸并设置 widget 大小
m_dialog->setFixedSize(desktop_w, desktop_h);
m_dialog->move(0,0);
// moveToCenter(m_dialog);
} }

View File

@@ -41,7 +41,7 @@ int main(int argc, char *argv[])
a.setOrganizationName("spark-union"); a.setOrganizationName("spark-union");
a.setOrganizationDomain("https://www.deepinos.org/"); a.setOrganizationDomain("https://www.deepinos.org/");
a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文 a.setApplicationName("Spark Store"); //不需要翻译,否则 ~/.local/share/ 下文件夹名称也被翻译为中文
a.setApplicationVersion(DApplication::buildVersion("3.0~alpha2")); a.setApplicationVersion(DApplication::buildVersion("3.0"));
a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store"); a.setApplicationAcknowledgementPage("https://gitee.com/deepin-community-store/spark-store");
a.setApplicationDescription( a.setApplicationDescription(
QObject::tr( QObject::tr(