Reset part tree button color to white

master
huxingyi 2020-10-17 16:44:11 +09:30
parent b36adf7a8d
commit b2bea06079
4 changed files with 22 additions and 22 deletions

View File

@ -815,11 +815,11 @@ DocumentWindow::DocumentWindow() :
}); });
m_viewMenu->addAction(m_toggleColorAction); m_viewMenu->addAction(m_toggleColorAction);
m_toggleUvCheckAction = new QAction(tr("Toggle UV Check"), this); //m_toggleUvCheckAction = new QAction(tr("Toggle UV Check"), this);
connect(m_toggleUvCheckAction, &QAction::triggered, [=]() { //connect(m_toggleUvCheckAction, &QAction::triggered, [=]() {
m_modelRenderWidget->toggleUvCheck(); // m_modelRenderWidget->toggleUvCheck();
}); //});
m_viewMenu->addAction(m_toggleUvCheckAction); //m_viewMenu->addAction(m_toggleUvCheckAction);
//connect(m_viewMenu, &QMenu::aboutToShow, [=]() { //connect(m_viewMenu, &QMenu::aboutToShow, [=]() {
// m_resetModelWidgetPosAction->setEnabled(!isModelSitInVisibleArea(m_modelRenderWidget)); // m_resetModelWidgetPosAction->setEnabled(!isModelSitInVisibleArea(m_modelRenderWidget));

View File

@ -159,8 +159,8 @@ void PartTreeWidget::updateComponentSelectState(QUuid componentId, bool selected
void PartTreeWidget::mouseDoubleClickEvent(QMouseEvent *event) void PartTreeWidget::mouseDoubleClickEvent(QMouseEvent *event)
{ {
delete m_delayedMousePressTimer; //delete m_delayedMousePressTimer;
m_delayedMousePressTimer = nullptr; //m_delayedMousePressTimer = nullptr;
QWidget::mouseDoubleClickEvent(event); QWidget::mouseDoubleClickEvent(event);
auto componentIds = collectSelectedComponentIds(event->pos()); auto componentIds = collectSelectedComponentIds(event->pos());
@ -178,16 +178,16 @@ void PartTreeWidget::handleSingleClick(const QPoint &pos)
{ {
QModelIndex itemIndex = indexAt(pos); QModelIndex itemIndex = indexAt(pos);
auto showMenu = [=]() { //auto showMenu = [=]() {
delete m_delayedMousePressTimer; // delete m_delayedMousePressTimer;
m_delayedMousePressTimer = new QTimer(this); // m_delayedMousePressTimer = new QTimer(this);
m_delayedMousePressTimer->setSingleShot(true); // m_delayedMousePressTimer->setSingleShot(true);
m_delayedMousePressTimer->setInterval(200); // m_delayedMousePressTimer->setInterval(200);
connect(m_delayedMousePressTimer, &QTimer::timeout, this, [=]() { // connect(m_delayedMousePressTimer, &QTimer::timeout, this, [=]() {
showContextMenu(pos, true); //showContextMenu(pos, true);
}); // });
m_delayedMousePressTimer->start(); // m_delayedMousePressTimer->start();
}; //};
bool multiple = QGuiApplication::queryKeyboardModifiers().testFlag(Qt::ControlModifier); bool multiple = QGuiApplication::queryKeyboardModifiers().testFlag(Qt::ControlModifier);
if (itemIndex.isValid()) { if (itemIndex.isValid()) {
@ -397,8 +397,8 @@ std::vector<QUuid> PartTreeWidget::collectSelectedComponentIds(const QPoint &pos
void PartTreeWidget::showContextMenu(const QPoint &pos, bool shorted) void PartTreeWidget::showContextMenu(const QPoint &pos, bool shorted)
{ {
delete m_delayedMousePressTimer; //delete m_delayedMousePressTimer;
m_delayedMousePressTimer = nullptr; //m_delayedMousePressTimer = nullptr;
const Component *component = nullptr; const Component *component = nullptr;
const SkeletonPart *part = nullptr; const SkeletonPart *part = nullptr;

View File

@ -108,7 +108,7 @@ private:
private: private:
const Document *m_document = nullptr; const Document *m_document = nullptr;
QTreeWidgetItem *m_rootItem = nullptr; QTreeWidgetItem *m_rootItem = nullptr;
QTimer *m_delayedMousePressTimer = nullptr; //QTimer *m_delayedMousePressTimer = nullptr;
bool m_firstSelect = true; bool m_firstSelect = true;
std::map<QUuid, QTreeWidgetItem *> m_partItemMap; std::map<QUuid, QTreeWidgetItem *> m_partItemMap;
std::map<QUuid, QTreeWidgetItem *> m_componentItemMap; std::map<QUuid, QTreeWidgetItem *> m_componentItemMap;

View File

@ -130,7 +130,7 @@ void Theme::updateAwesomeMiniButton(QPushButton *button, QChar icon, bool highli
color = Theme::blue; color = Theme::blue;
needDesaturation = false; needDesaturation = false;
} else { } else {
color = Theme::red; color = Theme::white;
} }
} else { } else {
color = QColor("#525252"); color = QColor("#525252");