Commit 64c552f5 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Theme: Inline UI



Change-Id: I1d8403484583bb6ff4186ac65730e26724fedad9
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: default avatarLeena Miettinen <riitta-leena.miettinen@theqtcompany.com>
parent cfc89a68
......@@ -224,7 +224,6 @@ FORMS += dialogs/newdialog.ui \
dialogs/readonlyfilesdialog.ui \
dialogs/openwithdialog.ui \
generalsettings.ui \
themesettings.ui \
dialogs/externaltoolconfig.ui \
mimetypesettingspage.ui \
mimetypemagicdialog.ui \
......
......@@ -99,7 +99,7 @@ QtcPlugin {
"styleanimator.cpp", "styleanimator.h",
"systemsettings.cpp", "systemsettings.h", "systemsettings.ui",
"textdocument.cpp", "textdocument.h",
"themesettings.cpp", "themesettings.h", "themesettings.ui",
"themesettings.cpp", "themesettings.h",
"themesettingswidget.cpp", "themesettingswidget.h",
"toolsettings.cpp", "toolsettings.h",
"variablechooser.cpp", "variablechooser.h",
......
<?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/qtcassert.h>
#include <QAbstractListModel>
#include <QComboBox>
#include <QDebug>
#include <QDir>
#include <QHBoxLayout>
#include <QInputDialog>
#include <QMessageBox>
#include <QSettings>
#include <QSpacerItem>
#include <QStyleFactory>
#include "ui_themesettings.h"
using namespace Utils;
namespace Core {
......@@ -105,23 +107,25 @@ public:
public:
ThemeListModel *m_themeListModel;
QComboBox *m_themeComboBox;
bool m_refreshingThemeList;
Ui::ThemeSettings *m_ui;
};
ThemeSettingsPrivate::ThemeSettingsPrivate(QWidget *widget)
: m_themeListModel(new ThemeListModel)
, m_themeComboBox(new QComboBox)
, m_refreshingThemeList(false)
, m_ui(new Ui::ThemeSettings)
{
m_ui->setupUi(widget);
m_ui->themeComboBox->setModel(m_themeListModel);
QHBoxLayout *layout = new QHBoxLayout(widget);
layout->addWidget(m_themeComboBox);
auto horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
layout->addSpacerItem(horizontalSpacer);
m_themeComboBox->setModel(m_themeListModel);
}
ThemeSettingsPrivate::~ThemeSettingsPrivate()
{
delete m_themeListModel;
delete m_ui;
}
ThemeSettingsWidget::ThemeSettingsWidget(QWidget *parent) :
......@@ -146,7 +150,7 @@ void ThemeSettingsWidget::refreshThemeList()
d->m_refreshingThemeList = true;
d->m_themeListModel->setThemes(themes);
if (selected >= 0)
d->m_ui->themeComboBox->setCurrentIndex(selected);
d->m_themeComboBox->setCurrentIndex(selected);
d->m_refreshingThemeList = false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment