From 4624bed899568f8465399048502b1e0ef9aa073c Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Sun, 13 Oct 2013 15:41:48 +0200 Subject: [PATCH] changed handling of scene toolbar button icons --- apps/opencs/view/world/scenetool.cpp | 5 ----- apps/opencs/view/world/scenetool.hpp | 4 ---- apps/opencs/view/world/scenetoolmode.cpp | 5 ++++- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/apps/opencs/view/world/scenetool.cpp b/apps/opencs/view/world/scenetool.cpp index 2140cd1e02..320deb1ba9 100644 --- a/apps/opencs/view/world/scenetool.cpp +++ b/apps/opencs/view/world/scenetool.cpp @@ -11,11 +11,6 @@ CSVWorld::SceneTool::SceneTool (SceneToolbar *parent) : QPushButton (parent) connect (this, SIGNAL (clicked()), this, SLOT (openRequest())); } -void CSVWorld::SceneTool::updateIcon (const QIcon& icon) -{ - setIcon (icon); -} - void CSVWorld::SceneTool::openRequest() { showPanel (parentWidget()->mapToGlobal (pos())); diff --git a/apps/opencs/view/world/scenetool.hpp b/apps/opencs/view/world/scenetool.hpp index 2e83b0c6d7..07e8b58d72 100644 --- a/apps/opencs/view/world/scenetool.hpp +++ b/apps/opencs/view/world/scenetool.hpp @@ -18,10 +18,6 @@ namespace CSVWorld virtual void showPanel (const QPoint& position) = 0; - protected slots: - - void updateIcon (const QIcon& icon); - private slots: void openRequest(); diff --git a/apps/opencs/view/world/scenetoolmode.cpp b/apps/opencs/view/world/scenetoolmode.cpp index 2435a8e357..281d703b65 100644 --- a/apps/opencs/view/world/scenetoolmode.cpp +++ b/apps/opencs/view/world/scenetoolmode.cpp @@ -36,6 +36,9 @@ void CSVWorld::SceneToolMode::addButton (const std::string& icon, const std::str mButtons.insert (std::make_pair (button, id)); connect (button, SIGNAL (clicked()), this, SLOT (selected())); + + if (mButtons.size()==1) + setIcon (button->icon()); } void CSVWorld::SceneToolMode::selected() @@ -47,7 +50,7 @@ void CSVWorld::SceneToolMode::selected() { mPanel->hide(); - emit updateIcon (iter->first->icon()); + setIcon (iter->first->icon()); emit modeChanged (iter->second); } } \ No newline at end of file