Commit 8212009c authored by Stefan Majewsky's avatar Stefan Majewsky

Add icons for most interactors.

svn path=/trunk/KDE/kdegames/palapeli/; revision=1118503
parent 9afb7a80
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <QStyle> #include <QStyle>
#include <QStyleOptionRubberBand> #include <QStyleOptionRubberBand>
#include <KIcon>
#include <KLocalizedString> #include <KLocalizedString>
//BEGIN Palapeli::MovePieceInteractor //BEGIN Palapeli::MovePieceInteractor
...@@ -30,7 +31,7 @@ ...@@ -30,7 +31,7 @@
Palapeli::MovePieceInteractor::MovePieceInteractor(QGraphicsView* view) Palapeli::MovePieceInteractor::MovePieceInteractor(QGraphicsView* view)
: Palapeli::Interactor(20, Palapeli::MouseInteractor, view) //priority: very high because this is the most important interaction : Palapeli::Interactor(20, Palapeli::MouseInteractor, view) //priority: very high because this is the most important interaction
{ {
setMetadata(PieceInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Move pieces by dragging"), QIcon()); setMetadata(PieceInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Move pieces by dragging"), KIcon("transform-move"));
} }
static QGraphicsItem* findSelectableItemAt(const QPointF& scenePos, QGraphicsScene* scene) static QGraphicsItem* findSelectableItemAt(const QPointF& scenePos, QGraphicsScene* scene)
...@@ -120,7 +121,7 @@ void Palapeli::MovePieceInteractor::stopInteraction(const Palapeli::MouseEvent& ...@@ -120,7 +121,7 @@ void Palapeli::MovePieceInteractor::stopInteraction(const Palapeli::MouseEvent&
Palapeli::SelectPieceInteractor::SelectPieceInteractor(QGraphicsView* view) Palapeli::SelectPieceInteractor::SelectPieceInteractor(QGraphicsView* view)
: Palapeli::Interactor(19, Palapeli::MouseInteractor, view) //priority: a bit less than MovePieceInteractor : Palapeli::Interactor(19, Palapeli::MouseInteractor, view) //priority: a bit less than MovePieceInteractor
{ {
setMetadata(PieceInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Select pieces by clicking"), QIcon()); setMetadata(PieceInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Select pieces by clicking"), KIcon("edit-select"));
} }
bool Palapeli::SelectPieceInteractor::startInteraction(const Palapeli::MouseEvent& event) bool Palapeli::SelectPieceInteractor::startInteraction(const Palapeli::MouseEvent& event)
...@@ -144,7 +145,7 @@ bool Palapeli::SelectPieceInteractor::startInteraction(const Palapeli::MouseEven ...@@ -144,7 +145,7 @@ bool Palapeli::SelectPieceInteractor::startInteraction(const Palapeli::MouseEven
Palapeli::MoveViewportInteractor::MoveViewportInteractor(QGraphicsView* view) Palapeli::MoveViewportInteractor::MoveViewportInteractor(QGraphicsView* view)
: Palapeli::Interactor(1, Palapeli::MouseInteractor, view) //priority: very low because specific interaction points (e.g. pieces, scene boundaries) are much more important : Palapeli::Interactor(1, Palapeli::MouseInteractor, view) //priority: very low because specific interaction points (e.g. pieces, scene boundaries) are much more important
{ {
setMetadata(ViewportInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Move viewport by dragging"), QIcon()); setMetadata(ViewportInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Move viewport by dragging"), KIcon("transform-move"));
} }
bool Palapeli::MoveViewportInteractor::startInteraction(const Palapeli::MouseEvent& event) bool Palapeli::MoveViewportInteractor::startInteraction(const Palapeli::MouseEvent& event)
...@@ -167,7 +168,7 @@ void Palapeli::MoveViewportInteractor::continueInteraction(const Palapeli::Mouse ...@@ -167,7 +168,7 @@ void Palapeli::MoveViewportInteractor::continueInteraction(const Palapeli::Mouse
Palapeli::ZoomViewportInteractor::ZoomViewportInteractor(QGraphicsView* view) Palapeli::ZoomViewportInteractor::ZoomViewportInteractor(QGraphicsView* view)
: Palapeli::Interactor(0, Palapeli::WheelInteractor, view) //priority: unused for wheel interactors ATM : Palapeli::Interactor(0, Palapeli::WheelInteractor, view) //priority: unused for wheel interactors ATM
{ {
setMetadata(ViewportInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Zoom viewport"), QIcon()); setMetadata(ViewportInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Zoom viewport"), KIcon("zoom-in"));
} }
void Palapeli::ZoomViewportInteractor::doInteraction(const Palapeli::WheelEvent& event) void Palapeli::ZoomViewportInteractor::doInteraction(const Palapeli::WheelEvent& event)
...@@ -267,7 +268,7 @@ Palapeli::RubberBandInteractor::RubberBandInteractor(QGraphicsView* view) ...@@ -267,7 +268,7 @@ Palapeli::RubberBandInteractor::RubberBandInteractor(QGraphicsView* view)
: Palapeli::Interactor(2, Palapeli::MouseInteractor, view) //priority: a bit more than MoveViewport, but still much less than interactions with specific interaction points (e.g. pieces, scene boundaries) : Palapeli::Interactor(2, Palapeli::MouseInteractor, view) //priority: a bit more than MoveViewport, but still much less than interactions with specific interaction points (e.g. pieces, scene boundaries)
, m_item(new Palapeli::RubberBandItem) , m_item(new Palapeli::RubberBandItem)
{ {
setMetadata(PieceInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Select multiple pieces at once"), QIcon()); setMetadata(PieceInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Select multiple pieces at once"), KIcon("select-rectangular"));
if (scene()) if (scene())
scene()->addItem(m_item); scene()->addItem(m_item);
m_item->hide(); //NOTE: This is not necessary for the painting, but we use m_item->isVisible() to determine whether we are rubberbanding at the moment. //FIXME: really? m_item->hide(); //NOTE: This is not necessary for the painting, but we use m_item->isVisible() to determine whether we are rubberbanding at the moment. //FIXME: really?
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment