From 44d593957294f9a0376f0d1bd6d056eb1ce05aac Mon Sep 17 00:00:00 2001 From: Dave Corley Date: Fri, 30 Aug 2024 22:30:58 -0700 Subject: [PATCH] FEAT(InstanceMode): Add a tooltip for InstanceMode in the same style as that of PathgridMode --- apps/opencs/view/render/instancemode.cpp | 19 ++++++++++++++++++- apps/opencs/view/render/instancemode.hpp | 2 ++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/apps/opencs/view/render/instancemode.cpp b/apps/opencs/view/render/instancemode.cpp index ae73e6780c..615ca42aa1 100644 --- a/apps/opencs/view/render/instancemode.cpp +++ b/apps/opencs/view/render/instancemode.cpp @@ -297,7 +297,7 @@ void CSVRender::InstanceMode::setDragAxis(const char axis) CSVRender::InstanceMode::InstanceMode( WorldspaceWidget* worldspaceWidget, osg::ref_ptr parentNode, QWidget* parent) : EditMode(worldspaceWidget, Misc::ScalableIcon::load(":scenetoolbar/editing-instance"), - Mask_Reference | Mask_Terrain, "Instance editing", parent) + Mask_Reference | Mask_Terrain, getTooltip(), parent) , mSubMode(nullptr) , mSubModeId("move") , mSelectionMode(nullptr) @@ -345,6 +345,23 @@ CSVRender::InstanceMode::InstanceMode( qOverload<>(&CSMPrefs::Shortcut::activated), this, [this, axis] { this->setDragAxis(axis); }); } +QString CSVRender::InstanceMode::getTooltip() +{ + return QString( + "Instance editing" + ""); +} + void CSVRender::InstanceMode::activate(CSVWidget::SceneToolbar* toolbar) { if (!mSubMode) diff --git a/apps/opencs/view/render/instancemode.hpp b/apps/opencs/view/render/instancemode.hpp index 193423efd5..ae7be10322 100644 --- a/apps/opencs/view/render/instancemode.hpp +++ b/apps/opencs/view/render/instancemode.hpp @@ -74,6 +74,8 @@ namespace CSVRender InstanceMode( WorldspaceWidget* worldspaceWidget, osg::ref_ptr parentNode, QWidget* parent = nullptr); + QString getTooltip(); + void activate(CSVWidget::SceneToolbar* toolbar) override; void deactivate(CSVWidget::SceneToolbar* toolbar) override;