Implement the "inline" account switch button

Make the account switch listview into a widget
This commit is contained in:
Rasmus Karlsson
2017-12-19 02:16:01 +01:00
parent 4010c49c84
commit 1a870685b0
9 changed files with 223 additions and 47 deletions
+11 -1
View File
@@ -2,6 +2,7 @@
#include "settingsmanager.hpp"
#include "settingssnapshot.hpp"
#include "widgets/accountswitchwidget.hpp"
#include "widgets/helper/settingsdialogtab.hpp"
#include <QButtonGroup>
@@ -31,12 +32,19 @@ public:
void select(SettingsDialogTab *tab);
static void showDialog();
enum class PreferredTab {
NoPreference,
Accounts,
};
static void showDialog(PreferredTab preferredTab = PreferredTab::NoPreference);
protected:
virtual void dpiMultiplierChanged(float oldDpi, float newDpi) override;
private:
void refresh();
SettingsSnapshot snapshot;
std::vector<SettingsDialogTab *> tabs;
@@ -51,6 +59,8 @@ private:
QDialogButtonBox buttonBox;
QPushButton okButton;
QPushButton cancelButton;
AccountSwitchWidget *accountSwitchWidget = nullptr;
} ui;
void addTab(QBoxLayout *layout, QString title, QString imageRes);