small tweak. (reverse mouse wheel directions for color change)
--- a/QTfrontend/ui/widget/colorwidget.cpp Sat Oct 13 00:35:20 2012 +0400
+++ b/QTfrontend/ui/widget/colorwidget.cpp Sat Oct 13 13:13:15 2012 +0200
@@ -56,10 +56,10 @@
switch(event->button())
{
case Qt::LeftButton:
- setColor((m_color + 1) % m_colorsModel->rowCount());
+ nextColor();
break;
case Qt::RightButton:
- setColor((m_color + m_colorsModel->rowCount() - 1) % m_colorsModel->rowCount());
+ previousColor();
break;
default:;
}
@@ -68,7 +68,17 @@
void ColorWidget::wheelEvent(QWheelEvent *event)
{
if(event->delta() > 0)
- setColor((m_color + 1) % m_colorsModel->rowCount());
+ previousColor();
else
- setColor((m_color + m_colorsModel->rowCount() - 1) % m_colorsModel->rowCount());
+ nextColor();
}
+
+void ColorWidget::nextColor()
+{
+ setColor((m_color + 1) % m_colorsModel->rowCount());
+}
+
+void ColorWidget::previousColor()
+{
+ setColor((m_color + m_colorsModel->rowCount() - 1) % m_colorsModel->rowCount());
+}
--- a/QTfrontend/ui/widget/colorwidget.h Sat Oct 13 00:35:20 2012 +0400
+++ b/QTfrontend/ui/widget/colorwidget.h Sat Oct 13 13:13:15 2012 +0200
@@ -35,6 +35,8 @@
protected:
void mousePressEvent(QMouseEvent * event);
void wheelEvent(QWheelEvent * event);
+ void nextColor();
+ void previousColor();
};
#endif // COLORWIDGET_H