[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Traverso-commit] traverso/src/sheetcanvas Cursors.cpp Cursors.h
From: |
Nicola Doebelin |
Subject: |
[Traverso-commit] traverso/src/sheetcanvas Cursors.cpp Cursors.h |
Date: |
Sun, 26 Apr 2009 19:38:04 +0000 |
CVSROOT: /sources/traverso
Module name: traverso
Changes by: Nicola Doebelin <n_doebelin> 09/04/26 19:38:04
Modified files:
src/sheetcanvas: Cursors.cpp Cursors.h
Log message:
* should solve a performance problem with the playhead
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/traverso/src/sheetcanvas/Cursors.cpp?cvsroot=traverso&r1=1.17&r2=1.18
http://cvs.savannah.gnu.org/viewcvs/traverso/src/sheetcanvas/Cursors.h?cvsroot=traverso&r1=1.2&r2=1.3
Patches:
Index: Cursors.cpp
===================================================================
RCS file: /sources/traverso/traverso/src/sheetcanvas/Cursors.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -b -r1.17 -r1.18
--- Cursors.cpp 22 Mar 2009 21:10:36 -0000 1.17
+++ Cursors.cpp 26 Apr 2009 19:38:04 -0000 1.18
@@ -59,6 +59,8 @@
connect(&m_animation, SIGNAL(frameChanged(int)), this,
SLOT(set_animation_value(int)));
connect(&m_animation, SIGNAL(finished()), this,
SLOT(animation_finished()));
+ connect(themer(), SIGNAL(themeLoaded()), this,
SLOT(load_theme_data()), Qt::QueuedConnection);
+ load_theme_data();
setZValue(99);
}
@@ -79,15 +81,15 @@
{
Q_UNUSED(option);
Q_UNUSED(widget);
- QColor color;
+ QBrush brush;
if (m_sheet->is_transport_rolling()) {
- color = themer()->get_color("Playhead:active");
+ brush = m_brushActive;
} else {
- color = themer()->get_color("Playhead:inactive");
+ brush = m_brushInactive;
}
- painter->fillRect(1, 0, (int)m_boundingRect.width() - 2,
(int)m_boundingRect.height(), color);
+ painter->fillRect(1, 0, (int)m_boundingRect.width() - 2,
(int)m_boundingRect.height(), brush);
}
void PlayHead::play_start()
@@ -276,7 +278,11 @@
m_follow = ! m_follow;
}
-
+void PlayHead::load_theme_data()
+{
+ m_brushActive = themer()->get_brush("Playhead:active");
+ m_brushInactive = themer()->get_brush("Playhead:inactive");
+}
/**************************************************************/
/* WorkCursor */
Index: Cursors.h
===================================================================
RCS file: /sources/traverso/traverso/src/sheetcanvas/Cursors.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- Cursors.h 2 Feb 2009 20:24:11 -0000 1.2
+++ Cursors.h 26 Apr 2009 19:38:04 -0000 1.3
@@ -25,6 +25,7 @@
#include "ViewItem.h"
#include <QTimer>
#include <QTimeLine>
+#include <QBrush>
class Sheet;
class SheetView;
@@ -64,6 +65,8 @@
int m_animationScrollStartPos;
int m_animFrameRange;
qreal m_animScaleFactor;
+ QBrush m_brushActive;
+ QBrush m_brushInactive;
private slots:
void check_config();
@@ -71,6 +74,7 @@
void play_stop();
void set_animation_value(int);
void animation_finished();
+ void load_theme_data();
public slots:
void update_position();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Traverso-commit] traverso/src/sheetcanvas Cursors.cpp Cursors.h,
Nicola Doebelin <=