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

@ -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));

View File

@ -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<QUuid> 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;

View File

@ -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<QUuid, QTreeWidgetItem *> m_partItemMap;
std::map<QUuid, QTreeWidgetItem *> m_componentItemMap;

View File

@ -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");