Don't resize mixer widget if tabbed

parent 5b4a2b80
......@@ -21,6 +21,8 @@
#include "mixermanager.hpp"
#include "mixerwidget.hpp"
#include "core.h"
#include "mainwindow.h"
#include "timeline2/model/timelineitemmodel.hpp"
#include "kdenlivesettings.h"
......@@ -199,7 +201,9 @@ void MixerManager::collapseMixers()
m_expandedWidth = width();
m_channelsBox->setFixedWidth(0);
//m_line->setMaximumWidth(0);
setFixedWidth(m_masterMixer->width() + 2 * m_box->contentsMargins().left());
if (!pCore->window()->isMixedTabbed()) {
setFixedWidth(m_masterMixer->width() + 2 * m_box->contentsMargins().left());
}
} else {
//m_line->setMaximumWidth(QWIDGETSIZE_MAX);
m_channelsBox->setMaximumWidth(QWIDGETSIZE_MAX);
......
......@@ -414,7 +414,7 @@ void MainWindow::init()
addAction(QStringLiteral("force_icon_theme"), iconAction);
connect(iconAction, &QAction::triggered, this, &MainWindow::forceIconSet);
QDockWidget *mixerDock = addDock(i18n("Audio Mixer"), QStringLiteral("mixer"), pCore->mixer());
m_mixerDock = addDock(i18n("Audio Mixer"), QStringLiteral("mixer"), pCore->mixer());
QAction *showMixer = new QAction(QIcon::fromTheme(QStringLiteral("view-media-equalizer")), i18n("Audio Mixer"), this);
showMixer->setCheckable(true);
addAction(QStringLiteral("audiomixer_button"), showMixer);
......@@ -426,15 +426,15 @@ void MainWindow::init()
if (mixerDock->isVisible() && !mixerDock->visibleRegion().isEmpty()) {
mixerDock->close();
} else {
mixerDock->show();
mixerDock->raise();
m_mixerDock->show();
m_mixerDock->raise();
}
});
// Close non-general docks for the initial layout
// only show important ones
m_undoViewDock->close();
mixerDock->close();
m_mixerDock->close();
/// Tabify Widgets
tabifyDockWidget(m_clipMonitorDock, m_projectMonitorDock);
......@@ -3699,9 +3699,13 @@ QDockWidget *MainWindow::addDock(const QString &title, const QString &objectName
return dockWidget;
}
bool MainWindow::isMixedTabbed() const
{
return !tabifiedDockWidgets(m_mixerDock).isEmpty();
}
void MainWindow::slotUpdateDockLocation(Qt::DockWidgetArea dockLocationArea)
{
qDebug()<<"== UPDATING DOCK LOCATION FOR: "<<dockLocationArea;
if (dockLocationArea == Qt::NoDockWidgetArea) {
updateDockTitleBars(false);
} else {
......@@ -3774,7 +3778,7 @@ void MainWindow::updateDockTitleBars(bool isTopLevel)
}
continue;
}
QList<QDockWidget *> docked = pCore->window()->tabifiedDockWidgets(dock);
QList<QDockWidget *> docked = tabifiedDockWidgets(dock);
if (docked.isEmpty()) {
if (bar) {
dock->setTitleBarWidget(nullptr);
......
......@@ -122,6 +122,9 @@ public:
QList<QAction *> getExtraActions(const QString &name);
/** @brief Returns true if docked widget is tabbed with another widget from its object name */
bool isTabbedWith(QDockWidget *widget, const QString &otherWidget);
/** @brief Returns true if mixer widget is tabbed */
bool isMixedTabbed() const;
/** @brief Returns a ptr to the main timeline widget of the project */
TimelineWidget *getMainTimeline() const;
......@@ -178,6 +181,7 @@ private:
AudioGraphSpectrum *m_audioSpectrum;
QDockWidget *m_undoViewDock;
QDockWidget *m_mixerDock;
KSelectAction *m_timeFormatButton;
KSelectAction *m_compositeAction;
......
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