Settings Button

Adding settings button to the project selection screen to make it easier to alter noggit level settings without the need to load up a project.
This commit is contained in:
Alister
2022-07-17 11:41:30 +01:00
parent 9d85e082a0
commit 32d2b8bc4a
3 changed files with 51 additions and 6 deletions

View File

@@ -6,9 +6,11 @@
#include <filesystem>
#include <QString>
#include <noggit/ui/FontNoggit.hpp>
#include "ui_NoggitProjectSelectionWindow.h"
using namespace Noggit::Ui::Windows;
NoggitProjectSelectionWindow::NoggitProjectSelectionWindow(Noggit::Application::NoggitApplication* noggit_app,
@@ -31,8 +33,17 @@ NoggitProjectSelectionWindow::NoggitProjectSelectionWindow(Noggit::Application::
_load_project_component = std::make_unique<Component::LoadProjectComponent>();
_ui->settings_button->setIcon(Noggit::Ui::FontAwesomeIcon(Noggit::Ui::FontAwesome::Icons::cog));
_ui->settings_button->setIconSize(QSize(20,20));
Component::RecentProjectsComponent::buildRecentProjectsList(this);
QObject::connect(_ui->settings_button, &QToolButton::clicked, [&]
{
_settings->show();
}
);
QObject::connect(_ui->button_create_new_project, &QPushButton::clicked, [=, this]
{
ProjectInformation project_reference;

View File

@@ -6,6 +6,7 @@
#include <QAction>
#include <qgraphicseffect.h>
#include <QString>
#include <QToolButton>
#include <noggit/application/NoggitApplication.hpp>
#include <noggit/ui/windows/noggitWindow/NoggitWindow.hpp>
#include <noggit/ui/windows/projectCreation/NoggitProjectCreationDialog.h>

View File

@@ -69,12 +69,18 @@
</item>
<item>
<widget class="QListWidget" name="listView">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>380</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
@@ -235,6 +241,33 @@
</property>
</widget>
</item>
<item row="6" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="settings_button">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>