Skip to content

Commit

Permalink
Squashed commit of the following:
Browse files Browse the repository at this point in the history
commit 60c0f65c5e3c2faf1f7b0ae10b4131dabbcf715b
Author: itsmattkc <34096995+itsmattkc@users.noreply.github.com>
Date:   Wed Feb 15 22:34:16 2023 -0800

    mainwindow: don't close last timeline panel when removing sequence

commit bc892810d67c1dd4f9c0639767c563681f29701d
Merge: 69051a120 aef08f8
Author: itsmattkc <34096995+itsmattkc@users.noreply.github.com>
Date:   Tue Feb 14 17:05:25 2023 -0800

    Merge branch 'master' into kddockwidgets

commit 69051a120b8423d0ad7b38def2f7555d323cd74d
Author: itsmattkc <34096995+itsmattkc@users.noreply.github.com>
Date:   Tue Feb 14 15:29:24 2023 -0800

    finished kddockwidgets integration

commit 9a39dbeade871a0b9454b424c7f7a7482671d40b
Author: itsmattkc <34096995+itsmattkc@users.noreply.github.com>
Date:   Tue Feb 14 11:54:25 2023 -0800

    switch to kddockwidgets
  • Loading branch information
itsmattkc committed Feb 16, 2023
1 parent 9a87b19 commit 25b6b07
Show file tree
Hide file tree
Showing 49 changed files with 246 additions and 325 deletions.
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,18 @@ if (${QT_VERSION_MAJOR} EQUAL "6")
list(APPEND OLIVE_LIBRARIES
Qt${QT_VERSION_MAJOR}::OpenGLWidgets
)

# Link KDDockWidgets
find_package(KDDockWidgets-qt6 CONFIG REQUIRED)
else()
# Link KDDockWidgets
find_package(KDDockWidgets CONFIG REQUIRED)
endif()

list(APPEND OLIVE_LIBRARIES
KDAB::kddockwidgets
)

# Link FFmpeg
find_package(FFMPEG 3.0 REQUIRED
COMPONENTS
Expand Down
9 changes: 9 additions & 0 deletions app/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,6 +752,15 @@ void Core::StartGUI(bool full_screen)
PanelManager::instance(),
&PanelManager::FocusChanged);

// Set KDDockWidgets flags
auto &config = KDDockWidgets::Config::self();
auto flags = config.flags();
flags |= KDDockWidgets::Config::Flag_TabsHaveCloseButton;
flags |= KDDockWidgets::Config::Flag_HideTitleBarWhenTabsVisible;
flags |= KDDockWidgets::Config::Flag_AlwaysShowTabs;
flags |= KDDockWidgets::Config::Flag_AllowReorderTabs;
config.setFlags(flags);

// Create main window and open it
main_window_ = new MainWindow();

