From 1b307497a2450bbefb979472de873b507bdc2e5e Mon Sep 17 00:00:00 2001 From: lixueman Date: Wed, 12 Oct 2022 11:03:51 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E9=98=B4=E5=BD=B1=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserInterface/Widget/main_view_widget.cpp | 15 ++---------- src/UserInterface/mainwindow.cpp | 24 +++++++++---------- 2 files changed, 13 insertions(+), 26 deletions(-) diff --git a/src/UserInterface/Widget/main_view_widget.cpp b/src/UserInterface/Widget/main_view_widget.cpp index c459745..c53fc53 100755 --- a/src/UserInterface/Widget/main_view_widget.cpp +++ b/src/UserInterface/Widget/main_view_widget.cpp @@ -54,23 +54,12 @@ void MainViewWidget::styleChangeSlot(const QString &style) void MainViewWidget::paintEvent(QPaintEvent *event) { -// double transparency = getTransparency(); - QRect rect = this->rect(); + QRect rect = this->rect().adjusted(5, 5, 0, -5); QPainterPath path; QPainter painter(this); + path.addRoundedRect(rect, 10, 10); painter.setRenderHint(QPainter::Antialiasing); // 反锯齿; painter.setPen(Qt::transparent); - qreal radius = 10; - path.moveTo(rect.topRight() - QPointF(radius, 0)); - path.lineTo(rect.topLeft() + QPointF(radius, 0)); - path.quadTo(rect.topLeft(), rect.topLeft() + QPointF(0, radius)); - path.lineTo(rect.bottomLeft() + QPointF(0, -radius)); - path.quadTo(rect.bottomLeft(), rect.bottomLeft() + QPointF(radius, 0)); - path.lineTo(rect.bottomRight() - QPointF(radius, 0)); - path.quadTo(rect.bottomRight(), rect.bottomRight() + QPointF(0, -radius)); - path.lineTo(rect.topRight() + QPointF(0, radius)); - path.quadTo(rect.topRight(), rect.topRight() + QPointF(-radius, -0)); - painter.setPen(Qt::transparent); painter.setOpacity(0.58); painter.fillPath(path, m_backColor); QWidget::paintEvent(event); diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index 53451fd..bd977a5 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -674,28 +674,26 @@ void MainWindow::paintEvent(QPaintEvent *event) if ( transparency == 1) { curColor.setAlpha(255); } - QRect rect = this->rect(); + QRect rect = this->rect().adjusted(5, 5, -5, -5); QPainterPath path; - // rect.setTopLeft(QPoint(rect.x()+320,rect.y())); QPainter painter(this); painter.setRenderHint(QPainter::Antialiasing); // 反锯齿; + painter.save(); painter.setPen(Qt::transparent); - qreal radius = 10; - path.moveTo(rect.topRight() - QPointF(radius, 0)); - path.lineTo(rect.topLeft() + QPointF(radius, 0)); - path.quadTo(rect.topLeft(), rect.topLeft() + QPointF(0, radius)); - path.lineTo(rect.bottomLeft() + QPointF(0, -radius)); - path.quadTo(rect.bottomLeft(), rect.bottomLeft() + QPointF(radius, 0)); - path.lineTo(rect.bottomRight() - QPointF(radius, 0)); - path.quadTo(rect.bottomRight(), rect.bottomRight() + QPointF(0, -radius)); - path.lineTo(rect.topRight() + QPointF(0, radius)); - path.quadTo(rect.topRight(), rect.topRight() + QPointF(-radius, -0)); + path.addRoundedRect(rect, 10, 10); painter.setBrush(curColor); painter.setPen(Qt::transparent); painter.setOpacity(transparency); painter.drawPath(path); KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon())); - QMainWindow::paintEvent(event); + QColor color = Qt::black; + for (int i = 0; i < 6; i++) { + rect = this->rect().adjusted(i, i, - i, - i); + color.setAlpha(i * 6); + painter.setBrush(Qt::NoBrush); + painter.setPen(QPen(color, 1)); + painter.drawRoundedRect(rect, 10, 10); + } } /** * 鼠标点击窗口外部事件 From bbe642c6857787fab33869025b1befaced417aac Mon Sep 17 00:00:00 2001 From: lixueman Date: Wed, 12 Oct 2022 11:21:02 +0800 Subject: [PATCH 2/6] update changelog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index 9b10f8a..fcbc26d 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ukui-menu (3.1.1-ok4~1012) yangtze; urgency=medium + + * close-cd #116176 【设计】【开始菜单】【浅色模式】底板缺少描边及阴影 + + -- lixueman Wed, 12 Oct 2022 11:14:50 +0800 + ukui-menu (3.1.1-ok4~0920) yangtze; urgency=medium * 任务:开始菜单工具提示内容优化(收藏&最近 区域),增加路径提示 From 81ee93a7e6fc0092d49ea7db0c4f1c2694e89fd4 Mon Sep 17 00:00:00 2001 From: lixueman Date: Wed, 12 Oct 2022 11:46:44 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E9=98=B4=E5=BD=B1=E4=B8=8D=E5=8F=97?= =?UTF-8?q?=E7=AA=97=E4=BD=93=E9=80=8F=E6=98=8E=E5=BA=A6=E5=BD=B1=E5=93=8D?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E9=87=8D=E5=8F=A0=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E6=8F=8F=E8=BE=B9=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserInterface/mainwindow.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index bd977a5..3db9b42 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -685,15 +685,19 @@ void MainWindow::paintEvent(QPaintEvent *event) painter.setPen(Qt::transparent); painter.setOpacity(transparency); painter.drawPath(path); + painter.restore(); KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon())); QColor color = Qt::black; - for (int i = 0; i < 6; i++) { + painter.save(); + for (int i = 0; i < 7; i++) { rect = this->rect().adjusted(i, i, - i, - i); color.setAlpha(i * 6); painter.setBrush(Qt::NoBrush); painter.setPen(QPen(color, 1)); painter.drawRoundedRect(rect, 10, 10); } + painter.restore(); + QMainWindow::paintEvent(event); } /** * 鼠标点击窗口外部事件 From 0f356b2d3cd6a8e64c526fd2322976a46a041bfc Mon Sep 17 00:00:00 2001 From: lixueman Date: Wed, 12 Oct 2022 15:07:53 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=98=B4=E5=BD=B1=E5=90=8E=E5=8A=A8=E7=94=BB=E8=BF=87=E6=B8=A1?= =?UTF-8?q?=E9=A1=B5=E5=A4=A7=E5=B0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserInterface/mainwindow.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/UserInterface/mainwindow.cpp b/src/UserInterface/mainwindow.cpp index 3db9b42..0c07b15 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -1278,7 +1278,7 @@ void MainWindow::on_minMaxChangeButton_clicked() m_maxAnimation->setDuration(1); } else { m_animationPage->show(); - m_animationPage->setGeometry(this->x(), this->y(), Style::m_minw, Style::m_minh); + m_animationPage->setGeometry(this->x() + 5, this->y() + 5, Style::m_minw - 10, Style::m_minh - 10); m_animationPage->raise(); m_animationPage->repaint(); m_maxAnimation->setDuration(260); @@ -1289,7 +1289,7 @@ void MainWindow::on_minMaxChangeButton_clicked() loop.exec(); m_maxAnimation->setEasingCurve(QEasingCurve::OutExpo); // m_maxAnimation->setStartValue(QRect(Style::m_primaryScreenX, Style::m_primaryScreenY + Style::m_availableScreenHeight - Style::minh, Style::minw, Style::minh)); - m_maxAnimation->setStartValue(QRect(this->x(), this->y(), Style::m_minw, Style::m_minh)); + m_maxAnimation->setStartValue(QRect(this->x() + 5, this->y() + 5, Style::m_minw - 10, Style::m_minh - 10)); m_maxAnimation->setEndValue(QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight)); m_maxAnimation->start(QAbstractAnimation::DeleteWhenStopped); @@ -1412,7 +1412,7 @@ void MainWindow::showNormalWindowSlot() m_isFullScreen = false; m_minAnimation->setEasingCurve(QEasingCurve::OutExpo); m_minAnimation->setStartValue(QRect(0, 0, Style::m_availableScreenWidth, Style::m_availableScreenHeight)); - m_minAnimation->setEndValue(QRect(this->x(), this->y(), Style::m_minw, Style::m_minh)); + m_minAnimation->setEndValue(QRect(this->x() + 5, this->y() + 5, Style::m_minw - 10, Style::m_minh - 10)); m_minAnimation->start(QAbstractAnimation::DeleteWhenStopped); m_fullWindow->hide(); From 97bcd8257d7a1b4b853dab60c0dc26fa23313b39 Mon Sep 17 00:00:00 2001 From: lixueman Date: Thu, 20 Oct 2022 09:10:15 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E8=A7=A6=E6=91=B8=E6=BB=91=E5=8A=A8?= =?UTF-8?q?=E5=9B=9E=E5=BC=B9=E5=8A=A8=E7=94=BB=E5=BC=82=E5=B8=B8=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/UserInterface/ListView/listview.cpp | 26 ++++++++++++++++++++++--- src/UserInterface/ListView/listview.h | 3 ++- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/src/UserInterface/ListView/listview.cpp b/src/UserInterface/ListView/listview.cpp index f781921..89be87b 100755 --- a/src/UserInterface/ListView/listview.cpp +++ b/src/UserInterface/ListView/listview.cpp @@ -29,6 +29,7 @@ ListView::ListView(QWidget *parent/*, int width, int height, int module*/): this->h = 540; this->module = 1; initWidget(); + setAttribute(Qt::WA_AcceptTouchEvents); m_listmodel = new QStandardItemModel(this); this->setModel(m_listmodel); m_ukuiMenuInterface = new UkuiMenuInterface; @@ -95,6 +96,21 @@ void ListView::updateData(QVector data) } } +bool ListView::event(QEvent *e) +{ + switch (e->type()) { + case QEvent::TouchBegin: + m_scrollbarState = false; + break; + case QEvent::ChildRemoved: + m_scrollbarState = true; + break; + default: + break; + } + return QListView::event(e); +} + void ListView::onClicked(QModelIndex index) { QVariant var = m_listmodel->data(index, Qt::DisplayRole); @@ -119,14 +135,18 @@ void ListView::onClicked(QModelIndex index) void ListView::enterEvent(QEvent *e) { Q_UNUSED(e); - this->selectionModel()->clear(); - this->verticalScrollBar()->setVisible(true); + if (m_scrollbarState) { + this->selectionModel()->clear(); + verticalScrollBar()->setVisible(true); + } } void ListView::leaveEvent(QEvent *e) { Q_UNUSED(e); - this->verticalScrollBar()->setVisible(false); + if (m_scrollbarState) { + verticalScrollBar()->setVisible(false); + } } void ListView::paintEvent(QPaintEvent *e) diff --git a/src/UserInterface/ListView/listview.h b/src/UserInterface/ListView/listview.h index ff39d9b..f9125e8 100755 --- a/src/UserInterface/ListView/listview.h +++ b/src/UserInterface/ListView/listview.h @@ -49,11 +49,12 @@ protected: void leaveEvent(QEvent *e) Q_DECL_OVERRIDE; void paintEvent(QPaintEvent *e) override; void keyPressEvent(QKeyEvent *e); - + bool event(QEvent *e); private: int w = 0; int h = 0; int m_preRowCount; + bool m_scrollbarState = true; private Q_SLOTS: From e1646b3f509006cb4f2fe0b8e18c54c640b6c5fd Mon Sep 17 00:00:00 2001 From: lixueman Date: Thu, 20 Oct 2022 09:13:25 +0800 Subject: [PATCH 6/6] update changlog --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index fcbc26d..f06dc59 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +ukui-menu (3.1.1-ok4~1020) yangtze; urgency=medium + + * close-cd #129225【开始菜单】【PC】在列表顶部或底部继续触摸拖动概率性出现图标缺失情况,再次滑动显示正常(1/10) + + -- lixueman Thu, 20 Oct 2022 09:11:06 +0800 + ukui-menu (3.1.1-ok4~1012) yangtze; urgency=medium * close-cd #116176 【设计】【开始菜单】【浅色模式】底板缺少描边及阴影