else *ok = true;
connect(m_trackview, SIGNAL(cursorMoved(int, int)), m_ruler, SLOT(slotCursorMoved(int, int)));
connect(m_trackview->horizontalScrollBar(), SIGNAL(valueChanged(int)), m_ruler, SLOT(slotMoveRuler(int)));
+ connect(m_trackview->horizontalScrollBar(), SIGNAL(rangeChanged(int, int)), this, SLOT(slotUpdateVerticalScroll(int, int)));
connect(m_trackview, SIGNAL(mousePosition(int)), this, SIGNAL(mousePosition(int)));
connect(m_trackview, SIGNAL(doTrackLock(int, bool)), this, SLOT(slotChangeTrackLock(int, bool)));
}
}
+void TrackView::slotUpdateVerticalScroll(int /*min*/, int max) {
+ int height = 0;
+ if (max > 0) height = m_trackview->horizontalScrollBar()->height() - 1;
+ headers_container->layout()->setContentsMargins(0, m_trackview->frameWidth(), 0, height);
+}
#include "trackview.moc"
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
+/**
+* @class TrackView
+* @brief Manages the timline
+* @author Jean-Baptiste Mardelle
+*/
#ifndef TRACKVIEW_H
#define TRACKVIEW_H
#include <QScrollArea>
-#include <KRuler>
#include <QGroupBox>
#include <QGraphicsScene>
#include <QGraphicsLineItem>
#include <QDomElement>
+#include <KRuler>
#include "customtrackscene.h"
#include "ui_timeline_ui.h"
private slots:
void setCursorPos(int pos);
void moveCursorPos(int pos);
- /** \brief Rebuild the track headers */
+ /** @brief Rebuild the track headers */
void slotRebuildTrackHeaders();
- /** \brief The tracks count or a track name changed, rebuild and notify */
+ /** @brief The tracks count or a track name changed, rebuild and notify */
void slotReloadTracks();
void slotChangeTrackLock(int ix, bool lock);
void slotVerticalZoomDown();
void slotVerticalZoomUp();
void slotRenameTrack(int ix);
void slotRepaintTracks();
+ /** @brief Adjust margins of header area
+ *
+ * Avoid a shift between header area and trackview if
+ * the horizontal scrollbar is visible and the position
+ * of the vertical scrollbar is maximal */
+ void slotUpdateVerticalScroll(int min, int max);
signals:
void mousePosition(int);