Added Calculator launch button in Apps

This commit is contained in:
Nicolas Mailloux 2021-04-13 10:23:12 -04:00
parent 40ca616eee
commit 342bc91f0f
3 changed files with 75 additions and 41 deletions

View file

@ -18,6 +18,7 @@ apps::apps(QWidget *parent) :
ui->lightmapsLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
ui->calendarLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
ui->savedWordsLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
ui->calculatorLaunchBtn->setStyleSheet("background: lightGrey; font-size: 9pt; padding: 8px");
QFile stylesheetFile(":/resources/eink.qss");
stylesheetFile.open(QFile::ReadOnly);
@ -62,3 +63,10 @@ void apps::on_calendarLaunchBtn_clicked()
calendarWindow->setAttribute(Qt::WA_DeleteOnClose);
calendarWindow->showFullScreen();
}
void apps::on_calculatorLaunchBtn_clicked()
{
QProcess process;
process.startDetached("calculator", QStringList());
qApp->quit();
}

1
apps.h
View file

@ -23,6 +23,7 @@ private slots:
void on_lightmapsLaunchBtn_clicked();
void on_savedWordsLaunchBtn_clicked();
void on_calendarLaunchBtn_clicked();
void on_calculatorLaunchBtn_clicked();
private:
Ui::apps *ui;

107
apps.ui
View file

@ -85,6 +85,18 @@ Back
<property name="bottomMargin">
<number>0</number>
</property>
<item row="3" column="1">
<widget class="QPushButton" name="savedWordsLaunchBtn">
<property name="font">
<font>
<family>Inter</family>
</font>
</property>
<property name="text">
<string>Launch</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="calendarLabel">
<property name="font">
@ -98,19 +110,6 @@ Back
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Light Maps</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QPushButton" name="calendarLaunchBtn">
<property name="font">
@ -123,32 +122,6 @@ Back
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="scribbleLaunchBtn">
<property name="font">
<font>
<family>Inter</family>
<italic>false</italic>
</font>
</property>
<property name="text">
<string>Launch</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="scribbleLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Scribble</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QPushButton" name="lightmapsLaunchBtn">
<property name="font">
@ -175,8 +148,60 @@ Back
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QPushButton" name="savedWordsLaunchBtn">
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Light Maps</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="scribbleLabel">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Scribble</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QPushButton" name="scribbleLaunchBtn">
<property name="font">
<font>
<family>Inter</family>
<italic>false</italic>
</font>
</property>
<property name="text">
<string>Launch</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Calculator</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QPushButton" name="calculatorLaunchBtn">
<property name="font">
<font>
<family>Inter</family>