From b2bea06079a85a45416ff75a3fe3220dcf6f6416 Mon Sep 17 00:00:00 2001 From: huxingyi Date: Sat, 17 Oct 2020 16:44:11 +0930 Subject: [PATCH] Reset part tree button color to white --- src/documentwindow.cpp | 12 ++++++------ src/parttreewidget.cpp | 28 ++++++++++++++-------------- src/parttreewidget.h | 2 +- src/theme.cpp | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/documentwindow.cpp b/src/documentwindow.cpp index 3f724cc5..b80ec8f7 100644 --- a/src/documentwindow.cpp +++ b/src/documentwindow.cpp @@ -460,7 +460,7 @@ DocumentWindow::DocumentWindow() : tabifyDockWidget(motionDocker, scriptDocker); partTreeDocker->raise(); - + QHBoxLayout *mainLayout = new QHBoxLayout; mainLayout->setSpacing(0); mainLayout->setContentsMargins(0, 0, 0, 0); @@ -815,11 +815,11 @@ DocumentWindow::DocumentWindow() : }); m_viewMenu->addAction(m_toggleColorAction); - m_toggleUvCheckAction = new QAction(tr("Toggle UV Check"), this); - connect(m_toggleUvCheckAction, &QAction::triggered, [=]() { - m_modelRenderWidget->toggleUvCheck(); - }); - m_viewMenu->addAction(m_toggleUvCheckAction); + //m_toggleUvCheckAction = new QAction(tr("Toggle UV Check"), this); + //connect(m_toggleUvCheckAction, &QAction::triggered, [=]() { + // m_modelRenderWidget->toggleUvCheck(); + //}); + //m_viewMenu->addAction(m_toggleUvCheckAction); //connect(m_viewMenu, &QMenu::aboutToShow, [=]() { // m_resetModelWidgetPosAction->setEnabled(!isModelSitInVisibleArea(m_modelRenderWidget)); diff --git a/src/parttreewidget.cpp b/src/parttreewidget.cpp index 63c14a14..32f3570f 100644 --- a/src/parttreewidget.cpp +++ b/src/parttreewidget.cpp @@ -159,8 +159,8 @@ void PartTreeWidget::updateComponentSelectState(QUuid componentId, bool selected void PartTreeWidget::mouseDoubleClickEvent(QMouseEvent *event) { - delete m_delayedMousePressTimer; - m_delayedMousePressTimer = nullptr; + //delete m_delayedMousePressTimer; + //m_delayedMousePressTimer = nullptr; QWidget::mouseDoubleClickEvent(event); auto componentIds = collectSelectedComponentIds(event->pos()); @@ -178,16 +178,16 @@ void PartTreeWidget::handleSingleClick(const QPoint &pos) { QModelIndex itemIndex = indexAt(pos); - auto showMenu = [=]() { - delete m_delayedMousePressTimer; - m_delayedMousePressTimer = new QTimer(this); - m_delayedMousePressTimer->setSingleShot(true); - m_delayedMousePressTimer->setInterval(200); - connect(m_delayedMousePressTimer, &QTimer::timeout, this, [=]() { - showContextMenu(pos, true); - }); - m_delayedMousePressTimer->start(); - }; + //auto showMenu = [=]() { + // delete m_delayedMousePressTimer; + // m_delayedMousePressTimer = new QTimer(this); + // m_delayedMousePressTimer->setSingleShot(true); + // m_delayedMousePressTimer->setInterval(200); + // connect(m_delayedMousePressTimer, &QTimer::timeout, this, [=]() { + //showContextMenu(pos, true); + // }); + // m_delayedMousePressTimer->start(); + //}; bool multiple = QGuiApplication::queryKeyboardModifiers().testFlag(Qt::ControlModifier); if (itemIndex.isValid()) { @@ -397,8 +397,8 @@ std::vector PartTreeWidget::collectSelectedComponentIds(const QPoint &pos void PartTreeWidget::showContextMenu(const QPoint &pos, bool shorted) { - delete m_delayedMousePressTimer; - m_delayedMousePressTimer = nullptr; + //delete m_delayedMousePressTimer; + //m_delayedMousePressTimer = nullptr; const Component *component = nullptr; const SkeletonPart *part = nullptr; diff --git a/src/parttreewidget.h b/src/parttreewidget.h index 555dcbce..3fbcf027 100644 --- a/src/parttreewidget.h +++ b/src/parttreewidget.h @@ -108,7 +108,7 @@ private: private: const Document *m_document = nullptr; QTreeWidgetItem *m_rootItem = nullptr; - QTimer *m_delayedMousePressTimer = nullptr; + //QTimer *m_delayedMousePressTimer = nullptr; bool m_firstSelect = true; std::map m_partItemMap; std::map m_componentItemMap; diff --git a/src/theme.cpp b/src/theme.cpp index 2924637a..34c39ec2 100644 --- a/src/theme.cpp +++ b/src/theme.cpp @@ -130,7 +130,7 @@ void Theme::updateAwesomeMiniButton(QPushButton *button, QChar icon, bool highli color = Theme::blue; needDesaturation = false; } else { - color = Theme::red; + color = Theme::white; } } else { color = QColor("#525252");