Commit bab3c98c authored by Julius Künzel's avatar Julius Künzel

Update src/dockareaorientationmanager.h, src/dockareaorientationmanager.cpp,...

Update src/dockareaorientationmanager.h, src/dockareaorientationmanager.cpp, src/kdenliveui.rc, src/mainwindow.cpp files
parent 76e793d4
/*
Copyright (C) 2020 Julius Künzel <jk.kdedev@smartlab.uber.space>
This file is part of Kdenlive. See www.kdenlive.org.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
#include "dockareaorientationmanager.h"
#include "core.h"
#include "mainwindow.h"
#include <klocalizedstring.h>
DockAreaOrientationManager::DockAreaOrientationManager(QObject *parent)
: QObject(parent)
{
m_verticalAction = new QAction(i18n("Arrange Dock Areas In Columns"), this);
pCore->window()->addAction(QStringLiteral("vertical_dockareaorientation"), m_verticalAction);
connect(m_verticalAction, &QAction::triggered, this, &DockAreaOrientationManager::slotVerticalOrientation);
m_horizontalAction = new QAction(i18n("Arrange Dock Areas In Rows"), this);
pCore->window()->addAction(QStringLiteral("horizontal_dockareaorientation"), m_horizontalAction);
connect(m_horizontalAction, &QAction::triggered, this, &DockAreaOrientationManager::slotHorizontalOrientation);
}
void DockAreaOrientationManager::slotVerticalOrientation()
{
// Use the corners for left and right DockWidgetArea
pCore->window()->setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
pCore->window()->setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
pCore->window()->setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
pCore->window()->setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
}
void DockAreaOrientationManager::slotHorizontalOrientation()
{
// Use the corners for top and bottom DockWidgetArea
pCore->window()->setCorner(Qt::TopRightCorner, Qt::TopDockWidgetArea);
pCore->window()->setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea);
pCore->window()->setCorner(Qt::TopLeftCorner, Qt::TopDockWidgetArea);
pCore->window()->setCorner(Qt::BottomLeftCorner, Qt::BottomDockWidgetArea);
}
/*
Copyright (C) 2020 Julius Künzel <jk.kdedev@smartlab.uber.space>
This file is part of Kdenlive. See www.kdenlive.org.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
*/
#ifndef DOCKAREAORIENTATIONMANAGER_H
#define DOCKAREAORIENTATIONMANAGER_H
#include <QObject>
class QAction;
/**
* @class DockAreaOrientationManager
* @brief Handles functionality to set the orientation of the DockWidgetAreas
*/
class DockAreaOrientationManager : public QObject
{
Q_OBJECT
public:
explicit DockAreaOrientationManager(QObject *parent = nullptr);
private:
QAction *m_verticalAction;
QAction *m_horizontalAction;
private slots:
void slotVerticalOrientation();
void slotHorizontalOrientation();
};
#endif
<!DOCTYPE kpartgui SYSTEM "kpartgui.dtd">
<kpartgui name="kdenlive" version="186" translationDomain="kdenlive">
<kpartgui name="kdenlive" version="187" translationDomain="kdenlive">
<MenuBar>
<Menu name="file" >
<Action name="file_save"/>
......@@ -238,6 +238,10 @@
<Action name="save_layout4" />
</Menu>
<Action name="load_layouts" />
<Menu name="dockareaoriantation" ><text>Dock Area Orientation</text>
<Action name="vertical_dockareaorientation" />
<Action name="horizontal_dockareaorientation" />
</Menu>
<Action name="show_titlebars" />
<Separator />
<ActionList name="dock_actions" />
......
......@@ -31,6 +31,7 @@
#include "dialogs/wizard.h"
#include "doc/docundostack.hpp"
#include "doc/kdenlivedoc.h"
#include "dockareaorientationmanager.h"
#include "effects/effectlist/view/effectlistwidget.hpp"
#include "effectslist/effectbasket.h"
#include "hidetitlebars.h"
......@@ -440,12 +441,6 @@ void MainWindow::init()
tabifyDockWidget(m_effectStackDock, pCore->bin()->clipPropertiesDock());
bool firstRun = readOptions();
// Use the corners for left and right DockWidgetArea
setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
// Build effects menu
m_effectsMenu = new QMenu(i18n("Add Effect"), this);
m_effectActions = new KActionCategory(i18n("Effects"), actionCollection());
......@@ -458,6 +453,7 @@ void MainWindow::init()
new LayoutManagement(this);
new HideTitleBars(this);
new DockAreaOrientationManager(this);
m_extraFactory = new KXMLGUIClient(this);
buildDynamicActions();
......
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