1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-24 17:33:50 +03:00
latte-dock/app/declarativeimports/interfaces.h
Michail Vourlakos ec949948b6 fix View recraetion and frameExtents freezes
--View recreation path was broken from new implementation
for Latte::Interfaces that pass objects to containment
interface. This is now fixed and Interfaces::View object is updated
and broadcasted correctly when changed
--when GtkFrameExtents are zeroed for behaveAsPlasmaPanels
then it is better to recreate the view to avoid freezes and
hidings of the view because of compositor strange behavior
2020-05-12 14:45:31 +03:00

87 lines
2.5 KiB
C++

/*
* Copyright 2020 Michail Vourlakos <mvourlakos@gmail.com>
*
* This file is part of Latte-Dock
*
* Latte-Dock 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.
*
* Latte-Dock 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. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef APPINTERFACES_H
#define APPINTERFACES_H
// Qt
#include <QObject>
// Plasma
#include <PlasmaQuick/AppletQuickItem>
namespace Latte{
class Interfaces: public QObject
{
Q_OBJECT
Q_PROPERTY(QObject *plasmoidInterface READ plasmoidInterface WRITE setPlasmoidInterface NOTIFY interfaceChanged)
Q_PROPERTY(QObject *globalShortcuts READ globalShortcuts NOTIFY globalShortcutsChanged)
Q_PROPERTY(QObject *layoutsManager READ layoutsManager NOTIFY layoutsManagerChanged)
Q_PROPERTY(QObject *themeExtended READ themeExtended NOTIFY themeExtendedChanged)
Q_PROPERTY(QObject *universalSettings READ universalSettings NOTIFY universalSettingsChanged)
Q_PROPERTY(QObject *view READ view NOTIFY viewChanged)
public:
explicit Interfaces(QObject *parent = nullptr);
QObject *globalShortcuts() const;
QObject *layoutsManager() const;
QObject *themeExtended() const;
QObject *universalSettings() const;
QObject *view() const;
QObject *plasmoidInterface() const;
void setPlasmoidInterface(QObject *interface);
public slots:
Q_INVOKABLE void updateView();
signals:
void interfaceChanged();
void globalShortcutsChanged();
void layoutsManagerChanged();
void themeExtendedChanged();
void universalSettingsChanged();
void viewChanged();
private:
void setGlobalShortcuts(QObject *shortcuts);
void setLayoutsManager(QObject *manager);
void setThemeExtended(QObject *theme);
void setUniversalSettings(QObject *settings);
void setView(QObject *view);
private:
QObject *m_globalShortcuts{nullptr};
QObject *m_layoutsManager{nullptr};
QObject *m_themeExtended{nullptr};
QObject *m_universalSettings{nullptr};
QObject *m_view{nullptr};
PlasmaQuick::AppletQuickItem *m_plasmoid{nullptr};
};
}
#endif