summaryrefslogtreecommitdiffstats
path: root/application/pages/instance
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2019-07-23 00:48:14 +0200
committerPetr Mrázek <peterix@gmail.com>2019-07-23 00:48:14 +0200
commitbf38021937a555249905d38cda0d4ea5fbc43fb3 (patch)
treec3b52577c1e0a1861330ff3312662148c96150aa /application/pages/instance
parent1e5b595923090bd19f4e5a04a5055b23e1e8678a (diff)
downloadMultiMC-bf38021937a555249905d38cda0d4ea5fbc43fb3.tar
MultiMC-bf38021937a555249905d38cda0d4ea5fbc43fb3.tar.gz
MultiMC-bf38021937a555249905d38cda0d4ea5fbc43fb3.tar.lz
MultiMC-bf38021937a555249905d38cda0d4ea5fbc43fb3.tar.xz
MultiMC-bf38021937a555249905d38cda0d4ea5fbc43fb3.zip
NOISSUE improve toolbars
Diffstat (limited to 'application/pages/instance')
-rw-r--r--application/pages/instance/ModFolderPage.cpp6
-rw-r--r--application/pages/instance/ModFolderPage.ui13
-rw-r--r--application/pages/instance/ScreenshotsPage.cpp6
-rw-r--r--application/pages/instance/ScreenshotsPage.ui12
-rw-r--r--application/pages/instance/ServersPage.ui9
-rw-r--r--application/pages/instance/VersionPage.cpp5
-rw-r--r--application/pages/instance/VersionPage.ui7
-rw-r--r--application/pages/instance/WorldListPage.cpp5
-rw-r--r--application/pages/instance/WorldListPage.ui9
9 files changed, 43 insertions, 29 deletions
diff --git a/application/pages/instance/ModFolderPage.cpp b/application/pages/instance/ModFolderPage.cpp
index bd070b94..d0de4ac2 100644
--- a/application/pages/instance/ModFolderPage.cpp
+++ b/application/pages/instance/ModFolderPage.cpp
@@ -38,11 +38,7 @@ ModFolderPage::ModFolderPage(BaseInstance *inst, std::shared_ptr<SimpleModList>
: QMainWindow(parent), ui(new Ui::ModFolderPage)
{
ui->setupUi(this);
-
- QWidget* spacer = new QWidget();
- spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
- // toolBar is a pointer to an existing toolbar
- ui->actionsToolbar->insertWidget(ui->actionView_configs, spacer);
+ ui->actionsToolbar->insertSpacer(ui->actionView_configs);
m_inst = inst;
on_RunningState_changed(m_inst && m_inst->isRunning());
diff --git a/application/pages/instance/ModFolderPage.ui b/application/pages/instance/ModFolderPage.ui
index 1fcaa4d9..55908bb5 100644
--- a/application/pages/instance/ModFolderPage.ui
+++ b/application/pages/instance/ModFolderPage.ui
@@ -73,19 +73,13 @@
</item>
</layout>
</widget>
- <widget class="QToolBar" name="actionsToolbar">
+ <widget class="WideBar" name="actionsToolbar">
<property name="windowTitle">
<string>Actions</string>
</property>
- <property name="allowedAreas">
- <set>Qt::LeftToolBarArea|Qt::RightToolBarArea</set>
- </property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextOnly</enum>
</property>
- <property name="floatable">
- <bool>false</bool>
- </property>
<attribute name="toolBarArea">
<enum>RightToolBarArea</enum>
</attribute>
@@ -145,6 +139,11 @@
<header>widgets/MCModInfoFrame.h</header>
<container>1</container>
</customwidget>
+ <customwidget>
+ <class>WideBar</class>
+ <extends>QToolBar</extends>
+ <header>widgets/WideBar.h</header>
+ </customwidget>
</customwidgets>
<resources/>
<connections/>
diff --git a/application/pages/instance/ScreenshotsPage.cpp b/application/pages/instance/ScreenshotsPage.cpp
index b470202f..d73fda51 100644
--- a/application/pages/instance/ScreenshotsPage.cpp
+++ b/application/pages/instance/ScreenshotsPage.cpp
@@ -223,11 +223,7 @@ ScreenshotsPage::ScreenshotsPage(QString path, QWidget *parent)
m_valid = FS::ensureFolderPathExists(m_folder);
ui->setupUi(this);
-
- QWidget* spacer = new QWidget();
- spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
- // toolBar is a pointer to an existing toolbar
- ui->toolBar->insertWidget(ui->actionView_Folder, spacer);
+ ui->toolBar->insertSpacer(ui->actionView_Folder);
ui->listView->setIconSize(QSize(128, 128));
ui->listView->setGridSize(QSize(192, 160));
diff --git a/application/pages/instance/ScreenshotsPage.ui b/application/pages/instance/ScreenshotsPage.ui
index a669e292..42d4db64 100644
--- a/application/pages/instance/ScreenshotsPage.ui
+++ b/application/pages/instance/ScreenshotsPage.ui
@@ -39,10 +39,13 @@
</item>
</layout>
</widget>
- <widget class="QToolBar" name="toolBar">
+ <widget class="WideBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
+ <property name="toolButtonStyle">
+ <enum>Qt::ToolButtonTextOnly</enum>
+ </property>
<attribute name="toolBarArea">
<enum>RightToolBarArea</enum>
</attribute>
@@ -75,6 +78,13 @@
</property>
</action>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>WideBar</class>
+ <extends>QToolBar</extends>
+ <header>widgets/WideBar.h</header>
+ </customwidget>
+ </customwidgets>
<resources/>
<connections/>
</ui>
diff --git a/application/pages/instance/ServersPage.ui b/application/pages/instance/ServersPage.ui
index 5023cd73..9c31abe3 100644
--- a/application/pages/instance/ServersPage.ui
+++ b/application/pages/instance/ServersPage.ui
@@ -128,7 +128,7 @@
</item>
</layout>
</widget>
- <widget class="QToolBar" name="toolBar">
+ <widget class="WideBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
@@ -173,6 +173,13 @@
</property>
</action>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>WideBar</class>
+ <extends>QToolBar</extends>
+ <header>widgets/WideBar.h</header>
+ </customwidget>
+ </customwidgets>
<tabstops>
<tabstop>serversView</tabstop>
<tabstop>nameLine</tabstop>
diff --git a/application/pages/instance/VersionPage.cpp b/application/pages/instance/VersionPage.cpp
index a34f564c..8b95c8b2 100644
--- a/application/pages/instance/VersionPage.cpp
+++ b/application/pages/instance/VersionPage.cpp
@@ -112,10 +112,7 @@ VersionPage::VersionPage(MinecraftInstance *inst, QWidget *parent)
{
ui->setupUi(this);
- QWidget* spacer = new QWidget();
- spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
- // toolBar is a pointer to an existing toolbar
- ui->toolBar->insertWidget(ui->actionReload, spacer);
+ ui->toolBar->insertSpacer(ui->actionReload);
m_profile = m_inst->getComponentList();
diff --git a/application/pages/instance/VersionPage.ui b/application/pages/instance/VersionPage.ui
index cb02a9ca..e16f18bc 100644
--- a/application/pages/instance/VersionPage.ui
+++ b/application/pages/instance/VersionPage.ui
@@ -62,7 +62,7 @@
</item>
</layout>
</widget>
- <widget class="QToolBar" name="toolBar">
+ <widget class="WideBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
@@ -239,6 +239,11 @@
<header>widgets/MCModInfoFrame.h</header>
<container>1</container>
</customwidget>
+ <customwidget>
+ <class>WideBar</class>
+ <extends>QToolBar</extends>
+ <header>widgets/WideBar.h</header>
+ </customwidget>
</customwidgets>
<resources/>
<connections/>
diff --git a/application/pages/instance/WorldListPage.cpp b/application/pages/instance/WorldListPage.cpp
index bd559991..75805838 100644
--- a/application/pages/instance/WorldListPage.cpp
+++ b/application/pages/instance/WorldListPage.cpp
@@ -37,10 +37,7 @@ WorldListPage::WorldListPage(BaseInstance *inst, std::shared_ptr<WorldList> worl
{
ui->setupUi(this);
- QWidget* spacer = new QWidget();
- spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
- // toolBar is a pointer to an existing toolbar
- ui->toolBar->insertWidget(ui->actionRefresh, spacer);
+ ui->toolBar->insertSpacer(ui->actionRefresh);
QSortFilterProxyModel * proxy = new QSortFilterProxyModel(this);
proxy->setSortCaseSensitivity(Qt::CaseInsensitive);
diff --git a/application/pages/instance/WorldListPage.ui b/application/pages/instance/WorldListPage.ui
index 37721ae0..b7a9e57a 100644
--- a/application/pages/instance/WorldListPage.ui
+++ b/application/pages/instance/WorldListPage.ui
@@ -57,7 +57,7 @@
</item>
</layout>
</widget>
- <widget class="QToolBar" name="toolBar">
+ <widget class="WideBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
@@ -128,6 +128,13 @@
</property>
</action>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>WideBar</class>
+ <extends>QToolBar</extends>
+ <header>widgets/WideBar.h</header>
+ </customwidget>
+ </customwidgets>
<resources/>
<connections/>
</ui>