Expand Down
6 changes: 3 additions & 3 deletions app/panel/audiomonitor/audiomonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ namespace olive {

#define super PanelWidget

AudioMonitorPanel::AudioMonitorPanel(QWidget *parent) :
super(QStringLiteral("AudioMonitor"), parent)
AudioMonitorPanel::AudioMonitorPanel() :
super(QStringLiteral("AudioMonitor"))
{
audio_monitor_ = new AudioMonitor();
audio_monitor_ = new AudioMonitor(this);

SetWidgetWithPadding(audio_monitor_);

Expand Down
2 changes: 1 addition & 1 deletion app/panel/audiomonitor/audiomonitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class AudioMonitorPanel : public PanelWidget
{
Q_OBJECT
public:
AudioMonitorPanel(QWidget* parent = nullptr);
AudioMonitorPanel();

bool IsPlaying() const
{
Expand Down
6 changes: 3 additions & 3 deletions app/panel/curve/curve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

namespace olive {

CurvePanel::CurvePanel(QWidget *parent) :
TimeBasedPanel(QStringLiteral("CurvePanel"), parent)
CurvePanel::CurvePanel() :
TimeBasedPanel(QStringLiteral("CurvePanel"))
{
// Create main widget and set it
SetTimeBasedWidget(new CurveWidget());
SetTimeBasedWidget(new CurveWidget(this));

// Set strings
Retranslate();
Expand Down
2 changes: 1 addition & 1 deletion app/panel/curve/curve.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CurvePanel : public TimeBasedPanel
{
Q_OBJECT
public:
CurvePanel(QWidget* parent);
CurvePanel();

virtual void DeleteSelected() override;

Expand Down
6 changes: 3 additions & 3 deletions app/panel/footageviewer/footageviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ namespace olive {

#define super ViewerPanelBase

FootageViewerPanel::FootageViewerPanel(QWidget *parent) :
super(QStringLiteral("FootageViewerPanel"), parent)
FootageViewerPanel::FootageViewerPanel() :
super(QStringLiteral("FootageViewerPanel"))
{
// Set ViewerWidget as the central widget
FootageViewerWidget* fvw = new FootageViewerWidget();
FootageViewerWidget* fvw = new FootageViewerWidget(this);
SetViewerWidget(fvw);

// Set strings
Expand Down
2 changes: 1 addition & 1 deletion app/panel/footageviewer/footageviewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace olive {
class FootageViewerPanel : public ViewerPanelBase, public FootageManagementPanel {
Q_OBJECT
public:
FootageViewerPanel(QWidget* parent);
FootageViewerPanel();

void OverrideWorkArea(const TimeRange &r);

Expand Down
6 changes: 3 additions & 3 deletions app/panel/multicam/multicampanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ namespace olive {

#define super TimeBasedPanel

MulticamPanel::MulticamPanel(QWidget *parent) :
super(QStringLiteral("MultiCamPanel"), parent)
MulticamPanel::MulticamPanel() :
super(QStringLiteral("MultiCamPanel"))
{
SetTimeBasedWidget(new MulticamWidget());
SetTimeBasedWidget(new MulticamWidget(this));

Retranslate();
}
Expand Down
2 changes: 1 addition & 1 deletion app/panel/multicam/multicampanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class MulticamPanel : public TimeBasedPanel
{
Q_OBJECT
public:
MulticamPanel(QWidget* parent = nullptr);
MulticamPanel();

MulticamWidget *GetMulticamWidget() const { return static_cast<MulticamWidget *>(GetTimeBasedWidget()); }

Expand Down
8 changes: 4 additions & 4 deletions app/panel/node/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@

namespace olive {

NodePanel::NodePanel(QWidget *parent) :
PanelWidget(QStringLiteral("NodePanel"), parent)
NodePanel::NodePanel() :
PanelWidget(QStringLiteral("NodePanel"))
{
node_widget_ = new NodeWidget();
connect(this, &NodePanel::visibilityChanged, node_widget_->view(), &NodeView::CenterOnItemsBoundingRect);
node_widget_ = new NodeWidget(this);
connect(this, &NodePanel::shown, node_widget_->view(), &NodeView::CenterOnItemsBoundingRect);

connect(node_widget_->view(), &NodeView::NodesSelected, this, &NodePanel::NodesSelected);
connect(node_widget_->view(), &NodeView::NodesDeselected, this, &NodePanel::NodesDeselected);
Expand Down
2 changes: 1 addition & 1 deletion app/panel/node/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class NodePanel : public PanelWidget
{
Q_OBJECT
public:
NodePanel(QWidget* parent);
NodePanel();

NodeWidget *GetNodeWidget() const
{
Expand Down
35 changes: 8 additions & 27 deletions app/panel/panel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,16 @@

namespace olive {

#define super QDockWidget
#define super KDDockWidgets::DockWidget

PanelWidget::PanelWidget(const QString &object_name, QWidget *parent) :
super(parent),
PanelWidget::PanelWidget(const QString &object_name) :
super(object_name),
border_visible_(false),
signal_instead_of_close_(false)
{
setObjectName(object_name);
setFocusPolicy(Qt::ClickFocus);

connect(this, &PanelWidget::visibilityChanged, this, &PanelWidget::PanelVisibilityChanged);
connect(this, &PanelWidget::shown, this, static_cast<void(PanelWidget::*)()>(&PanelWidget::setFocus));

PanelManager::instance()->RegisterPanel(this);
}
Expand All @@ -52,17 +51,6 @@ PanelWidget::~PanelWidget()
PanelManager::instance()->UnregisterPanel(this);
}

void PanelWidget::SetMovementLocked(bool locked)
{
if (locked) {
// Disable moving on QDockWidget
setFeatures(features() & ~QDockWidget::DockWidgetMovable);
} else {
// Re-enable moving on QDockWidget
setFeatures(features() | QDockWidget::DockWidgetMovable);
}
}

void PanelWidget::SetBorderVisible(bool enabled)
{
border_visible_ = enabled;
Expand Down Expand Up @@ -110,16 +98,9 @@ void PanelWidget::UpdateTitle()
// If there's no subtitle, just use the title. Otherwise, we set a formatted combination of the two that can
// differ based on translation
if (subtitle_.isEmpty()) {
setWindowTitle(title_);
this->setTitle(title_);
} else {
setWindowTitle(tr("%1: %2").arg(title_, subtitle_));
}
}

void PanelWidget::PanelVisibilityChanged(bool e)
{
if (e) {
setFocus();
this->setTitle(tr("%1: %2").arg(title_, subtitle_));
}
}

Expand All @@ -134,7 +115,7 @@ void PanelWidget::closeEvent(QCloseEvent *event)
event->ignore();
emit CloseRequested();
} else {
QDockWidget::closeEvent(event);
super::closeEvent(event);
}
}

Expand All @@ -143,7 +124,7 @@ void PanelWidget::changeEvent(QEvent *e)
if (e->type() == QEvent::LanguageChange) {
Retranslate();
}
QDockWidget::changeEvent(e);
super::changeEvent(e);
}

void PanelWidget::Retranslate()
Expand Down
14 changes: 3 additions & 11 deletions app/panel/panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#ifndef PANEL_WIDGET_H
#define PANEL_WIDGET_H

#include <QDockWidget>
#include <kddockwidgets/DockWidget.h>
#include <QEvent>

#include "common/define.h"
Expand All @@ -31,7 +31,7 @@ namespace olive {
/**
* @brief A widget that is always dockable within the MainWindow.
*/
class PanelWidget : public QDockWidget
class PanelWidget : public KDDockWidgets::DockWidget
{
Q_OBJECT
public:
Expand All @@ -43,15 +43,10 @@ class PanelWidget : public QDockWidget
* The PanelWidget's parent, enforced to help with memory handling. Most of the time this will be an instance of
* MainWindow.
*/
PanelWidget(const QString& object_name, QWidget* parent);
PanelWidget(const QString& object_name);

virtual ~PanelWidget() override;

/**
* @brief Set whether panel movement is locked or not
*/
void SetMovementLocked(bool locked);

/**
* @brief Set visibility of panel's highlighted border, mostly used for showing panel focus
*
Expand Down Expand Up @@ -246,9 +241,6 @@ protected slots:

bool signal_instead_of_close_;

private slots:
void PanelVisibilityChanged(bool e);

};

}
Expand Down
Loading

0 comments on commit 25b6b07

Please sign in to comment.