else m_commandStack = NULL;
setMouseTracking(true);
setAcceptDrops(true);
+ setFrameShape(QFrame::NoFrame);
+ setLineWidth(0);
+
KdenliveSettings::setTrackheight(m_tracksHeight);
m_animationTimer = new QTimeLine(800);
m_animationTimer->setFrameRange(0, 5);
m_view.setupUi(this);
m_view.track_number->setText(info.trackName.isEmpty() ? QString::number(m_index) : info.trackName);
- m_view.buttonVideo->setChecked(!info.isBlind);
+ m_view.buttonVideo->setChecked(info.isBlind);
m_view.buttonVideo->setToolTip(i18n("Hide track"));
- m_view.buttonAudio->setChecked(!info.isMute);
+ m_view.buttonAudio->setChecked(info.isMute);
m_view.buttonAudio->setToolTip(i18n("Mute track"));
m_view.buttonLock->setChecked(info.isLocked);
m_view.buttonLock->setToolTip(i18n("Lock track"));
if (m_type == VIDEOTRACK) {
- m_view.frame->setBackgroundRole(QPalette::AlternateBase);
- m_view.frame->setAutoFillBackground(true);
+ setBackgroundRole(QPalette::AlternateBase);
+ setAutoFillBackground(true);
if (!info.isBlind) m_view.buttonVideo->setIcon(KIcon("kdenlive-show-video"));
else m_view.buttonVideo->setIcon(KIcon("kdenlive-hide-video"));
} else {
void HeaderTrack::switchVideo()
{
if (m_view.buttonVideo->isChecked()) {
- m_view.buttonVideo->setIcon(KIcon("kdenlive-show-video"));
- } else {
m_view.buttonVideo->setIcon(KIcon("kdenlive-hide-video"));
+ } else {
+ m_view.buttonVideo->setIcon(KIcon("kdenlive-show-video"));
}
emit switchTrackVideo(m_index);
}
void HeaderTrack::switchAudio()
{
if (m_view.buttonAudio->isChecked()) {
- m_view.buttonAudio->setIcon(KIcon("kdenlive-show-audio"));
- } else {
m_view.buttonAudio->setIcon(KIcon("kdenlive-hide-audio"));
+ } else {
+ m_view.buttonAudio->setIcon(KIcon("kdenlive-show-audio"));
}
emit switchTrackAudio(m_index);
}
sizeLayout->setSpacing(0);
m_view.size_frame->setLayout(sizeLayout);
- QString style1 = "QToolButton {border-style: none;margin: 0px 3px;padding: 0px;} QToolButton:pressed:hover { background-color: rgba(224, 224, 0, 100); border-style: inset; border:1px solid #cc6666;border-radius: 3px;} QToolButton:hover { background-color: rgba(255, 255, 255, 100); border-style: inset; border:1px solid #cc6666;border-radius: 3px;}";
-
-
QToolButton *butSmall = new QToolButton(this);
butSmall->setIcon(KIcon("kdenlive-zoom-small"));
butSmall->setToolTip(i18n("Smaller tracks"));
+ butSmall->setAutoRaise(true);
connect(butSmall, SIGNAL(clicked()), this, SLOT(slotVerticalZoomDown()));
sizeLayout->addWidget(butSmall);
QToolButton *butLarge = new QToolButton(this);
butLarge->setIcon(KIcon("kdenlive-zoom-large"));
butLarge->setToolTip(i18n("Bigger tracks"));
+ butLarge->setAutoRaise(true);
connect(butLarge, SIGNAL(clicked()), this, SLOT(slotVerticalZoomUp()));
sizeLayout->addWidget(butLarge);
- m_view.size_frame->setStyleSheet(style1);
QHBoxLayout *tracksLayout = new QHBoxLayout;
tracksLayout->setContentsMargins(0, 0, 0, 0);
m_view.headers_area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_view.headers_area->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ m_view.headers_area->setFixedWidth(70);
m_headersLayout = new QVBoxLayout;
m_headersLayout->setContentsMargins(0, m_trackview->frameWidth(), 0, 0);
m_headersLayout->setSpacing(0);
- m_view.headers_container->setLayout(m_headersLayout);
connect(m_view.headers_area->verticalScrollBar(), SIGNAL(valueChanged(int)), m_trackview->verticalScrollBar(), SLOT(setValue(int)));
tracksLayout->addWidget(m_trackview);
connect(m_trackview, SIGNAL(trackHeightChanged()), this, SLOT(slotRebuildTrackHeaders()));
parseDocument(m_doc->toXml());
+ m_view.headers_container->setLayout(m_headersLayout);
int error = m_doc->setSceneList();
if (error == -1) *ok = false;
else *ok = true;
kDebug() << "--------- - - - -REBUILD TLK HEAD";
const QList <TrackInfo> list = m_doc->tracksList();
QLayoutItem *child;
- m_view.headers_container->hide();
+ //m_view.headers_container->hide();
while ((child = m_headersLayout->takeAt(0)) != 0) {
if (child->widget()) delete child->widget();
delete child;
}
int max = list.count();
- int height = KdenliveSettings::trackheight() * m_scene->scale().y();
-
+ int height = KdenliveSettings::trackheight() * m_scene->scale().y() - 1;
+ HeaderTrack *header = NULL;
+ QFrame *frame = NULL;
for (int i = 0; i < max; i++) {
- HeaderTrack *header = new HeaderTrack(i, list.at(max - i - 1), height, this);
+ frame = new QFrame(this);
+ frame->setFixedHeight(1);
+ frame->setFrameStyle(QFrame::Plain);
+ frame->setFrameShape(QFrame::Box);
+ frame->setLineWidth(1);
+ m_headersLayout->addWidget(frame);
+ header = new HeaderTrack(i, list.at(max - i - 1), height, this);
connect(header, SIGNAL(switchTrackVideo(int)), m_trackview, SLOT(slotSwitchTrackVideo(int)));
connect(header, SIGNAL(switchTrackAudio(int)), m_trackview, SLOT(slotSwitchTrackAudio(int)));
connect(header, SIGNAL(switchTrackLock(int)), m_trackview, SLOT(slotSwitchTrackLock(int)));
connect(header, SIGNAL(renameTrack(int)), this, SLOT(slotRenameTrack(int)));
m_headersLayout->addWidget(header);
}
- m_view.headers_container->show();
+ frame = new QFrame(this);
+ frame->setFixedHeight(1);
+ frame->setFrameStyle(QFrame::Plain);
+ frame->setFrameShape(QFrame::Box);
+ frame->setLineWidth(1);
+ m_headersLayout->addWidget(frame);
}
void TrackView::adjustTrackHeaders()
{
- int height = KdenliveSettings::trackheight() * m_scene->scale().y();
+ int height = KdenliveSettings::trackheight() * m_scene->scale().y() - 1;
QLayoutItem *child;
for (int i = 0; i < m_headersLayout->count(); i++) {
child = m_headersLayout->itemAt(i);
- if (child->widget())(static_cast <HeaderTrack *>(child->widget()))->adjustSize(height);
+ if (child->widget() && child->widget()->height() > 5)(static_cast <HeaderTrack *>(child->widget()))->adjustSize(height);
}
}
if (m_verticalZoom == 0) m_trackview->setScale(m_scene->scale().x(), 0.5);
else m_trackview->setScale(m_scene->scale().x(), 1);
adjustTrackHeaders();
- /*KdenliveSettings::setTrackheight(KdenliveSettings::trackheight() / 2);
- m_trackview->checkTrackHeight(false);*/
+ m_trackview->verticalScrollBar()->setValue(m_view.headers_area->verticalScrollBar()->value());
}
void TrackView::slotVerticalZoomUp()
if (m_verticalZoom == 2) return;
m_verticalZoom++;
m_doc->setZoom(m_doc->zoom().x(), m_verticalZoom);
- /*KdenliveSettings::setTrackheight(KdenliveSettings::trackheight() * 2);
- m_trackview->checkTrackHeight(false);*/
if (m_verticalZoom == 2) m_trackview->setScale(m_scene->scale().x(), 2);
else m_trackview->setScale(m_scene->scale().x(), 1);
adjustTrackHeaders();
+ m_trackview->verticalScrollBar()->setValue(m_view.headers_area->verticalScrollBar()->value());
}
void TrackView::updateProjectFps()
</item>
<item row="1" column="0">
<widget class="QScrollArea" name="headers_area">
- <property name="minimumSize">
- <size>
- <width>60</width>
- <height>0</height>
- </size>
- </property>
- <property name="maximumSize">
- <size>
- <width>60</width>
- <height>16777215</height>
- </size>
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Maximum" vsizetype="Expanding">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
- <width>57</width>
+ <width>40</width>
<height>145</height>
</size>
</property>
<item row="0" column="0">
<widget class="QFrame" name="headers_container">
<property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</item>
<item row="1" column="1">
<widget class="QFrame" name="tracks_frame">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<x>0</x>
<y>0</y>
<width>86</width>
- <height>50</height>
+ <height>38</height>
</rect>
</property>
- <layout class="QGridLayout" name="gridLayout_2">
+ <layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>0</number>
</property>
- <item row="0" column="0">
- <widget class="QFrame" name="frame">
- <property name="frameShape">
- <enum>QFrame::StyledPanel</enum>
- </property>
- <property name="frameShadow">
- <enum>QFrame::Raised</enum>
- </property>
- <layout class="QGridLayout" name="gridLayout">
- <property name="leftMargin">
- <number>2</number>
- </property>
- <property name="topMargin">
- <number>0</number>
- </property>
- <property name="rightMargin">
- <number>2</number>
- </property>
- <property name="bottomMargin">
- <number>0</number>
- </property>
- <property name="spacing">
- <number>0</number>
- </property>
- <item row="0" column="0">
- <widget class="QToolButton" name="buttonLock">
- <property name="maximumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="text">
- <string/>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="arrowType">
- <enum>Qt::NoArrow</enum>
- </property>
- </widget>
- </item>
- <item row="0" column="1" colspan="2">
- <widget class="QLabel" name="track_number">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Expanding" vsizetype="Maximum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>0</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTop|Qt::AlignTrailing</set>
- </property>
- </widget>
- </item>
- <item row="1" column="0">
- <widget class="QToolButton" name="buttonAudio">
- <property name="maximumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="text">
- <string>A</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="arrowType">
- <enum>Qt::NoArrow</enum>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <spacer name="horizontalSpacer">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" stdset="0">
- <size>
- <width>29</width>
- <height>20</height>
- </size>
- </property>
- </spacer>
- </item>
- <item row="1" column="2">
- <widget class="QToolButton" name="buttonVideo">
- <property name="maximumSize">
- <size>
- <width>22</width>
- <height>22</height>
- </size>
- </property>
- <property name="text">
- <string>V</string>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- </widget>
- </item>
- </layout>
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <item row="0" column="0" colspan="4">
+ <widget class="QLabel" name="track_number">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>0</string>
+ </property>
+ <property name="scaledContents">
+ <bool>false</bool>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+ </property>
</widget>
</item>
+ <item row="1" column="0" colspan="2">
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item row="2" column="0">
+ <widget class="QToolButton" name="buttonLock">
+ <property name="maximumSize">
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string notr="true">L</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::NoArrow</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QToolButton" name="buttonAudio">
+ <property name="maximumSize">
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string notr="true">A</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ <property name="arrowType">
+ <enum>Qt::NoArrow</enum>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="2">
+ <widget class="QToolButton" name="buttonVideo">
+ <property name="maximumSize">
+ <size>
+ <width>22</width>
+ <height>22</height>
+ </size>
+ </property>
+ <property name="text">
+ <string notr="true">V</string>
+ </property>
+ <property name="checkable">
+ <bool>true</bool>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <property name="autoRaise">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="3">
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
</layout>
</widget>
<resources/>