mirror of
https://github.com/KDE/latte-dock.git
synced 2024-12-22 09:33:54 +03:00
60095bba3b
--This is a HUGE FEATURE and so important for multi-screens users. It is introduced as one single commit because it reimplements plenty of infrastructure changes and it will be easier to identify newly introduced bugs. --Users can now choose for their docks and panels to belong at various screen groups. The first two screen groups introduced are AllScreens and AllSecondayScreens. In the future it might be possible to provide CustomScreensGroup that the user will be able to define specific screens in which a dock or panel should be always present. --Current solution specifies an Original dock or panel and clones/copies itself automatically to other screens. So docks and panels in other screens are just real docks and panels that reference themselves to original docks and panels. --Clones are destroyed during layout startup and are automaticaly recreated. It is suggested to export your layouts through the official Layouts Editor in order to share them because in that case clones are not included in the new generated layout file. If in any case you do not this and you share your layout with any previous versions then your clones will just appear as separate docks and panels that belong to specific screens. --Automatic syncing was introduced in order to keep up-to-date the configuration of Original docks and panels with their referenced Clones. --Automatic syncing currently works for all docks and panels settings, for all normal applets configurations and for all subcontaiments configuration such as systrays. --Automatic syncing does not work for applets inside subcontainments such as Group Plasmoid. In such case it is suggested to configure your applets inside your Group Plasmoid in the original dock or panel and afterwards to trigger a recreation for the relevant clones --Manual recreation of clones is easily possible by just choosing the dock or panel to be OnPrimary or OnSpecificScreen and rechoosing afterwards the AllScreensGroup or AllSecondaryScreensGroup
97 lines
2.3 KiB
C++
97 lines
2.3 KiB
C++
/*
|
|
SPDX-FileCopyrightText: 2017 Smith AR <audoban@openmailbox.org>
|
|
SPDX-FileCopyrightText: 2017 Michail Vourlakos <mvourlakos@gmail.com>
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
*/
|
|
|
|
#ifndef CENTRALLAYOUT_H
|
|
#define CENTRALLAYOUT_H
|
|
|
|
// local
|
|
#include "genericlayout.h"
|
|
#include "../data/layoutdata.h"
|
|
#include "../wm/schemecolors.h"
|
|
|
|
// Qt
|
|
#include <QObject>
|
|
|
|
namespace Latte {
|
|
class Corona;
|
|
}
|
|
|
|
namespace Latte {
|
|
|
|
//! CentralLayout is a layout that is assigned to ALL Activities, FREE Activities or SPRECIFIC Activities.
|
|
//! It is a real running layout instance.
|
|
//!
|
|
//! It holds all the important settings in order to provide specific
|
|
//! behavior for the Activities is assigned at.
|
|
//! for example: activities for which its views should be shown,
|
|
//! if the maximized windows will be borderless,
|
|
//! if the layout will be shown at user layout contextmenu.
|
|
//!
|
|
|
|
class CentralLayout : public Layout::GenericLayout
|
|
{
|
|
Q_OBJECT
|
|
Q_PROPERTY(Latte::WindowSystem::SchemeColors *scheme READ scheme NOTIFY schemeChanged)
|
|
|
|
public:
|
|
CentralLayout(QObject *parent, QString layoutFile, QString layoutName = QString());
|
|
~CentralLayout() override;
|
|
|
|
bool initCorona() override;
|
|
|
|
bool disableBordersForMaximizedWindows() const;
|
|
void setDisableBordersForMaximizedWindows(bool disable);
|
|
|
|
bool showInMenu() const;
|
|
void setShowInMenu(bool show);
|
|
|
|
bool isForFreeActivities() const;
|
|
bool isOnAllActivities() const;
|
|
|
|
QStringList activities() const;
|
|
void setActivities(QStringList activities);
|
|
|
|
const QStringList appliedActivities() override;
|
|
Types::ViewType latteViewType(uint containmentId) const override;
|
|
|
|
Layout::Type type() const override;
|
|
Data::Layout data() const;
|
|
|
|
Latte::WindowSystem::SchemeColors *scheme() const;
|
|
|
|
public:
|
|
Q_INVOKABLE bool isCurrent() override;
|
|
|
|
signals:
|
|
void disableBordersForMaximizedWindowsChanged();
|
|
void schemeChanged();
|
|
void showInMenuChanged();
|
|
|
|
private slots:
|
|
void loadConfig();
|
|
void saveConfig();
|
|
|
|
void onSchemeFileChanged();
|
|
|
|
private:
|
|
void init();
|
|
void importLocalLayout(QString file);
|
|
|
|
void setScheme(Latte::WindowSystem::SchemeColors *_scheme);
|
|
|
|
private:
|
|
bool m_disableBordersForMaximizedWindows{false};
|
|
bool m_showInMenu{false};
|
|
QStringList m_activities;
|
|
|
|
Latte::WindowSystem::SchemeColors *m_scheme{nullptr};
|
|
};
|
|
|
|
}
|
|
|
|
#endif //CENTRALLAYOUT_H
|