forked from BGmot/BGShellBB10
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mysystemmenu.cpp
66 lines (57 loc) · 1.78 KB
/
mysystemmenu.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* Copyright (C) 2013 BGmot <[email protected]>
*/
#include "qtermwidget.h"
#include "mysystemmenu.h"
#include "mydonatewindow.h"
#include "mysettingswindow.h"
CMySystemMenu::CMySystemMenu(QWidget *parent) :
QWidget(parent)
{
wdgSettingsWindow = NULL;
wdgDonateWindow = NULL;
setVisible(false);
//setWindowModality(Qt::ApplicationModal);
}
// There is nothing to comment here, all button names tell you what they do
int CMySystemMenu::MenuInit(){
btnSettings = new QToolButton(this);
btnSettings->setObjectName(QString::fromUtf8("btnSettings"));
btnSettings->setText(QString("Settings"));
btnDonate = new QToolButton(this);
btnDonate->setObjectName(QString::fromUtf8("btnDonate"));
btnDonate->setText(QString("Say Thanks"));
// For now disable donations
//btnDonate->setVisible(false);
QMetaObject::connectSlotsByName(this);
SetGeometry();
return 0;
}
void CMySystemMenu::SetGeometry(){
QRect r = QApplication::desktop()->screenGeometry(0);
int nScreenWidth = r.width();
this->setGeometry(0, 0, nScreenWidth, 103);
QBrush brush1(QColor(76, 76, 76, 255));
brush1.setStyle(Qt::SolidPattern);
QPalette palette;
palette.setBrush(QPalette::Active, QPalette::Window, brush1);
this->setAutoFillBackground(true);
btnSettings->setGeometry(QRect(2, 1, nScreenWidth/2-2, 101));
btnDonate ->setGeometry(QRect(nScreenWidth/2+2, 1, nScreenWidth/2-4, 101));
}
void CMySystemMenu::on_btnSettings_clicked(){
if (!wdgSettingsWindow){
wdgSettingsWindow = new CMySettingsWindow((QWidget*)this->parent());
wdgSettingsWindow->Init();
wdgSettingsWindow->show();
}
return;
}
void CMySystemMenu::on_btnDonate_clicked(){
if (!wdgDonateWindow){
wdgDonateWindow = new CMyDonateWindow((QWidget*)this->parent());
wdgDonateWindow->Init();
}
wdgDonateWindow->show();
return;
}