asset browser: settings: properly support frameless Window now.
This commit is contained in:
@@ -17,10 +17,19 @@
|
||||
using namespace noggit::Red::AssetBrowser::Ui;
|
||||
|
||||
AssetBrowserWidget::AssetBrowserWidget(QWidget *parent)
|
||||
: QMainWindow(parent, Qt::Window)
|
||||
{
|
||||
setWindowTitle("Asset Browser");
|
||||
|
||||
auto body = new QWidget(this);
|
||||
ui = new ::Ui::AssetBrowser;
|
||||
ui->setupUi(this);
|
||||
ui::setupFramelessWindow(ui->titlebar, this, minimumSize(), maximumSize(), true);
|
||||
ui->setupUi(body);
|
||||
setCentralWidget(body);
|
||||
|
||||
auto titlebar = new QWidget(this);
|
||||
ui::setupFramelessWindow(titlebar, this, minimumSize(), maximumSize(), true);
|
||||
setMenuWidget(titlebar);
|
||||
|
||||
setWindowFlags(windowFlags() | Qt::Tool | Qt::WindowStaysOnTopHint);
|
||||
|
||||
_model = new QStandardItemModel(this);
|
||||
|
||||
@@ -10,13 +10,14 @@
|
||||
#include <QStandardItemModel>
|
||||
#include <QSortFilterProxyModel>
|
||||
#include <QRegularExpression>
|
||||
#include <QMainWindow>
|
||||
|
||||
|
||||
namespace noggit
|
||||
{
|
||||
namespace Red::AssetBrowser::Ui
|
||||
{
|
||||
class AssetBrowserWidget : public QWidget
|
||||
class AssetBrowserWidget : public QMainWindow
|
||||
{
|
||||
public:
|
||||
AssetBrowserWidget(QWidget* parent = nullptr);
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1226</width>
|
||||
<height>764</height>
|
||||
<width>1195</width>
|
||||
<height>792</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="acceptDrops">
|
||||
@@ -50,16 +50,6 @@
|
||||
<property name="bottomMargin">
|
||||
<number>12</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="titlebar" native="true">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
|
||||
@@ -31,14 +31,19 @@ namespace noggit
|
||||
{
|
||||
namespace ui
|
||||
{
|
||||
settings::settings(QWidget *parent) : QDialog(parent), _settings(new QSettings(this))
|
||||
settings::settings(QWidget *parent) : QMainWindow(parent, Qt::Window), _settings(new QSettings(this))
|
||||
{
|
||||
setWindowFlags(Qt::Tool | Qt::WindowStaysOnTopHint);
|
||||
|
||||
auto body = new QWidget(this);
|
||||
ui = new Ui::SettingsPanel;
|
||||
ui->setupUi(this);
|
||||
ui->setupUi(body);
|
||||
setCentralWidget(body);
|
||||
setWindowTitle("Settings");
|
||||
|
||||
setupFramelessWindow(ui->titlebar, this, minimumSize(), maximumSize(), false);
|
||||
auto titlebar = new QWidget(this);
|
||||
setupFramelessWindow(titlebar, this, minimumSize(), maximumSize(), false);
|
||||
setMenuWidget(titlebar);
|
||||
|
||||
setWindowFlags(windowFlags() | Qt::Tool | Qt::WindowStaysOnTopHint);
|
||||
|
||||
connect(ui->gamePathField, &QLineEdit::textChanged, [&](QString value)
|
||||
{
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include <qt-color-widgets/color_selector.hpp>
|
||||
|
||||
#include <QtCore/QSettings>
|
||||
#include <QDialog>
|
||||
#include <QMainWindow>
|
||||
#include <ui_SettingsPanel.h>
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace noggit
|
||||
{
|
||||
namespace ui
|
||||
{
|
||||
class settings : public QDialog
|
||||
class settings : public QMainWindow
|
||||
{
|
||||
QSettings* _settings;
|
||||
Ui::SettingsPanel* ui;
|
||||
|
||||
@@ -49,9 +49,6 @@
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QWidget" name="titlebar" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QWidget" name="widget" native="true">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_38">
|
||||
@@ -82,7 +79,7 @@
|
||||
<string/>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>4</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<property name="tabBarAutoHide">
|
||||
<bool>false</bool>
|
||||
|
||||
Reference in New Issue
Block a user