/* SPDX-FileCopyrightText: 2013 Marco Martin SPDX-License-Identifier: LGPL-2.0-or-later */ #pragma once #include #include #include #include "panelview.h" #include #include #include #include #include #include #include #include class PanelView; namespace Plasma { class Containment; } class PanelRulerView : public PlasmaQuick::PlasmaWindow { Q_OBJECT public: PanelRulerView(Plasma::Containment *interface, PanelView *panelView, PanelConfigView *mainConfigView); ~PanelRulerView() override; void syncPanelLocation(); protected: void showEvent(QShowEvent *ev) override; void focusOutEvent(QFocusEvent *ev) override; private: Plasma::Containment *m_containment; PanelView *m_panelView; PanelConfigView *m_mainConfigView; LayerShellQt::Window *m_layerWindow = nullptr; }; class PanelConfigView : public PlasmaQuick::PopupPlasmaWindow { Q_OBJECT Q_PROPERTY(PanelRulerView *panelRulerView READ panelRulerView CONSTANT) Q_PROPERTY(QRect geometry READ geometry NOTIFY geometryChanged) public: PanelConfigView(Plasma::Containment *interface, PanelView *panelView); ~PanelConfigView() override; void init(); PanelRulerView *panelRulerView(); QRect geometry() const; Q_INVOKABLE QScreen *screenFromWindow(QWindow *window) const; friend class PanelRulerView; protected: void keyPressEvent(QKeyEvent *ev) override; void showEvent(QShowEvent *ev) override; void hideEvent(QHideEvent *ev) override; void focusInEvent(QFocusEvent *ev) override; void moveEvent(QMoveEvent *ev) override; void resizeEvent(QResizeEvent *ev) override; public Q_SLOTS: void showAddWidgetDialog(); void addPanelSpacer(); protected Q_SLOTS: void syncGeometry(); Q_SIGNALS: void geometryChanged(const QRect &geometry); private: void focusVisibilityCheck(QWindow *focusWindow); Plasma::Containment *m_containment; QPointer m_panelView; QPointer m_focusWindow; std::unique_ptr m_panelRulerView; KSvg::FrameSvg::EnabledBorders m_enabledBorders = KSvg::FrameSvg::AllBorders; Plasma::Theme m_theme; QTimer m_screenSyncTimer; std::unique_ptr m_sharedQmlEngine; };