Commit bf741db0 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle

Hide "separate channel" menu from video tracks, minor ui fix

parent 7c282740
......@@ -560,11 +560,14 @@ void MainWindow::init()
timelineHeadersMenu->addAction(actionCollection()->action(QStringLiteral("insert_track")));
timelineHeadersMenu->addAction(actionCollection()->action(QStringLiteral("delete_track")));
timelineHeadersMenu->addAction(actionCollection()->action(QStringLiteral("show_track_record")));
QAction *separate_channels = new QAction(QIcon(), i18n("Separate Channels"), this);
separate_channels->setCheckable(true);
separate_channels->setChecked(KdenliveSettings::displayallchannels());
separate_channels->setData("separate_channels");
connect(separate_channels, &QAction::triggered, this, &MainWindow::slotSeparateAudioChannel);
timelineHeadersMenu->addAction(separate_channels);
QMenu *thumbsMenu = new QMenu(i18n("Thumbnails"), this);
QActionGroup *thumbGroup = new QActionGroup(this);
QAction *inFrame = new QAction(i18n("In Frame"), thumbGroup);
......
......@@ -1322,10 +1322,10 @@ void Monitor::slotSwitchPlay()
{
slotActivateMonitor();
m_glMonitor->switchPlay(m_playAction->isActive());
bool showDropped;
bool showDropped = false;
if (m_id == Kdenlive::ClipMonitor) {
showDropped = KdenliveSettings::displayClipMonitorInfo() & 0x20;
} else {
} else if (m_id == Kdenlive::ProjectMonitor) {
showDropped = KdenliveSettings::displayProjectMonitorInfo() & 0x20;
}
if (showDropped) {
......
......@@ -69,7 +69,7 @@ Row {
Rectangle {
visible: thumbRepeater.count < 3
anchors.left: parent.left
anchors.leftMargin: index < thumbRepeater.count - 1 ? thumbRow.thumbWidth : parent.width - thumbRow.thumbWidth - 1
anchors.leftMargin: index == 0 ? thumbRow.thumbWidth : parent.width - thumbRow.thumbWidth - 1
color: "#ffffff"
opacity: 0.3
width: 1
......
......@@ -33,11 +33,6 @@ Item{
property int itemType: 0
opacity: model.disabled ? 0.4 : 1
/*function redrawWaveforms() {
for (var i = 0; i < repeater.count; i++)
repeater.itemAt(i).generateWaveform()
}*/
function clipAt(index) {
return repeater.itemAt(index)
}
......
......@@ -133,7 +133,7 @@ void TimelineWidget::setTimelineMenu(QMenu *clipMenu, QMenu *compositionMenu, QM
connect(m_guideMenu, &QMenu::triggered, [&] (QAction *ac) {
m_proxy->setPosition(ac->data().toInt());
});
connect(m_headerMenu, &QMenu::triggered, [&] (QAction *ac) {
connect(m_thumbsMenu, &QMenu::triggered, [&] (QAction *ac) {
m_proxy->setActiveTrackProperty(QStringLiteral("kdenlive:thumbs_format"), ac->data().toString());
});
// Fix qml focus issue
......@@ -226,11 +226,10 @@ void TimelineWidget::showHeaderMenu()
{
bool isAudio = m_proxy->isActiveTrackAudio();
QList <QAction *> menuActions = m_headerMenu->actions();
QAction *showRec = nullptr;
QList <QAction *> audioActions;
for (QAction *ac : menuActions) {
if (ac->data().toString() == QLatin1String("show_track_record")) {
showRec = ac;
break;
if (ac->data().toString() == QLatin1String("show_track_record") || ac->data().toString() == QLatin1String("separate_channels")) {
audioActions << ac;
}
}
if (!isAudio) {
......@@ -244,15 +243,17 @@ void TimelineWidget::showHeaderMenu()
}
}
m_thumbsMenu->menuAction()->setVisible(true);
if (showRec) {
showRec->setVisible(false);
for (auto ac : audioActions) {
ac->setVisible(false);
}
} else {
// Audio track
m_thumbsMenu->menuAction()->setVisible(false);
if (showRec) {
showRec->setVisible(true);
showRec->setChecked(m_proxy->getActiveTrackProperty(QStringLiteral("kdenlive:audio_rec")).toInt() == 1);
for (auto ac : audioActions) {
ac->setVisible(true);
if (ac->data().toString() == QLatin1String("show_track_record")) {
ac->setChecked(m_proxy->getActiveTrackProperty(QStringLiteral("kdenlive:audio_rec")).toInt() == 1);
}
}
}
m_headerMenu->popup(m_clickPos);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment