diff --git a/debian/changelog b/debian/changelog index 9b10f8a..f06dc59 100755 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +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 【设计】【开始菜单】【浅色模式】底板缺少描边及阴影 + + -- lixueman Wed, 12 Oct 2022 11:14:50 +0800 + ukui-menu (3.1.1-ok4~0920) yangtze; urgency=medium * 任务:开始菜单工具提示内容优化(收藏&最近 区域),增加路径提示 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: 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..0c07b15 100755 --- a/src/UserInterface/mainwindow.cpp +++ b/src/UserInterface/mainwindow.cpp @@ -674,27 +674,29 @@ 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); + painter.restore(); KWindowEffects::enableBlurBehind(this->winId(), true, QRegion(path.toFillPolygon().toPolygon())); + QColor color = Qt::black; + 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); } /** @@ -1276,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); @@ -1287,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); @@ -1410,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();