New tentative interface

v0.6
audoban 8 years ago committed by Michail Vourlakos
parent 699b0ac935
commit 4d5455c89d

@ -1,11 +1,11 @@
#ifndef VISIBILITYMANAGER_H #ifndef VISIBILITYMANAGER_H
#define VISIBILITYMANAGER_H #define VISIBILITYMANAGER_H
#include <QObject>
#include "../liblattedock/dock.h"
#include "abstractinterface.h" #include "abstractinterface.h"
#include "plasmaquick/containmentview.h" #include "plasmaquick/containmentview.h"
#include "../liblattedock/dock.h"
#include <QObject>
#include <QTimer> #include <QTimer>
#include <Plasma/Containment> #include <Plasma/Containment>
@ -13,90 +13,64 @@
class VisibilityManager : public QObject { class VisibilityManager : public QObject {
Q_OBJECT Q_OBJECT
Q_PROPERTY(bool disableHiding READ disableHiding WRITE setDisableHiding NOTIFY disableHidingChanged) Q_PROPERTY(Latte::Dock::Visibility mode READ mode WRITE setMode NOTIFY modeChanged)
//Q_PROPERTY(bool immutable READ immutable WRITE setImmutable NOTIFY immutableChanged) Q_PROPERTY(int timerShow READ timerShow WRITE setTimerShow NOTIFY timerShowChanged)
Q_PROPERTY(bool isAutoHidden READ isAutoHidden WRITE setIsAutoHidden NOTIFY isAutoHiddenChanged) Q_PROPERTY(int timerHide READ timerHide WRITE setTimerHide NOTIFY timerHideChanged)
Q_PROPERTY(bool isDockWindowType READ isDockWindowType WRITE setIsDockWindowType NOTIFY isDockWindowTypeChanged) Q_PROPERTY(Latte::Dock::VisibilityState state READ state WRITE setState NOTIFY stateChanged)
Q_PROPERTY(bool isHovered READ isHovered NOTIFY isHoveredChanged)
Q_PROPERTY(bool windowInAttention READ windowInAttention WRITE setWindowInAttention NOTIFY windowInAttentionChanged)
Q_PROPERTY(Latte::Dock::Visibility panelVisibility READ panelVisibility WRITE setPanelVisibility NOTIFY panelVisibilityChanged)
public: public:
explicit VisibilityManager(PlasmaQuick::ContainmentView *view); explicit VisibilityManager(PlasmaQuick::ContainmentView *view);
~VisibilityManager(); virtual ~VisibilityManager();
bool disableHiding() const; Latte::Dock::Visibility mode() const;
void setDisableHiding(bool state); void setMode(Latte::Dock::Visibility mode);
bool isAutoHidden() const; int timerShow() const;
void setIsAutoHidden(bool state); void setTimerShow(int msec);
bool isDockWindowType() const; int timerHide() const;
void setIsDockWindowType(bool state); void setTimerHide(int msec);
bool isHovered() const; /**
* @brief show, change state to Dock::Visible when show timer is triggered.
bool windowInAttention() const; */
Q_INVOKABLE void show();
Latte::Dock::Visibility panelVisibility() const;
void setContainment(Plasma::Containment *contaiment); /**
void setMaskArea(QRect area); * @brief showImmediately, same that show, but without timer
void setPanelVisibility(Latte::Dock::Visibility state); */
Q_INVOKABLE void showImmediately();
public slots:
Q_INVOKABLE void initialize(); /**
Q_INVOKABLE void showNormal(); * @brief restore, change to last state, respecting the timers.
Q_INVOKABLE void showOnTop(); */
Q_INVOKABLE void showOnTopCheck(); Q_INVOKABLE void restore();
Q_INVOKABLE void showOnBottom();
bool event(QEvent *event); /**
void setWindowInAttention(bool state); * @brief showTemporarily, same that show but restores last state automatically
void updateVisibilityFlags(); * @param msec, timeout before restoring
*/
Q_SIGNALS: Q_INVOKABLE void showTemporarily(int msec);
void disableHidingChanged();
void isAutoHiddenChanged(); /**
void isDockWindowTypeChanged(); * @brief updateDockGeometry, the geometry should be inside screen, not into window.
void isHoveredChanged(); */
void mustBeLowered(); //are used to triger the sliding animations from the qml part void updateDockGeometry(QRect &geometry);
void mustBeRaised();
void mustBeRaisedImmediately(); signals:
void panelVisibilityChanged(); /**
void windowInAttentionChanged(); * @brief mouseEntered, emitted when mouse enters the dock
*/
private Q_SLOTS: void mouseEntered();
void activeWindowChanged();
//void compositingChanged(); /**
void updateState(); * @brief mouseExited, emitted when mouse leaves the dock
void initWindow(); */
void setIsHovered(bool state); void mouseExited();
//void screenChanged(QScreen *screen);
//void setScreenGeometry(QRect geometry); void modeChanged();
//void updateWindowPosition(); void timerShowChanged();
void timerHideChanged();
private: void stateChanged();
bool m_disableHiding;
bool m_isAutoHidden;
bool m_isDockWindowType;
bool m_isHovered;
//second pass of the initialization
bool m_secondInitPass;
bool m_windowIsInAttention;
int m_childrenLength;
QRect m_maskArea;
QTimer m_initTimer;
QTimer m_updateStateTimer;
Plasma::Containment *m_containment;
PlasmaQuick::ContainmentView *m_view;
NowDock::AbstractInterface *m_interface;
Latte::Dock::Visibility m_panelVisibility;
}; };
#endif // VISIBILITYMANAGER_H
#endif

Loading…
Cancel
Save