同步补丁修复:
close-cd#124499:侧边栏问题 close-cd#126286:打开系统监视器点击菜单-关于,关闭界面后左侧菜单栏出现红色的背景 close-cd#125383:侧边栏-未即时响应高亮色切换 close-cd#125473:用户手册内图片与实际界面不一致,无新增的服务模块 close-cd#109620:系统监视器排序问题
Before Width: | Height: | Size: 91 KiB After Width: | Height: | Size: 139 KiB |
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 90 KiB After Width: | Height: | Size: 134 KiB |
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 9.8 KiB |
|
@ -6,7 +6,7 @@
|
|||
<description>Control the menu of all components</description>
|
||||
</key>
|
||||
<key type="i" name="support-service">
|
||||
<default>0</default>
|
||||
<default>1</default>
|
||||
<summary>Control is support service list</summary>
|
||||
<description>Control is support service list</description>
|
||||
</key>
|
||||
|
|
|
@ -1,5 +1,15 @@
|
|||
ukui-system-monitor (3.14.0.0-ok2) yangtze; urgency=medium
|
||||
|
||||
* close-cd#124499:侧边栏问题
|
||||
close-cd#126286:打开系统监视器点击菜单-关于,关闭界面后左侧菜单栏出现红色的背景
|
||||
close-cd#125383:侧边栏-未即时响应高亮色切换
|
||||
close-cd#125473:用户手册内图片与实际界面不一致,无新增的服务模块
|
||||
close-cd#109620:系统监视器排序问题
|
||||
|
||||
-- F_Chao <fengchao@kylinos.cn> Fri, 08 Jul 2022 09:49:25 +0800
|
||||
|
||||
ukui-system-monitor (3.14.0.0-ok1) yangtze; urgency=medium
|
||||
|
||||
* Initial for openKylin.
|
||||
|
||||
-- Xie Wei <xiewei@kylinos.cn> Fri, 20 May 2022 16:42:04 +0800
|
||||
-- Xie Wei <xiewei@kylinos.cn> Fri, 20 May 2022 16:42:04 +0800
|
||||
|
|
|
@ -75,19 +75,44 @@ void KLeftSideItem::initUI()
|
|||
initStyleTheme();
|
||||
setIcon(m_strIcon);
|
||||
|
||||
connect(this, &QPushButton::toggled, this, [=](bool checked) {
|
||||
if (checked) {
|
||||
setStyleSheet("QPushButton:checked{background-color: palette(highlight);border-radius: 6px;}");
|
||||
m_labelText->setStyleSheet("color:white");
|
||||
m_isNormal = false;
|
||||
} else {
|
||||
m_labelText->setStyleSheet("color:palette(windowText)");
|
||||
if (!m_isHover) {
|
||||
m_isNormal = true;
|
||||
}
|
||||
}
|
||||
setIcon(m_strIcon);
|
||||
});
|
||||
|
||||
if (QGSettings::isSchemaInstalled("org.ukui.style")) {
|
||||
QGSettings *qtSettings = new QGSettings("org.ukui.style", QByteArray(), this);
|
||||
if (qtSettings->keys().contains("styleName")) {
|
||||
hoverColor = btnHoverColor(qtSettings->get("style-name").toString(), true);
|
||||
clickColor = btnHoverColor(qtSettings->get("style-name").toString(), false);
|
||||
this->setStyleSheet(QString("KLeftSideItem:hover{background-color:%1;border-radius: 6px;}"
|
||||
"KLeftSideItem:pressed{background-color:%2;border-radius: 6px;}").arg(hoverColor).arg(clickColor));
|
||||
|
||||
connect(qtSettings, &QGSettings::changed, this, [=](const QString &key) {
|
||||
if (key == "styleName") {
|
||||
hoverColor = this->btnHoverColor(qtSettings->get("style-name").toString(), true);
|
||||
clickColor = btnHoverColor(qtSettings->get("style-name").toString(), false);
|
||||
if (!this->isChecked())
|
||||
this->setStyleSheet(QString("KLeftSideItem:hover{background-color:%1;border-radius: 6px;}"
|
||||
"KLeftSideItem:pressed{background-color:%2;border-radius: 6px;}").arg(hoverColor).arg(clickColor));
|
||||
} else if (key == "themeColor" && this->isChecked()) {
|
||||
this->toggled(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
connect(this, &QPushButton::toggled, this, [=](bool checked) {
|
||||
if (checked) {
|
||||
this->setStyleSheet("KLeftSideItem:checked{background-color: palette(highlight);border-radius: 6px;}");
|
||||
m_labelText->setStyleSheet("color: white");
|
||||
m_isNormal = false;
|
||||
} else {
|
||||
this->setStyleSheet(QString("KLeftSideItem:hover{background-color:%1;border-radius: 6px;}"
|
||||
"KLeftSideItem:pressed{background-color:%2;border-radius: 6px;}").arg(hoverColor).arg(clickColor));
|
||||
if (!m_isHover) {
|
||||
m_isNormal = true;
|
||||
}
|
||||
m_labelText->setStyleSheet("color: palette(windowtext)");
|
||||
}
|
||||
setIcon(m_strIcon);
|
||||
});
|
||||
}
|
||||
|
||||
void KLeftSideItem::initStyleTheme()
|
||||
|
@ -182,3 +207,30 @@ bool KLeftSideItem::eventFilter(QObject *obj, QEvent *event)
|
|||
}
|
||||
return QPushButton::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
QString KLeftSideItem::btnHoverColor(QString styleName, bool hoverFlag)
|
||||
{
|
||||
QColor color1 = palette().color(QPalette::Active, QPalette::Button);
|
||||
QColor color2 = palette().color(QPalette::Active, QPalette::BrightText);
|
||||
QColor color;
|
||||
qreal r,g,b,a;
|
||||
QString hoverColor;
|
||||
if (((styleName.contains("dark") || styleName.contains("black")) && hoverFlag) ||
|
||||
((!styleName.contains("dark") && !styleName.contains("black")) && !hoverFlag)) {
|
||||
r = color1.redF() * 0.8 + color2.redF() * 0.2;
|
||||
g = color1.greenF() * 0.8 + color2.greenF() * 0.2;
|
||||
b = color1.blueF() * 0.8 + color2.blueF() * 0.2;
|
||||
a = color1.alphaF() * 0.8 + color2.alphaF() * 0.2;
|
||||
} else {
|
||||
r = color1.redF() * 0.95 + color2.redF() * 0.05;
|
||||
g = color1.greenF() * 0.95 + color2.greenF() * 0.05;
|
||||
b = color1.blueF() * 0.95 + color2.blueF() * 0.05;
|
||||
a = color1.alphaF() * 0.95 + color2.alphaF() * 0.05;
|
||||
}
|
||||
color = QColor::fromRgbF(r, g, b, a);
|
||||
hoverColor = QString("rgba(%1, %2, %3, %4)").arg(color.red())
|
||||
.arg(color.green())
|
||||
.arg(color.blue())
|
||||
.arg(color.alpha());
|
||||
return hoverColor;
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ public:
|
|||
void initUI();
|
||||
void setText(QString &strText);
|
||||
void setIcon(QString &strIcon);
|
||||
QString btnHoverColor(QString styleName, bool hoverFlag);
|
||||
|
||||
protected:
|
||||
bool eventFilter(QObject *obj, QEvent *event) override; //事件过滤
|
||||
|
@ -55,6 +56,8 @@ private:
|
|||
QString m_strThemeName = "";
|
||||
bool m_isNormal = true;
|
||||
bool m_isHover = false;
|
||||
QString hoverColor;
|
||||
QString clickColor;
|
||||
};
|
||||
|
||||
#endif // KLEFTSIDEITEM_H
|
||||
|
|
|
@ -35,6 +35,10 @@
|
|||
#include <glibtop/mem.h>
|
||||
#include <glibtop/swap.h>
|
||||
|
||||
#define PERSONALSIE_SCHEMA "org.ukui.control-center.personalise"
|
||||
#define PERSONALSIE_TRAN_KEY "transparency"
|
||||
#define CONTAIN_PERSONALSIE_TRAN_KEY "transparency"
|
||||
|
||||
static unsigned long long getCpuTimeData(unsigned long long &workTime)
|
||||
{
|
||||
FILE *file = fopen("/proc/stat", "r");
|
||||
|
@ -134,8 +138,21 @@ KLeftWidget::KLeftWidget(QWidget *parent)
|
|||
{
|
||||
this->setFixedWidth(LEFT_WIDGET_WIDTH);
|
||||
this->setMinimumHeight(LEFT_WIDGET_HEIGHT);
|
||||
this->setAttribute(Qt::WA_TranslucentBackground);
|
||||
this->installEventFilter(this);
|
||||
QGSettings *personalQgsettings = nullptr;
|
||||
if (QGSettings::isSchemaInstalled(PERSONALSIE_SCHEMA)) {
|
||||
personalQgsettings = new QGSettings(PERSONALSIE_SCHEMA, QByteArray(), this);
|
||||
transparency = personalQgsettings->get(PERSONALSIE_TRAN_KEY).toDouble() * 255;
|
||||
connect(personalQgsettings,&QGSettings::changed,this,[=](QString changedKey) { //监听透明度变化
|
||||
if (changedKey == CONTAIN_PERSONALSIE_TRAN_KEY) {
|
||||
transparency = personalQgsettings->get(PERSONALSIE_TRAN_KEY).toDouble() * 255;
|
||||
this->repaint();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
personalQgsettings = nullptr;
|
||||
qDebug()<<PERSONALSIE_SCHEMA<<" not installed";
|
||||
}
|
||||
initUI();
|
||||
initConnections();
|
||||
}
|
||||
|
@ -204,7 +221,7 @@ void KLeftWidget::initUI()
|
|||
m_scrollOptions->verticalScrollBar()->setContextMenuPolicy(Qt::NoContextMenu);
|
||||
|
||||
m_itemsLayout->setContentsMargins(10,16,10,16);
|
||||
m_itemsLayout->setSpacing(4);
|
||||
// m_itemsLayout->setSpacing(4);
|
||||
m_itemsLayout->setAlignment(Qt::AlignTop);
|
||||
m_buttonGroup = new QButtonGroup(this);
|
||||
m_buttonGroup->setExclusive(true);
|
||||
|
@ -362,3 +379,22 @@ bool KLeftWidget::getSwaponData(unsigned long long &swapSize, unsigned long long
|
|||
}
|
||||
return bSucessed;
|
||||
}
|
||||
|
||||
void KLeftWidget::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QStyleOption opt;
|
||||
opt.init(this);
|
||||
QPainter p(this);
|
||||
p.setPen(Qt::NoPen);
|
||||
QColor color = palette().color(QPalette::Base);
|
||||
// QColor color = palette().color(QPalette::Window);
|
||||
color.setAlpha(transparency);
|
||||
QPalette pal(this->palette());
|
||||
pal.setColor(QPalette::Window,QColor(color));
|
||||
this->setPalette(pal);
|
||||
QBrush brush =QBrush(color);
|
||||
p.setBrush(brush);
|
||||
p.drawRoundedRect(opt.rect,0,0);
|
||||
style()->drawPrimitive(QStyle::PE_Widget, &opt, &p, this);
|
||||
}
|
||||
|
||||
|
|
|
@ -61,6 +61,7 @@ signals:
|
|||
void onUpdateNetStatus(qreal sendTotalBytes, qreal sendRate, qreal recvTotalBytes, qreal recvRate);
|
||||
|
||||
private:
|
||||
void paintEvent(QPaintEvent *e);
|
||||
void initThemeMode();
|
||||
bool getSwaponData(unsigned long long &swapSize, unsigned long long &swapUsed);
|
||||
|
||||
|
@ -94,6 +95,7 @@ private:
|
|||
unsigned long long int m_totalSentBytes = 0;
|
||||
unsigned long long int m_rateRecvBytes = 0;
|
||||
unsigned long long int m_rateSentBytes = 0;
|
||||
int transparency = 0;
|
||||
};
|
||||
|
||||
#endif // KLEFTWIDGET_H
|
||||
|
|
|
@ -28,6 +28,8 @@
|
|||
#include <QKeyEvent>
|
||||
#include <QDebug>
|
||||
|
||||
QString KRightWidget::searchText = "";
|
||||
|
||||
KRightWidget::KRightWidget(QWidget *parent)
|
||||
: QWidget(parent)
|
||||
{
|
||||
|
@ -423,6 +425,7 @@ void KRightWidget::onRefreshSearchResult()
|
|||
void KRightWidget::handleSearchTextChanged()
|
||||
{
|
||||
m_searchTextCache = m_searchEditNew->text();
|
||||
KRightWidget::searchText = m_searchEditNew->text();
|
||||
if (m_searchTextCache.isEmpty()) {
|
||||
m_isSearching = false;
|
||||
} else {
|
||||
|
|
|
@ -99,6 +99,9 @@ private:
|
|||
bool m_isSearching = false;
|
||||
|
||||
QGSettings *m_styleSettings = nullptr;
|
||||
|
||||
public:
|
||||
static QString searchText;
|
||||
};
|
||||
|
||||
#endif // KRIGHTWIDGET_H
|
||||
|
|
|
@ -242,24 +242,6 @@ bool MainWindow::eventFilter(QObject *watched, QEvent *event)
|
|||
return QFrame::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
void MainWindow::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
QPainterPath path;
|
||||
|
||||
QPainter painter(this);
|
||||
painter.setOpacity(m_curTransOpacity);
|
||||
painter.setRenderHint(QPainter::Antialiasing); // 反锯齿;
|
||||
painter.setClipping(true);
|
||||
painter.setPen(Qt::transparent);
|
||||
|
||||
path.addRoundedRect(this->rect(), 6, 6);
|
||||
path.setFillRule(Qt::WindingFill);
|
||||
painter.setBrush(this->palette().window());
|
||||
painter.setPen(Qt::transparent);
|
||||
|
||||
painter.drawPath(path);
|
||||
QWidget::paintEvent(event);
|
||||
}
|
||||
|
||||
void MainWindow::keyPressEvent(QKeyEvent *event)
|
||||
{
|
||||
|
|
|
@ -39,7 +39,6 @@ public slots:
|
|||
signals:
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
|
||||
void closeEvent(QCloseEvent *event) Q_DECL_OVERRIDE;
|
||||
void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
|
||||
void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
|
||||
|
|
|
@ -104,8 +104,10 @@ bool ProcessSortFilterProxyModel::filterAcceptsRow(int row, const QModelIndex &p
|
|||
}
|
||||
|
||||
// compare two items with the specified index
|
||||
bool ProcessSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
|
||||
bool ProcessSortFilterProxyModel::lessThan(const QModelIndex &m_left, const QModelIndex &m_right) const
|
||||
{
|
||||
const QModelIndex &right = m_left;
|
||||
const QModelIndex &left = m_right;
|
||||
int sortcolumn = sortColumn();
|
||||
switch (sortcolumn) {
|
||||
case ProcessTableModel::ProcessNameColumn: {
|
||||
|
|
|
@ -76,8 +76,10 @@ bool ServiceSortFilterProxyModel::filterAcceptsRow(int row, const QModelIndex &p
|
|||
}
|
||||
|
||||
// 比较指定索引的两条记录
|
||||
bool ServiceSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
|
||||
bool ServiceSortFilterProxyModel::lessThan(const QModelIndex &m_left, const QModelIndex &m_right) const
|
||||
{
|
||||
const QModelIndex &left = m_right;
|
||||
const QModelIndex &right = m_left;
|
||||
switch (sortColumn()) {
|
||||
case ServiceTableModel::ServiceMainPIDColumn:
|
||||
return left.data().toUInt() < right.data().toUInt();
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "../util.h"
|
||||
#include "systemd1serviceinterface.h"
|
||||
#include "../dialog/customservicenamedlg.h"
|
||||
#include "../krightwidget.h"
|
||||
|
||||
#include <QApplication>
|
||||
#include <QDialog>
|
||||
|
@ -619,7 +620,7 @@ void ServiceTableView::adjustInfoLabelVisibility(bool force)
|
|||
setUpdatesEnabled(false);
|
||||
// 当模型索引行为空时显示没有搜索结果
|
||||
m_notFoundLabel->setVisible(m_proxyModel->rowCount() == 0);
|
||||
if (force) {
|
||||
if (force || KRightWidget::searchText.isEmpty()) {
|
||||
m_notFoundLabel->setVisible(false);
|
||||
}
|
||||
// 调整提示信息到界面中央
|
||||
|
|