Commit 9abdc258 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Remove strange behavior clip properties icon in bin toolbar, make clip...

Remove strange behavior clip properties icon in bin toolbar, make clip properties widget behave like any other
BUG: 366103
parent 2eefeaa0
......@@ -1568,13 +1568,13 @@ void Bin::contextMenuEvent(QContextMenuEvent *event)
m_reloadAction->setEnabled(enableClipActions);
m_locateAction->setEnabled(enableClipActions);
m_duplicateAction->setEnabled(enableClipActions);
m_editAction->setVisible(!isFolder);
m_clipsActionsMenu->setEnabled(enableClipActions);
m_extractAudioAction->setEnabled(enableClipActions);
m_renameFolderAction->setVisible(isFolder);
m_openAction->setVisible(!isFolder);
m_reloadAction->setVisible(!isFolder);
m_duplicateAction->setVisible(!isFolder);
m_editAction->setVisible(!isFolder);
m_inTimelineAction->setVisible(!isFolder);
if (m_transcodeAction) {
m_transcodeAction->setEnabled(enableClipActions);
......@@ -1640,14 +1640,8 @@ void Bin::slotItemDoubleClicked(const QModelIndex &ix, const QPoint pos)
showSlideshowWidget(clip);
} else if (clip->clipType() == QText) {
ClipCreationDialog::createQTextClip(m_doc, getFolderInfo(), this, clip);
} else if (!m_editAction->isChecked()) {
m_editAction->trigger();
} else {
// Check if properties panel is not tabbed under Bin
if (!pCore->window()->isTabbedWith(m_propertiesDock, QStringLiteral("project_bin"))) {
m_propertiesDock->show();
m_propertiesDock->raise();
}
slotSwitchClipProperties(ix);
}
}
}
......@@ -1679,12 +1673,8 @@ void Bin::slotEditClip()
}
}
void Bin::slotSwitchClipProperties(bool display)
void Bin::slotSwitchClipProperties()
{
m_propertiesDock->toggleViewAction()->trigger();
if (display) {
m_propertiesDock->raise();
}
QModelIndex current = m_proxyModel->selectionModel()->currentIndex();
slotSwitchClipProperties(current);
}
......@@ -1701,6 +1691,11 @@ void Bin::slotSwitchClipProperties(const QModelIndex &ix)
else {
m_propertiesPanel->setEnabled(false);
}
// Check if properties panel is not tabbed under Bin
if (!pCore->window()->isTabbedWith(m_propertiesDock, QStringLiteral("project_bin"))) {
m_propertiesDock->show();
m_propertiesDock->raise();
}
}
void Bin::doRefreshPanel(const QString &id)
......@@ -1981,12 +1976,10 @@ void Bin::setupMenu(QMenu *addMenu, QAction *defaultAction, QHash <QString, QAct
m_deleteAction = actions.value(QStringLiteral("delete"));
m_toolbar->insertAction(first, m_deleteAction);
m_editAction = actions.value(QStringLiteral("properties"));
m_toolbar->insertAction(m_deleteAction, m_editAction);
QAction *folder = actions.value(QStringLiteral("folder"));
m_toolbar->insertAction(m_editAction, folder);
m_toolbar->insertAction(m_deleteAction, folder);
m_editAction = actions.value(QStringLiteral("properties"));
m_openAction = actions.value(QStringLiteral("open"));
m_reloadAction = actions.value(QStringLiteral("reload"));
m_duplicateAction = actions.value(QStringLiteral("duplicate"));
......@@ -2002,7 +1995,6 @@ void Bin::setupMenu(QMenu *addMenu, QAction *defaultAction, QHash <QString, QAct
m_toolbar->insertWidget(folder, m_addButton);
m_menu = new QMenu();
m_propertiesDock = pCore->window()->addDock(i18n("Clip Properties"), "clip_properties", m_propertiesPanel);
connect(m_propertiesDock->toggleViewAction(), &QAction::toggled, m_editAction, &QAction::setChecked);
m_propertiesDock->close();
//m_menu->addActions(addMenu->actions());
}
......
......@@ -597,7 +597,7 @@ public slots:
void slotDeleteClip();
void slotItemDoubleClicked(const QModelIndex &ix, const QPoint pos);
void slotSwitchClipProperties(const QModelIndex &ix);
void slotSwitchClipProperties(bool display = true);
void slotSwitchClipProperties();
/** @brief Creates a new folder with optional name, and returns new folder's id */
QString slotAddFolder(const QString &folderName = QString());
void slotCreateProjectClip();
......@@ -683,11 +683,11 @@ private:
QIcon m_blankThumb;
QMenu *m_menu;
QAction *m_openAction;
QAction *m_editAction;
QAction *m_reloadAction;
QAction *m_duplicateAction;
QAction *m_locateAction;
QAction *m_proxyAction;
QAction *m_editAction;
QAction *m_deleteAction;
QAction *m_renameFolderAction;
QMenu *m_jobsMenu;
......
......@@ -1434,9 +1434,8 @@ void MainWindow::setupActions()
QAction *addFolder = addAction(QStringLiteral("add_folder"), i18n("Create Folder"), pCore->bin(), SLOT(slotAddFolder()), KoIconUtils::themedIcon(QStringLiteral("folder-new")));
addClips->addAction(addAction(QStringLiteral("download_resource"), i18n("Online Resources"), this, SLOT(slotDownloadResources()), KoIconUtils::themedIcon(QStringLiteral("edit-download"))));
QAction *clipProperties = addAction(QStringLiteral("clip_properties"), i18n("Clip Properties"), pCore->bin(), SLOT(slotSwitchClipProperties(bool)), KoIconUtils::themedIcon(QStringLiteral("document-edit")));
clipProperties->setCheckable(true);
QAction *clipProperties = addAction(QStringLiteral("clip_properties"), i18n("Clip Properties"), pCore->bin(), SLOT(slotSwitchClipProperties()), KoIconUtils::themedIcon(QStringLiteral("document-edit")));
clipProperties->setData("clip_properties");
QAction *openClip = addAction(QStringLiteral("edit_clip"), i18n("Edit Clip"), pCore->bin(), SLOT(slotOpenClip()), KoIconUtils::themedIcon(QStringLiteral("document-open")));
......
......@@ -341,7 +341,7 @@ ClipPropertiesController::ClipPropertiesController(Timecode tc, ClipController *
connect(box, SIGNAL(toggled(bool)), spin2, SLOT(setEnabled(bool)));
vbox->addLayout(hlay);
}
if (m_type == AV || m_type == Video) {
QLocale locale;
......@@ -455,7 +455,7 @@ ClipPropertiesController::ClipPropertiesController(Timecode tc, ClipController *
connect(spinI, SIGNAL(valueChanged(int)), this, SLOT(slotValueChanged(int)));
hlay->addWidget(spinI);
vbox->addLayout(hlay);
//Audio index
QString aix = m_properties.get("audio_index");
m_originalProperties.insert(QStringLiteral("audio_index"), aix);
......@@ -514,16 +514,16 @@ ClipPropertiesController::ClipPropertiesController(Timecode tc, ClipController *
m_forcePage->setLayout(vbox);
vbox->addStretch(10);
m_tabWidget->addTab(m_propertiesPage, QString());
m_tabWidget->addTab(m_markersPage, QString());
m_tabWidget->addTab(m_forcePage, QString());
m_tabWidget->addTab(m_markersPage, QString());
m_tabWidget->addTab(m_metaPage, QString());
m_tabWidget->addTab(m_analysisPage, QString());
m_tabWidget->setTabIcon(0, KoIconUtils::themedIcon(QStringLiteral("edit-find")));
m_tabWidget->setTabToolTip(0, i18n("Properties"));
m_tabWidget->setTabIcon(1, KoIconUtils::themedIcon(QStringLiteral("bookmark-new")));
m_tabWidget->setTabToolTip(1, i18n("Markers"));
m_tabWidget->setTabIcon(2, KoIconUtils::themedIcon(QStringLiteral("document-edit")));
m_tabWidget->setTabToolTip(2, i18n("Force properties"));
m_tabWidget->setTabIcon(1, KoIconUtils::themedIcon(QStringLiteral("document-edit")));
m_tabWidget->setTabToolTip(1, i18n("Force properties"));
m_tabWidget->setTabIcon(2, KoIconUtils::themedIcon(QStringLiteral("bookmark-new")));
m_tabWidget->setTabToolTip(2, i18n("Markers"));
m_tabWidget->setTabIcon(3, KoIconUtils::themedIcon(QStringLiteral("view-grid")));
m_tabWidget->setTabToolTip(3, i18n("Metadata"));
m_tabWidget->setTabIcon(4, KoIconUtils::themedIcon(QStringLiteral("visibility")));
......
Supports Markdown
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