Skip to content

Commit 023908f

Browse files
authored
0.3
1 parent 345b243 commit 023908f

File tree

4 files changed

+22
-20
lines changed

4 files changed

+22
-20
lines changed

applets/appmenu/appmenu.cpp

+12-11
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ QHash<QListWidgetItem*,QString> execData;
77
QHash<QListWidgetItem*,QString> favExecData;
88
QVariantList __favDesktopFiles__;
99

10-
menuUI AppMenu::__createUI__(PanelLocation location, short panelHeight, QFont font,
11-
short buttonX, short buttonXRight, bool triangularTabs,
12-
QString accent, QString theme, qreal opacity) {
10+
menuUI AppMenu::__createUI__(QWidget* parent, PanelLocation location, short panelHeight,
11+
QFont font, short buttonX, short buttonXRight,
12+
bool triangularTabs, QString accent, QString theme,
13+
qreal opacity) {
1314
QWidget* appMenuWidget = new QWidget;
1415
appMenuWidget->setObjectName("appMenu");
1516
appMenuWidget->setWindowTitle("plainPanel App Menu");
@@ -126,18 +127,18 @@ menuUI AppMenu::__createUI__(PanelLocation location, short panelHeight, QFont fo
126127
});
127128

128129
allAppsTab->connect(menuAppsList, &QListWidget::itemDoubleClicked, allAppsTab,
129-
[menuAppsList, appMenuWidget, this]() {
130-
execApp(execData[menuAppsList->selectedItems()[0]], appMenuWidget);
130+
[parent, menuAppsList, appMenuWidget, this]() {
131+
execApp(parent, execData[menuAppsList->selectedItems()[0]], appMenuWidget);
131132
});
132133

133134
favAppsTab->connect(favAppsList, &QListWidget::itemDoubleClicked, favAppsTab,
134-
[favAppsList, appMenuWidget, this]() {
135-
execApp(favExecData[favAppsList->selectedItems()[0]], appMenuWidget);
135+
[parent, favAppsList, appMenuWidget, this]() {
136+
execApp(parent, favExecData[favAppsList->selectedItems()[0]], appMenuWidget);
136137
});
137138

138139
runTab->connect(runPushButton, &QPushButton::clicked, runTab,
139-
[cmdLineEdit, appMenuWidget, this]() {
140-
execApp(cmdLineEdit->text(), appMenuWidget);
140+
[parent, cmdLineEdit, appMenuWidget, this]() {
141+
execApp(parent, cmdLineEdit->text(), appMenuWidget);
141142
cmdLineEdit->clear();
142143
});
143144

@@ -178,8 +179,8 @@ App AppMenu::readDesktopFile(QString pathToCurrentDesktopFile) {
178179
}
179180

180181

181-
void AppMenu::execApp(QString exec, QWidget* appMenuWidget) {
182-
QProcess* process = new QProcess(appMenuWidget);
182+
void AppMenu::execApp(QWidget* parent, QString exec, QWidget* appMenuWidget) {
183+
QProcess* process = new QProcess(parent);
183184

184185
/* https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html
185186
* 'The Exec key' */

applets/appmenu/appmenu.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ struct App {
3232

3333
class AppMenu : public Applet {
3434
public:
35-
menuUI __createUI__(PanelLocation location, short panelHeight, QFont font,
35+
menuUI __createUI__(QWidget* parent, PanelLocation location, short panelHeight, QFont font,
3636
short buttonX, short buttonXRight, bool triangularTabs,
3737
QString accent, QString theme, qreal opacity);
3838
void makeItem(QString name, QIcon icon, QListWidgetItem* item);
3939
App readDesktopFile(QString pathToCurrentDesktopFile);
4040
void buildMenu(QListWidget* appList, QString searchRequest);
4141
void searchApps(QListWidget* menuAppsList, QString mask);
42-
void execApp(QString exec, QWidget* appMenuWidget);
42+
void execApp(QWidget* parent, QString exec, QWidget* appMenuWidget);
4343

4444
void buildFavMenu(QListWidget* favListWidget, QVariantList favDesktopFiles);
4545
};

applets/usermenu/usermenu.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
#include <QDebug>
44

5-
userMenuUI UserMenuApplet::__createUI__(PanelLocation location, short panelHeight, QFont font,
6-
short buttonX, short buttonXRight, QString theme,
5+
userMenuUI UserMenuApplet::__createUI__(QWidget* parent, PanelLocation location, short panelHeight,
6+
QFont font, short buttonX, short buttonXRight, QString theme,
77
qreal opacity) {
88
QWidget* userMenuWidget = new QWidget;
99
userMenuWidget->setObjectName("userMenu");
@@ -147,18 +147,18 @@ userMenuUI UserMenuApplet::__createUI__(PanelLocation location, short panelHeigh
147147
});
148148

149149
userMenuWidget->connect(settingsEntry, &QPushButton::clicked, userMenuWidget,
150-
[userMenuWidget]() {
150+
[parent, userMenuWidget]() {
151151
userMenuWidget->hide();
152152

153-
QProcess* process = new QProcess(userMenuWidget);
153+
QProcess* process = new QProcess(parent);
154154
process->start("plainControlCenter");
155155
});
156156

157157
userMenuWidget->connect(aboutEntry, &QPushButton::clicked, userMenuWidget,
158-
[userMenuWidget]() {
158+
[parent, userMenuWidget]() {
159159
userMenuWidget->hide();
160160

161-
QProcess* process = new QProcess(userMenuWidget);
161+
QProcess* process = new QProcess(parent);
162162
process->start("plainAbout --plainPanel");
163163
});
164164

applets/usermenu/usermenu.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ struct userMenuUI {
1717

1818
class UserMenuApplet {
1919
public:
20-
userMenuUI __createUI__(PanelLocation location,
20+
userMenuUI __createUI__(QWidget* parent,
21+
PanelLocation location,
2122
short panelHeight,
2223
QFont font,
2324
short buttonX,

0 commit comments

Comments
 (0)