From decd4ae7ab66c8ce1deb8f84392e048cd5c64cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Tue, 16 Jul 2019 01:30:53 +0200 Subject: NOISSUE Make mod folder pages use toolbars instead of button layouts --- application/pages/instance/ModFolderPage.h | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'application/pages/instance/ModFolderPage.h') diff --git a/application/pages/instance/ModFolderPage.h b/application/pages/instance/ModFolderPage.h index 77fe877d..1bdf03a2 100644 --- a/application/pages/instance/ModFolderPage.h +++ b/application/pages/instance/ModFolderPage.h @@ -15,7 +15,7 @@ #pragma once -#include +#include #include "minecraft/MinecraftInstance.h" #include "pages/BasePage.h" @@ -27,14 +27,20 @@ namespace Ui class ModFolderPage; } -class ModFolderPage : public QWidget, public BasePage +class ModFolderPage : public QMainWindow, public BasePage { Q_OBJECT public: - explicit ModFolderPage(BaseInstance *inst, std::shared_ptr mods, QString id, - QString iconName, QString displayName, QString helpPage = "", - QWidget *parent = 0); + explicit ModFolderPage( + BaseInstance *inst, + std::shared_ptr mods, + QString id, + QString iconName, + QString displayName, + QString helpPage = "", + QWidget *parent = 0 + ); virtual ~ModFolderPage(); void setFilter(const QString & filter) @@ -65,6 +71,7 @@ public: protected: bool eventFilter(QObject *obj, QEvent *ev) override; bool modListFilter(QKeyEvent *ev); + QMenu * createPopupMenu() override; protected: BaseInstance *m_inst = nullptr; @@ -89,12 +96,12 @@ private slots: void on_filterTextChanged(const QString & newContents); void on_RunningState_changed(bool running); - void on_addModBtn_clicked(); - void on_rmModBtn_clicked(); - void on_viewModBtn_clicked(); - void on_enableModBtn_clicked(); - void on_disableModBtn_clicked(); - void on_configFolderBtn_clicked(); + void on_actionAdd_triggered(); + void on_actionRemove_triggered(); + void on_actionEnable_triggered(); + void on_actionDisable_triggered(); + void on_actionView_Folder_triggered(); + void on_actionView_configs_triggered(); }; class CoreModFolderPage : public ModFolderPage -- cgit v1.2.3