18
18
19
19
#include " Config.h"
20
20
#include " GameConfig.h"
21
+ #include " LaunchButton.h"
21
22
#include " NewModDialog.h"
22
23
23
24
#ifdef _WIN32
@@ -264,11 +265,11 @@ void Window::loadGameConfig(const QString& path) {
264
265
layout->addWidget (line);
265
266
266
267
for (auto & entry : section.entries ) {
267
- auto * button = new QToolButton (this ->main );
268
+ auto * button = new LaunchButton (this ->main );
268
269
button->setStyleSheet (
269
- " QToolButton { background-color: rgba( 0, 0, 0, 0); border: none; }\n "
270
- " QToolButton ::pressed { background-color: rgba(220, 220, 0, 32); border: none; }\n "
271
- " QToolButton ::hover { background-color: rgba(220, 220, 0, 32); border: none; }" );
270
+ " LaunchButton { background-color: rgba( 0, 0, 0, 0); border: none; }\n "
271
+ " LaunchButton ::pressed { background-color: rgba(220, 220, 0, 32); border: none; }\n "
272
+ " LaunchButton ::hover { background-color: rgba(220, 220, 0, 32); border: none; }" );
272
273
button->setToolButtonStyle (Qt::ToolButtonTextBesideIcon);
273
274
button->setText (entry.name );
274
275
button->setIconSize ({16 , 16 });
@@ -303,7 +304,7 @@ void Window::loadGameConfig(const QString& path) {
303
304
#endif
304
305
}
305
306
button->setToolTip (action + " " + entry.arguments .join (" " ));
306
- QObject::connect (button, &QToolButton::clicked , this , [this , action, args=entry.arguments , cwd=rootPath] {
307
+ QObject::connect (button, &LaunchButton::doubleClicked , this , [this , action, args=entry.arguments , cwd=rootPath] {
307
308
auto * process = new QProcess;
308
309
QObject::connect (process, &QProcess::errorOccurred, this , [this ](QProcess::ProcessError code) {
309
310
QString error;
@@ -337,7 +338,7 @@ void Window::loadGameConfig(const QString& path) {
337
338
button->setIcon (this ->style ()->standardIcon (QStyle::SP_MessageBoxInformation));
338
339
}
339
340
button->setToolTip (action);
340
- QObject::connect (button, &QToolButton::clicked , this , [action] {
341
+ QObject::connect (button, &LaunchButton::doubleClicked , this , [action] {
341
342
QDesktopServices::openUrl ({action});
342
343
});
343
344
break ;
@@ -346,7 +347,7 @@ void Window::loadGameConfig(const QString& path) {
346
347
button->setIcon (this ->style ()->standardIcon (QStyle::SP_DirLinkIcon));
347
348
}
348
349
button->setToolTip (action);
349
- QObject::connect (button, &QToolButton::clicked , this , [action] {
350
+ QObject::connect (button, &LaunchButton::doubleClicked , this , [action] {
350
351
QDesktopServices::openUrl ({QString (" file:///" ) + action});
351
352
});
352
353
break ;
0 commit comments