You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
115 lines
2.5 KiB
C
115 lines
2.5 KiB
C
5 years ago
|
/*
|
||
|
* 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 SUBCONFIGVIEW_H
|
||
|
#define SUBCONFIGVIEW_H
|
||
|
|
||
|
// local
|
||
|
#include "../../wm/windowinfowrap.h"
|
||
|
|
||
|
//Qt
|
||
|
#include <QObject>
|
||
|
#include <QPointer>
|
||
|
#include <QQuickView>
|
||
|
#include <QTimer>
|
||
|
|
||
|
// Plasma
|
||
|
#include <Plasma/FrameSvg>
|
||
|
|
||
|
namespace KWayland {
|
||
|
namespace Client {
|
||
|
class PlasmaShellSurface;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
namespace Latte {
|
||
|
class Corona;
|
||
|
class View;
|
||
|
}
|
||
|
|
||
|
|
||
|
namespace Latte {
|
||
|
namespace ViewPart {
|
||
|
|
||
|
class SubConfigView : public QQuickView
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
Q_PROPERTY(Plasma::FrameSvg::EnabledBorders enabledBorders READ enabledBorders NOTIFY enabledBordersChanged)
|
||
|
|
||
|
public:
|
||
|
SubConfigView(Latte::View *view, const QString &title);
|
||
|
~SubConfigView() override;
|
||
|
|
||
|
void requestActivate();
|
||
|
|
||
|
QString validTitle() const;
|
||
|
|
||
|
Plasma::FrameSvg::EnabledBorders enabledBorders() const;
|
||
|
|
||
|
Latte::View *parentView() const;
|
||
|
void setParentView(Latte::View *view);
|
||
|
|
||
|
public slots:
|
||
|
Q_INVOKABLE virtual void syncGeometry() = 0;
|
||
|
|
||
|
signals:
|
||
|
void enabledBordersChanged();
|
||
|
|
||
|
protected:
|
||
|
void syncSlideEffect();
|
||
|
|
||
|
void init();
|
||
|
void initParentView(Latte::View *view);
|
||
|
virtual void updateEnabledBorders() = 0;
|
||
|
|
||
|
bool event(QEvent *e) override;
|
||
|
|
||
|
Qt::WindowFlags wFlags() const;
|
||
|
|
||
|
private slots:
|
||
|
void updateWaylandId();
|
||
|
|
||
|
protected:
|
||
|
QPointer<Latte::View> m_latteView;
|
||
|
|
||
|
QList<QMetaObject::Connection> connections;
|
||
|
QList<QMetaObject::Connection> viewconnections;
|
||
|
|
||
|
Latte::Corona *m_corona{nullptr};
|
||
|
|
||
|
private:
|
||
|
void setupWaylandIntegration();
|
||
|
|
||
|
private:
|
||
|
QString m_validTitle;
|
||
|
|
||
|
QTimer m_screenSyncTimer;
|
||
|
QTimer m_thicknessSyncTimer;
|
||
|
|
||
|
Plasma::FrameSvg::EnabledBorders m_enabledBorders{Plasma::FrameSvg::AllBorders};
|
||
|
|
||
|
Latte::WindowSystem::WindowId m_waylandWindowId;
|
||
|
KWayland::Client::PlasmaShellSurface *m_shellSurface{nullptr};
|
||
|
};
|
||
|
|
||
|
}
|
||
|
}
|
||
|
#endif //SUBCONFIGVIEW_H
|
||
|
|