From 50a489321fbc5c4bbc91652de9cd9ffc5306a813 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Thu, 27 Nov 2014 09:27:29 +0100 Subject: [PATCH] updated run button --- apps/opencs/view/render/worldspacewidget.cpp | 2 +- apps/opencs/view/widget/scenetoolrun.cpp | 8 ++++---- apps/opencs/view/widget/scenetoolrun.hpp | 4 +--- files/opencs/resources.qrc | 1 + 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/apps/opencs/view/render/worldspacewidget.cpp b/apps/opencs/view/render/worldspacewidget.cpp index 6c6acd22dc..a5d1ba5465 100644 --- a/apps/opencs/view/render/worldspacewidget.cpp +++ b/apps/opencs/view/render/worldspacewidget.cpp @@ -172,7 +172,7 @@ CSVWidget::SceneToolRun *CSVRender::WorldspaceWidget::makeRunTool ( std::sort (profiles.begin(), profiles.end()); mRun = new CSVWidget::SceneToolRun (parent, "Run OpenMW from the current camera position", - ":placeholder", ":placeholder", profiles); + ":scenetoolbar/play", profiles); connect (mRun, SIGNAL (runRequest (const std::string&)), this, SLOT (runRequest (const std::string&))); diff --git a/apps/opencs/view/widget/scenetoolrun.cpp b/apps/opencs/view/widget/scenetoolrun.cpp index 92f3193feb..0c7a4b9f0d 100644 --- a/apps/opencs/view/widget/scenetoolrun.cpp +++ b/apps/opencs/view/widget/scenetoolrun.cpp @@ -26,7 +26,7 @@ void CSVWidget::SceneToolRun::adjustToolTips() void CSVWidget::SceneToolRun::updateIcon() { - setIcon (QIcon (mSelected==mProfiles.end() ? mIconDisabled : mIcon)); + setDisabled (mSelected==mProfiles.end()); } void CSVWidget::SceneToolRun::updatePanel() @@ -46,11 +46,11 @@ void CSVWidget::SceneToolRun::updatePanel() } CSVWidget::SceneToolRun::SceneToolRun (SceneToolbar *parent, const QString& toolTip, - const QString& icon, const QString& iconDisabled, const std::vector& profiles) + const QString& icon, const std::vector& profiles) : SceneTool (parent, Type_TopAction), mProfiles (profiles.begin(), profiles.end()), - mSelected (mProfiles.begin()), mToolTip (toolTip), mIcon (icon), - mIconDisabled (iconDisabled) + mSelected (mProfiles.begin()), mToolTip (toolTip) { + setIcon (QIcon (icon)); updateIcon(); adjustToolTips(); diff --git a/apps/opencs/view/widget/scenetoolrun.hpp b/apps/opencs/view/widget/scenetoolrun.hpp index 4396c22881..dd035462fe 100644 --- a/apps/opencs/view/widget/scenetoolrun.hpp +++ b/apps/opencs/view/widget/scenetoolrun.hpp @@ -19,8 +19,6 @@ namespace CSVWidget std::set mProfiles; std::set::iterator mSelected; QString mToolTip; - QString mIcon; - QString mIconDisabled; QFrame *mPanel; QTableWidget *mTable; @@ -35,7 +33,7 @@ namespace CSVWidget public: SceneToolRun (SceneToolbar *parent, const QString& toolTip, const QString& icon, - const QString& iconDisabled, const std::vector& profiles); + const std::vector& profiles); virtual void showPanel (const QPoint& position); diff --git a/files/opencs/resources.qrc b/files/opencs/resources.qrc index 751ae64844..86631f4373 100644 --- a/files/opencs/resources.qrc +++ b/files/opencs/resources.qrc @@ -79,5 +79,6 @@ eyeballdude.png flying eye.png orbit2.png + scene-play.png