aboutsummaryrefslogtreecommitdiff
path: root/lumina-desktop/LPanel.h
blob: f823b73d68df6e8db6e0a3f7a91063403d47f86f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
//===========================================
//  Lumina-DE source code
//  Copyright (c) 2012-2015, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
//  This is the generic class for creating a full-width panel that stays
//    on top of all other windows (top or bottom of the screen only)
//===========================================
#ifndef _LUMINA_DESKTOP_PANEL_H
#define _LUMINA_DESKTOP_PANEL_H

#include <QWidget>
#include <QBoxLayout>
#include <QSettings>
#include <QString>
#include <QStringList>
#include <QTimer>
#include <QMoveEvent>
#include <QDesktopWidget>
#include <QPainter>
#include <QPaintEvent>

#include "panel-plugins/NewPP.h"
#include "panel-plugins/LPPlugin.h"

#include <LuminaX11.h>
#include <LuminaOS.h>

class LPanel : public QWidget{
	Q_OBJECT
private:
	QBoxLayout *layout;
	QSettings *settings;
	QString PPREFIX; //internal prefix for all settings
	QDesktopWidget *screen;
	QWidget *bgWindow, *panelArea;
	QPoint hidepoint, showpoint; //for hidden panels: locations when hidden/visible
	bool defaultpanel, horizontal, hidden;
	int screennum;
	int panelnum;
	int viswidth;
	QList<LPPlugin*> PLUGINS;
	WId tmpID; //temporary window ID

public:
	LPanel(QSettings *file, int scr = 0, int num =0, QWidget *parent=0); //settings file, screen number, panel number
	~LPanel();

	int number(){
	  return panelnum;
	}

	QString prefix(){
	  return PPREFIX;
	}

	int visibleWidth(){
	  return viswidth;
	}
	void prepareToClose();
	void scalePanel(double xscale, double yscale);

public slots:
	void UpdatePanel();  //Load the settings file and update the panel appropriately
	void UpdateLocale(); //Locale Changed externally
	void UpdateTheme(); //Theme Changed externally

protected:
	void paintEvent(QPaintEvent *event);
	void enterEvent(QEvent *event);
	void leaveEvent(QEvent *event);
};

#endif
bgstack15