]> git.sesse.net Git - kdenlive/blob - src/headertrack.cpp
make float vars big integers with factor
[kdenlive] / src / headertrack.cpp
1
2 #include <QMouseEvent>
3 #include <QStylePainter>
4 #include <QFrame>
5 #include <QWidget>
6 #include <QPainter>
7
8 #include <KLocale>
9 #include <KDebug>
10
11 #include "kdenlivesettings.h"
12 #include "headertrack.h"
13
14 HeaderTrack::HeaderTrack(int index, TrackInfo info, QWidget *parent)
15         : QWidget(parent), m_index(index), m_type(info.type) {
16     setFixedHeight(KdenliveSettings::trackheight());
17     view.setupUi(this);
18     view.track_number->setText(QString::number(m_index));
19     if (m_type == VIDEOTRACK) {
20         view.frame->setBackgroundRole(QPalette::AlternateBase);
21         view.frame->setAutoFillBackground(true);
22         view.buttonVideo->setIcon(KIcon("kdenlive-show-video"));
23     } else {
24         view.buttonVideo->setHidden(true);
25     }
26     view.buttonAudio->setIcon(KIcon("kdenlive-show-audio"));
27     view.buttonVideo->setChecked(!info.isBlind);
28     view.buttonAudio->setChecked(!info.isMute);
29     connect(view.buttonVideo, SIGNAL(clicked()), this, SLOT(switchVideo()));
30     connect(view.buttonAudio, SIGNAL(clicked()), this, SLOT(switchAudio()));
31 }
32
33 void HeaderTrack::switchVideo() {
34     emit switchTrackVideo(m_index);
35 }
36
37 void HeaderTrack::switchAudio() {
38     emit switchTrackAudio(m_index);
39 }
40
41 // virtual
42 /*void HeaderTrack::paintEvent(QPaintEvent *e) {
43     QRect region = e->rect();
44     region.setTopLeft(QPoint(region.left() + 1, region.top() + 1));
45     region.setBottomRight(QPoint(region.right() - 1, region.bottom() - 1));
46     QPainter painter(this);
47     if (m_type == AUDIOTRACK) painter.fillRect(region, QBrush(QColor(240, 240, 255)));
48     else painter.fillRect(region, QBrush(QColor(255, 255, 255)));
49     painter.drawText(region, Qt::AlignCenter, m_label);
50 }*/
51
52
53 #include "headertrack.moc"