Fix incomplete display of the system monitor when the resolution is 1020 * 768

This commit is contained in:
yangxianzhao 2023-12-12 16:04:50 +08:00
parent 1f164e0181
commit 024e6bb0cd
2 changed files with 89 additions and 2 deletions

View File

@ -0,0 +1,82 @@
From ac2a4290f9f52e0de8594c3441d7b04eb7607021 Mon Sep 17 00:00:00 2001
From: yangxianzhao <yangxianzhao@uniontech.com>
Date: Tue, 12 Dec 2023 15:59:49 +0800
Subject: [PATCH] Fix incomplete display of the system monitor when the
resolution is 1024 * 768
---
src/CMakeLists.txt | 1 +
src/constant.h | 27 +++++++++++++++++++++++++++
src/main.cpp | 3 ++-
3 files changed, 30 insertions(+), 1 deletion(-)
create mode 100644 src/constant.h
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5a77ebd..62de410 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -66,6 +66,7 @@ set(HPP_GLOBAL
compact_disk_monitor.h
smooth_curve_generator.h
settings.h
+ constant.h
)
set(CPP_GLOBAL
main.cpp
diff --git a/src/constant.h b/src/constant.h
new file mode 100644
index 0000000..3764418
--- /dev/null
+++ b/src/constant.h
@@ -0,0 +1,27 @@
+/*
+* Copyright (C) 2011 ~ 2020 Uniontech Software Technology Co.,Ltd
+*
+* Author: Wang Yong <wangyong@deepin.com>
+* Maintainer: maojj <maojunjie@uniontech.com>
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 3 of the License, or
+* any later version.
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#ifndef CONSTANT_H
+#define CONSTANT_H
+
+namespace Constant {
+const int WINDOW_MIN_WIDTH = 900;
+const int WINDOW_MIN_HEIGHT = 750;
+}; // namespace Constant
+
+#endif
diff --git a/src/main.cpp b/src/main.cpp
index fa078bf..c27f162 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -23,6 +23,7 @@
#include "settings.h"
#include "gui/main_window.h"
#include "common/perf.h"
+#include "constant.h"
#include "../3rdparty/dmidecode/dmidecode.h"
#include <DApplication>
@@ -96,7 +97,7 @@ int main(int argc, char *argv[])
&DApplication::newInstanceStarted,
&mw,
&MainWindow::activateWindow);
-
+ mw.setMinimumSize(QSize(Constant::WINDOW_MIN_WIDTH, Constant::WINDOW_MIN_HEIGHT));
Dtk::Widget::moveToCenter(&mw);
mw.show();
--
2.31.1

View File

@ -2,12 +2,14 @@
Name: deepin-system-monitor
Version: 5.8.27
Release: 2
Release: 3
Summary: A more user-friendly system monitor
License: GPLv3
URL: https://github.com/linuxdeepin/deepin-system-monitor
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Patch0: 0001-Fix-incomplete-display-of-the-system-monitor-when-the-resolution-is-1024X768.patch
BuildRequires: qt5-devel
BuildRequires: cmake
@ -49,7 +51,7 @@ Recommends: deepin-manual
%{summary}.
%prep
%autosetup
%autosetup -p1
# %setup -q
####sed -i 's|lrelease|lrelease-qt5|' translations/translate_generation.sh
@ -95,6 +97,9 @@ fi
%{_datadir}/deepin-manual/manual-assets/application/deepin-system-monitor/system-monitor/*
%changelog
* Tue Dec 12 2023 yangxianzhao <yangxianzhao@uniontech.com> - 5.8.27-3
- Fix incomplete display of the system monitor when the resolution is 1024 * 768
* Fri Nov 17 2023 hanshuang <hanshuang@uniontech.com> - 5.8.27-2
- modify version info