forked from qt-creator/qt-creator
Theme: Inline UI
Change-Id: I1d8403484583bb6ff4186ac65730e26724fedad9 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
cfc89a685e
commit
64c552f555
@@ -224,7 +224,6 @@ FORMS += dialogs/newdialog.ui \
|
|||||||
dialogs/readonlyfilesdialog.ui \
|
dialogs/readonlyfilesdialog.ui \
|
||||||
dialogs/openwithdialog.ui \
|
dialogs/openwithdialog.ui \
|
||||||
generalsettings.ui \
|
generalsettings.ui \
|
||||||
themesettings.ui \
|
|
||||||
dialogs/externaltoolconfig.ui \
|
dialogs/externaltoolconfig.ui \
|
||||||
mimetypesettingspage.ui \
|
mimetypesettingspage.ui \
|
||||||
mimetypemagicdialog.ui \
|
mimetypemagicdialog.ui \
|
||||||
|
@@ -99,7 +99,7 @@ QtcPlugin {
|
|||||||
"styleanimator.cpp", "styleanimator.h",
|
"styleanimator.cpp", "styleanimator.h",
|
||||||
"systemsettings.cpp", "systemsettings.h", "systemsettings.ui",
|
"systemsettings.cpp", "systemsettings.h", "systemsettings.ui",
|
||||||
"textdocument.cpp", "textdocument.h",
|
"textdocument.cpp", "textdocument.h",
|
||||||
"themesettings.cpp", "themesettings.h", "themesettings.ui",
|
"themesettings.cpp", "themesettings.h",
|
||||||
"themesettingswidget.cpp", "themesettingswidget.h",
|
"themesettingswidget.cpp", "themesettingswidget.h",
|
||||||
"toolsettings.cpp", "toolsettings.h",
|
"toolsettings.cpp", "toolsettings.h",
|
||||||
"variablechooser.cpp", "variablechooser.h",
|
"variablechooser.cpp", "variablechooser.h",
|
||||||
|
@@ -1,50 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>Core::Internal::ThemeSettings</class>
|
|
||||||
<widget class="QWidget" name="Core::Internal::ThemeSettings">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>338</width>
|
|
||||||
<height>40</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<property name="leftMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="topMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="rightMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
|
||||||
</property>
|
|
||||||
<item>
|
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QComboBox" name="themeComboBox"/>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<spacer name="horizontalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections/>
|
|
||||||
</ui>
|
|
@@ -39,15 +39,17 @@
|
|||||||
#include <utils/theme/theme_p.h>
|
#include <utils/theme/theme_p.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
|
#include <QAbstractListModel>
|
||||||
|
#include <QComboBox>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
#include <QHBoxLayout>
|
||||||
#include <QInputDialog>
|
#include <QInputDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
|
#include <QSpacerItem>
|
||||||
#include <QStyleFactory>
|
#include <QStyleFactory>
|
||||||
|
|
||||||
#include "ui_themesettings.h"
|
|
||||||
|
|
||||||
using namespace Utils;
|
using namespace Utils;
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
@@ -105,23 +107,25 @@ public:
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
ThemeListModel *m_themeListModel;
|
ThemeListModel *m_themeListModel;
|
||||||
|
QComboBox *m_themeComboBox;
|
||||||
bool m_refreshingThemeList;
|
bool m_refreshingThemeList;
|
||||||
Ui::ThemeSettings *m_ui;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
ThemeSettingsPrivate::ThemeSettingsPrivate(QWidget *widget)
|
ThemeSettingsPrivate::ThemeSettingsPrivate(QWidget *widget)
|
||||||
: m_themeListModel(new ThemeListModel)
|
: m_themeListModel(new ThemeListModel)
|
||||||
|
, m_themeComboBox(new QComboBox)
|
||||||
, m_refreshingThemeList(false)
|
, m_refreshingThemeList(false)
|
||||||
, m_ui(new Ui::ThemeSettings)
|
|
||||||
{
|
{
|
||||||
m_ui->setupUi(widget);
|
QHBoxLayout *layout = new QHBoxLayout(widget);
|
||||||
m_ui->themeComboBox->setModel(m_themeListModel);
|
layout->addWidget(m_themeComboBox);
|
||||||
|
auto horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
|
||||||
|
layout->addSpacerItem(horizontalSpacer);
|
||||||
|
m_themeComboBox->setModel(m_themeListModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeSettingsPrivate::~ThemeSettingsPrivate()
|
ThemeSettingsPrivate::~ThemeSettingsPrivate()
|
||||||
{
|
{
|
||||||
delete m_themeListModel;
|
delete m_themeListModel;
|
||||||
delete m_ui;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeSettingsWidget::ThemeSettingsWidget(QWidget *parent) :
|
ThemeSettingsWidget::ThemeSettingsWidget(QWidget *parent) :
|
||||||
@@ -146,7 +150,7 @@ void ThemeSettingsWidget::refreshThemeList()
|
|||||||
d->m_refreshingThemeList = true;
|
d->m_refreshingThemeList = true;
|
||||||
d->m_themeListModel->setThemes(themes);
|
d->m_themeListModel->setThemes(themes);
|
||||||
if (selected >= 0)
|
if (selected >= 0)
|
||||||
d->m_ui->themeComboBox->setCurrentIndex(selected);
|
d->m_themeComboBox->setCurrentIndex(selected);
|
||||||
d->m_refreshingThemeList = false;
|
d->m_refreshingThemeList = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user