aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-terminal/TermWindow.h
blob: 5f583126754e7db8d835070ff0dd530dc08dd20f (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
//===========================================
//  Lumina-DE source code
//  Copyright (c) 2015, Ken Moore
//  Available under the 3-clause BSD license
//  See the LICENSE file for full details
//===========================================
#ifndef _LUMINA_DESKTOP_UTILITIES_TERMINAL_MAIN_WINDOW_H
#define _LUMINA_DESKTOP_UTILITIES_TERMINAL_MAIN_WINDOW_H

#include <QWidget>
#include <QPropertyAnimation>
#include <QTabWidget>
#include <QDir>
#include <QShortcut>
#include <QMouseEvent>
#include <QSettings>

class TermWindow : public QWidget{
	Q_OBJECT
public:
	TermWindow(QSettings *set);
	~TermWindow();

	void cleanup(); //called right before the window is closed
	void OpenDirs(QStringList);

	void setCurrentScreen(int num = 0);
	void setTopOfScreen(bool ontop);

public slots:
	void ShowWindow();
	void HideWindow();
	void CloseWindow();
	void ReShowWindow();

private:
	QTabWidget *tabWidget;
	QSettings *settings;
	QShortcut *hideS, *closeS, *newTabS, *closeTabS, *prevTabS, *nextTabS;
	int screennum;
	bool onTop, CLOSING;
	QPropertyAnimation *ANIM;
	int animRunning; //internal flag for what animation is currently running
	QTimer *activeTimer;

	//Calculate the window geometry necessary based on screen/location
	void CalculateGeom();
	QString GenerateTabID();

private slots:
	//Tab Interactions
	void New_Tab();
	void Close_Tab(int tab = -1);
	void Close_Tab(QString ID); //alternate form of the close routine - based on tab ID
	void Next_Tab();
	void Prev_Tab();
	void focusOnWidget();
	//Animation finishing
	void AnimFinished();
	//Window focus/active status changed
	void activeStatusChanged();

protected:
	void mouseMoveEvent(QMouseEvent*);

signals:
	void TerminalHidden();
	void TerminalVisible();
	void TerminalClosed();
	void TerminalFinished();
};

#endif
bgstack15