Core: Refactor handling of "window state" actions out of MainWindow

Currently the actions for fullscreen, minimize and zoom only apply to
the main window, even if a different window is active.
Refactor the handling of these actions into a WindowSupport class, and
use that instead for the main window. In a second step, this will be
used to add the functionality to the corresponding external windows
(e.g. help and editor windows)

Change-Id: Ief2c880f40948c3bb724196d6e0cfe888b8ece89
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Eike Ziller
2014-07-17 17:04:02 +02:00
parent 60d7b23d88
commit fe5b3a39e8
7 changed files with 222 additions and 56 deletions

View File

@@ -76,6 +76,7 @@ class ToolSettings;
class MimeTypeSettings;
class StatusBarManager;
class VersionDialog;
class WindowSupport;
class SystemEditor;
class MainWindow : public Utils::AppMainWindow
@@ -107,8 +108,6 @@ public:
void setOverrideColor(const QColor &color);
void updateFullScreenAction();
bool isNewItemDialogRunning() const;
signals:
@@ -119,7 +118,6 @@ public slots:
void newFile();
void openFileWith();
void exit();
void toggleFullScreen();
void showNewItemDialog(const QString &title,
const QList<IWizardFactory *> &factories,
@@ -167,6 +165,7 @@ private:
Context m_additionalContexts;
SettingsDatabase *m_settingsDatabase;
mutable QPrinter *m_printer;
WindowSupport *m_windowSupport;
ActionManager *m_actionManager;
EditorManager *m_editorManager;
ExternalToolManager *m_externalToolManager;
@@ -205,9 +204,6 @@ private:
QAction *m_optionsAction;
QAction *m_toggleSideBarAction;
QAction *m_toggleModeSelectorAction;
QAction *m_toggleFullScreenAction;
QAction *m_minimizeAction;
QAction *m_zoomAction;
QToolButton *m_toggleSideBarButton;
QColor m_overrideColor;