-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
49 lines (44 loc) · 1.26 KB
/
main.cpp
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
#include <QApplication>
#include <QCoreApplication>
#include <QDebug>
#include <QFont>
#include <QWidget>
#include <QDesktopWidget>
//#include <vncclient.h>
#include <mainwindow.h>
int main(int argc, char *argv[])
{
setenv("TERM", "konsole-256color", 1);
QApplication a(argc, argv);
a.setQuitOnLastWindowClosed(false);
MainWindow w1;
MainWindow w2;
QFont font = QApplication::font();
font.setFamily("Terminus");
font.setPointSize(6);
a.setFont(font);
QDesktopWidget *widget = QApplication::desktop();
qDebug() << "Number of screens:" << widget->screenCount();
for (int i = 0; i < widget->screenCount(); i++) {
qDebug() << "Geometry:" << widget->screenGeometry(i);
}
QRect rect = widget->screenGeometry(0);
w1.setFixedSize(rect.width(), rect.height());
w1.addMediaPlayer();
w1.add_terminal();
w1.add_tabbed_browser();
w1.tileSubWindows();
w1.show();
if (widget->screenCount() > 1) {
QRect rect = widget->screenGeometry(1);
w1.setOtherScreen(&w2);
w2.setOtherScreen(&w1);
w2.move(rect.width(), rect.y());
w2.setFixedSize(rect.width(), rect.height());
w2.addFileBrowser();
w2.tileSubWindows();
w2.show();
}
int r = a.exec();
return r;
}