Commit f321ff15 authored by Laurent Montel's avatar Laurent Montel 😁

Port to QIcon

parent a6b6188b
......@@ -21,7 +21,7 @@
#include "triggerconfigwidget.h"
#include "../engine/texturehelper.h"
#include "settings.h"
#include <KIcon>
#include <QIcon>
#include <QTimer>
//BEGIN Palapeli::TriggerComboBox
......@@ -71,10 +71,10 @@ Palapeli::ConfigDialog::ConfigDialog(QWidget* parent)
setupSolutionAreaComboBox();
addPage(generalPage, i18n("General settings"))->
setIcon(KIcon( QLatin1String( "configure" )));
setIcon(QIcon::fromTheme( QLatin1String( "configure" )));
//setup page "Mouse interaction"
addPage(m_triggerPage, i18n("Mouse interaction"))->
setIcon(KIcon( QLatin1String( "input-mouse" )));
setIcon(QIcon::fromTheme( QLatin1String( "input-mouse" )));
connect(m_triggerPage, SIGNAL(associationsChanged()),
SLOT(updateButtons()));
}
......
......@@ -23,15 +23,15 @@
#include <QApplication>
#include <QHBoxLayout>
#include <QStyleOptionButton>
#include <KIcon>
#include <QIcon>
#include <KLocalizedString>
static QIcon clearIcon()
{
if (QApplication::isLeftToRight())
return KIcon( QLatin1String( "edit-clear-locationbar-rtl" ));
return QIcon::fromTheme( QLatin1String( "edit-clear-locationbar-rtl" ));
else
return KIcon( QLatin1String( "edit-clear-locationbar-ltr" ));
return QIcon::fromTheme( QLatin1String( "edit-clear-locationbar-ltr" ));
}
Palapeli::MouseInputButton::MouseInputButton(QWidget* parent)
......@@ -48,7 +48,7 @@ Palapeli::MouseInputButton::MouseInputButton(QWidget* parent)
connect(this, SIGNAL(clicked()), SLOT(captureTrigger()));
connect(m_clearButton, SIGNAL(clicked()), SLOT(clearTrigger()));
setCheckable(true);
m_iconLabel->setPixmap(KIcon( QLatin1String( "input-mouse" )).pixmap(22)); //TODO: respect global icon size configuration
m_iconLabel->setPixmap(QIcon::fromTheme( QLatin1String( "input-mouse" )).pixmap(22)); //TODO: respect global icon size configuration
//setup child widgets
m_iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
m_mainLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
......
......@@ -26,7 +26,7 @@
#include <QApplication>
#include <QStyle>
#include <QStyleOptionRubberBand>
#include <KIcon>
#include <QIcon>
#include <KLocalizedString>
//BEGIN Palapeli::MovePieceInteractor
......@@ -34,7 +34,7 @@
Palapeli::MovePieceInteractor::MovePieceInteractor(QGraphicsView* view)
: 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"), KIcon( QLatin1String( "transform-move" )));
setMetadata(PieceInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Move pieces by dragging"), QIcon::fromTheme( QLatin1String( "transform-move" )));
}
static QGraphicsItem* findSelectableItemAt(const QPointF& scenePos, QGraphicsScene* scene)
......@@ -149,7 +149,7 @@ void Palapeli::MovePieceInteractor::stopInteraction(const Palapeli::MouseEvent&
Palapeli::SelectPieceInteractor::SelectPieceInteractor(QGraphicsView* view)
: 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"), KIcon( QLatin1String( "edit-select" )));
setMetadata(PieceInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Select pieces by clicking"), QIcon::fromTheme( QLatin1String( "edit-select" )));
}
bool Palapeli::SelectPieceInteractor::startInteraction(const Palapeli::MouseEvent& event)
......@@ -210,7 +210,7 @@ bool Palapeli::TeleportPieceInteractor::startInteraction(const Palapeli::MouseEv
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
{
setMetadata(ViewportInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Move viewport by dragging"), KIcon( QLatin1String( "transform-move" )));
setMetadata(ViewportInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Move viewport by dragging"), QIcon::fromTheme( QLatin1String( "transform-move" )));
}
bool Palapeli::MoveViewportInteractor::startInteraction(const Palapeli::MouseEvent& event)
......@@ -236,7 +236,7 @@ Palapeli::ToggleCloseUpInteractor::ToggleCloseUpInteractor(QGraphicsView* view)
// IDW TODO - Check the priority against other priorities.
//
// IDW TODO - What about Palapeli::MouseEvent flags?
setMetadata(ViewportInteraction, i18nc("As in a movie scene", "Switch to close-up or distant view"), KIcon(QLatin1String("zoom-in")));
setMetadata(ViewportInteraction, i18nc("As in a movie scene", "Switch to close-up or distant view"), QIcon::fromTheme(QLatin1String("zoom-in")));
qDebug() << "CONSTRUCTED ToggleCloseUpInteractor";
}
......@@ -255,7 +255,7 @@ bool Palapeli::ToggleCloseUpInteractor::startInteraction(const Palapeli::MouseEv
Palapeli::ZoomViewportInteractor::ZoomViewportInteractor(QGraphicsView* view)
: Palapeli::Interactor(2, Palapeli::WheelInteractor, view) //priority: more important than ScrollViewport
{
setMetadata(ViewportInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Zoom viewport"), KIcon( QLatin1String( "zoom-in" )));
setMetadata(ViewportInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Zoom viewport"), QIcon::fromTheme( QLatin1String( "zoom-in" )));
}
void Palapeli::ZoomViewportInteractor::doInteraction(const Palapeli::WheelEvent& event)
......@@ -355,7 +355,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)
, m_item(new Palapeli::RubberBandItem)
{
setMetadata(PieceInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Select multiple pieces at once"), KIcon( QLatin1String( "select-rectangular" )));
setMetadata(PieceInteraction, i18nc("Description (used like a name) for a mouse interaction method", "Select multiple pieces at once"), QIcon::fromTheme( QLatin1String( "select-rectangular" )));
if (scene())
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?
......
......@@ -22,7 +22,7 @@
#include <QSlider>
#include <QToolButton>
#include <QVBoxLayout>
#include <KIcon>
#include <QIcon>
#include <KLocalizedString>
#include <KStandardShortcut>
......@@ -34,14 +34,14 @@ Palapeli::ZoomWidget::ZoomWidget(QWidget* parent)
, m_slider(new QSlider(Qt::Horizontal))
{
//init buttons
m_constrainedButton->setIcon(KIcon( QLatin1String( "select-rectangular" )));
m_constrainedButton->setIcon(QIcon::fromTheme( QLatin1String( "select-rectangular" )));
m_constrainedButton->setToolTip(i18n("Lock the puzzle table area"));
m_constrainedButton->setCheckable(true);
connect(m_constrainedButton, SIGNAL(toggled(bool)), this, SIGNAL(constrainedChanged(bool)));
m_zoomOutButton->setIcon(KIcon( QLatin1String( "zoom-out" )));
m_zoomOutButton->setIcon(QIcon::fromTheme( QLatin1String( "zoom-out" )));
//QT5 m_zoomOutButton->setShortcut(KStandardShortcut::zoomOut().primary());
connect(m_zoomOutButton, SIGNAL(pressed()), this, SIGNAL(zoomOutRequest()));
m_zoomInButton->setIcon(KIcon( QLatin1String( "zoom-in" )));
m_zoomInButton->setIcon(QIcon::fromTheme( QLatin1String( "zoom-in" )));
//QT5 m_zoomInButton->setShortcut(KStandardShortcut::zoomIn().primary());
connect(m_zoomInButton, SIGNAL(pressed()), this, SIGNAL(zoomInRequest()));
//init slider
......
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