Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Detach window #3532

Open
wants to merge 23 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cff1bfb
Allow detaching subwindows
lukas-w Apr 28, 2017
4b3bf9f
Subwindows: Fix some size constraints
lukas-w Apr 29, 2017
4cba419
Subwindow detach: Fix minor pos & size issues
lukas-w May 5, 2017
4ff297b
Fix some bugs
PhysSong May 25, 2018
5cf83e1
Merge branch 'master' into feature/detach-window
PhysSong Mar 3, 2022
d6c1067
Merge branch 'master' into feature/detach-window
PhysSong Jun 18, 2022
5a84cd6
Merge remote-tracking branch 'upstream/master' into feature/detach-wi…
PhysSong Jul 30, 2022
f5f926e
Merge branch 'master' into feature/detach-window
PhysSong Nov 11, 2022
059be51
Merge branch 'master' into feature/detach-window
messmerd Nov 19, 2023
02d753d
Fix style; Use lambda to reduce duplicate code
messmerd Nov 19, 2023
2fd7df8
Refactor; Fix close event for editor windows
messmerd Nov 19, 2023
2043cac
Fix Windows build
messmerd Nov 19, 2023
bf922af
Prevent resizing in detached Mixer and Sample Track windows
messmerd Dec 18, 2023
a8fddfc
fix detached windows being shown after toggleVisibility() is called (…
messmerd Nov 17, 2024
bae8d84
Merge branch 'master' into feature/detach-window
lukas-w Nov 17, 2024
114ae56
fix wrong embedded rack constrains (resulting in add button not displ…
SpomJ Nov 17, 2024
72385ad
Prevent resizing detached instrument windows
SpomJ Nov 17, 2024
041bdf8
Fix microtuner config window being unable to closed while detached
SpomJ Nov 18, 2024
9961644
Transition SimpleTextFloat to QToolTip to enable displaying it outsid…
SpomJ Nov 20, 2024
adce178
fix windows doing offscreen when attached on wayland (#7592)
SpomJ Nov 21, 2024
c85b498
[feature/detach-window] Transfer size restrictions to embedded widget…
SpomJ Dec 3, 2024
eb38b16
Merge branch 'master' into feature/detach-window
messmerd Feb 3, 2025
439e9d3
Fix regression from merge
messmerd Feb 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions data/themes/default/window.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 4 additions & 17 deletions include/ControllerDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@
#ifndef LMMS_GUI_CONTROLLER_DIALOG_H
#define LMMS_GUI_CONTROLLER_DIALOG_H

#include <QWidget>

#include "DetachableWidget.h"
#include "ModelView.h"

namespace lmms
Expand All @@ -38,24 +37,12 @@ class Controller;
namespace gui
{

class ControllerDialog : public QWidget, public ModelView
class ControllerDialog : public DetachableWidget, public ModelView
{
Q_OBJECT
public:
ControllerDialog( Controller * _controller, QWidget * _parent );

ControllerDialog(Controller* controller, QWidget* parent);
~ControllerDialog() override = default;


signals:
void closed();


protected:
void closeEvent( QCloseEvent * _ce ) override;

} ;

};

} // namespace gui

Expand Down
12 changes: 2 additions & 10 deletions include/ControllerRackView.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,14 @@
#ifndef LMMS_GUI_CONTROLLER_RACK_VIEW_H
#define LMMS_GUI_CONTROLLER_RACK_VIEW_H

#include <QWidget>
#include <QCloseEvent>

#include "DetachableWidget.h"
#include "SerializingObject.h"
#include "lmms_basics.h"


class QPushButton;
class QScrollArea;
class QVBoxLayout;


namespace lmms
{

Expand All @@ -47,8 +43,7 @@ namespace gui

class ControllerView;


class ControllerRackView : public QWidget, public SerializingObject
class ControllerRackView : public DetachableWidget, public SerializingObject
{
Q_OBJECT
public:
Expand All @@ -71,9 +66,6 @@ public slots:
void addController(Controller* controller);
void removeController(Controller* controller);

protected:
void closeEvent( QCloseEvent * _ce ) override;

private slots:
void addController();

Expand Down
49 changes: 49 additions & 0 deletions include/DetachableWidget.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* DetachableWidget.h - Allows a widget to be detached from
* LMMS's main window
*
* Copyright (c) 2023 Dalton Messmer <messmer.dalton/at/gmail.com>
*
* This file is part of LMMS - https://lmms.io
*
* 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 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/

#ifndef LMMS_GUI_DETACHABLE_WIDGET
#define LMMS_GUI_DETACHABLE_WIDGET

#include <QWidget>

#include "lmms_export.h"

namespace lmms::gui {

class LMMS_EXPORT DetachableWidget : public QWidget
{
Q_OBJECT
public:
using QWidget::QWidget;

void closeEvent(QCloseEvent* ce) override;

signals:
void closed();
};

} // namespace lmms::gui

#endif // LMMS_GUI_DETACHABLE_WIDGET
49 changes: 49 additions & 0 deletions include/DetachableWindow.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/*
* DetachableWindow.h - Allows a window to be detached from
* LMMS's main window
*
* Copyright (c) 2023 Dalton Messmer <messmer.dalton/at/gmail.com>
*
* This file is part of LMMS - https://lmms.io
*
* 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 2 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program (see COPYING); if not, write to the
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
*/

#ifndef LMMS_GUI_DETACHABLE_WINDOW
#define LMMS_GUI_DETACHABLE_WINDOW

#include <QMainWindow>

#include "lmms_export.h"

namespace lmms::gui {

class LMMS_EXPORT DetachableWindow : public QMainWindow
{
Q_OBJECT
public:
using QMainWindow::QMainWindow;

void closeEvent(QCloseEvent* ce) override;

signals:
void closed();
};

} // namespace lmms::gui

#endif // LMMS_GUI_DETACHABLE_WINDOW
6 changes: 3 additions & 3 deletions include/Editor.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@
#ifndef LMMS_GUI_EDITOR_H
#define LMMS_GUI_EDITOR_H

#include <QMainWindow>
#include <QToolBar>

#include "DetachableWindow.h"

class QAction;

namespace lmms::gui
Expand All @@ -45,7 +46,7 @@ class DropToolBar;
///
/// Those editors include the Song Editor, the Automation Editor, B&B Editor,
/// and the Piano Roll.
class Editor : public QMainWindow
class Editor : public DetachableWindow
{
Q_OBJECT
public:
Expand All @@ -56,7 +57,6 @@ class Editor : public QMainWindow
DropToolBar * addDropToolBar(Qt::ToolBarArea whereToAdd, QString const & windowTitle);
DropToolBar * addDropToolBar(QWidget * parent, Qt::ToolBarArea whereToAdd, QString const & windowTitle);

void closeEvent(QCloseEvent * event) override;
protected slots:
virtual void play() {}
virtual void record() {}
Expand Down
23 changes: 6 additions & 17 deletions include/EffectControlDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,39 +26,28 @@
#ifndef LMMS_GUI_EFFECT_CONTROL_DIALOG_H
#define LMMS_GUI_EFFECT_CONTROL_DIALOG_H

#include <QWidget>

#include "DetachableWidget.h"
#include "ModelView.h"

namespace lmms
{

class EffectControls;


namespace gui
{

class LMMS_EXPORT EffectControlDialog : public QWidget, public ModelView
class LMMS_EXPORT EffectControlDialog : public DetachableWidget, public ModelView
{
Q_OBJECT
public:
EffectControlDialog( EffectControls * _controls );
EffectControlDialog(EffectControls* controls);
~EffectControlDialog() override = default;

virtual bool isResizable() const {return false;}


signals:
void closed();

virtual bool isResizable() const { return false; }

protected:
void closeEvent( QCloseEvent * _ce ) override;

EffectControls * m_effectControls;

} ;
EffectControls* m_effectControls;
};

} // namespace gui

Expand Down
8 changes: 2 additions & 6 deletions include/MicrotunerConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,9 @@
#ifndef LMMS_GUI_MICROTUNER_CONFIG_H
#define LMMS_GUI_MICROTUNER_CONFIG_H

#include <QWidget>

#include "AutomatableModel.h"
#include "ComboBoxModel.h"
#include "DetachableWidget.h"
#include "SerializingObject.h"

class QLineEdit;
Expand All @@ -38,7 +37,7 @@ namespace lmms::gui
{


class LMMS_EXPORT MicrotunerConfig : public QWidget, public SerializingObject
class LMMS_EXPORT MicrotunerConfig : public DetachableWidget, public SerializingObject
{
Q_OBJECT
public:
Expand All @@ -59,9 +58,6 @@ public slots:
void updateScaleForm();
void updateKeymapForm();

protected:
void closeEvent(QCloseEvent *ce) override;

private slots:
bool loadScaleFromFile();
bool loadKeymapFromFile();
Expand Down
Loading
Loading