forked from qt-creator/qt-creator
Rename ThemeSettingsWidget -> ThemeChooser
Change-Id: Ie61dc07d9f8bc8639ff80368a0b2ad4dd62cacb3 Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
3ac3fe9389
commit
9d0d39495f
@@ -32,7 +32,7 @@
|
|||||||
#include "modemanager.h"
|
#include "modemanager.h"
|
||||||
#include "infobar.h"
|
#include "infobar.h"
|
||||||
#include "iwizardfactory.h"
|
#include "iwizardfactory.h"
|
||||||
#include "themesettings.h"
|
#include "themechooser.h"
|
||||||
|
|
||||||
#include <coreplugin/actionmanager/actionmanager.h>
|
#include <coreplugin/actionmanager/actionmanager.h>
|
||||||
#include <coreplugin/documentmanager.h>
|
#include <coreplugin/documentmanager.h>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ SOURCES += corejsextensions.cpp \
|
|||||||
fancyactionbar.cpp \
|
fancyactionbar.cpp \
|
||||||
fancytabwidget.cpp \
|
fancytabwidget.cpp \
|
||||||
generalsettings.cpp \
|
generalsettings.cpp \
|
||||||
themesettings.cpp \
|
themechooser.cpp \
|
||||||
id.cpp \
|
id.cpp \
|
||||||
icontext.cpp \
|
icontext.cpp \
|
||||||
jsexpander.cpp \
|
jsexpander.cpp \
|
||||||
@@ -118,7 +118,7 @@ HEADERS += corejsextensions.h \
|
|||||||
fancyactionbar.h \
|
fancyactionbar.h \
|
||||||
fancytabwidget.h \
|
fancytabwidget.h \
|
||||||
generalsettings.h \
|
generalsettings.h \
|
||||||
themesettings.h \
|
themechooser.h \
|
||||||
id.h \
|
id.h \
|
||||||
jsexpander.h \
|
jsexpander.h \
|
||||||
messagemanager.h \
|
messagemanager.h \
|
||||||
|
|||||||
@@ -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",
|
"themechooser.cpp", "themechooser.h",
|
||||||
"toolsettings.cpp", "toolsettings.h",
|
"toolsettings.cpp", "toolsettings.h",
|
||||||
"variablechooser.cpp", "variablechooser.h",
|
"variablechooser.cpp", "variablechooser.h",
|
||||||
"vcsmanager.cpp", "vcsmanager.h",
|
"vcsmanager.cpp", "vcsmanager.h",
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ void GeneralSettings::apply()
|
|||||||
setLanguage(m_page->languageBox->itemData(currentIndex, Qt::UserRole).toString());
|
setLanguage(m_page->languageBox->itemData(currentIndex, Qt::UserRole).toString());
|
||||||
// Apply the new base color if accepted
|
// Apply the new base color if accepted
|
||||||
StyleHelper::setBaseColor(m_page->colorButton->color());
|
StyleHelper::setBaseColor(m_page->colorButton->color());
|
||||||
m_page->themeWidget->apply();
|
m_page->themeChooser->apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralSettings::finish()
|
void GeneralSettings::finish()
|
||||||
|
|||||||
@@ -78,7 +78,7 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="Core::Internal::ThemeSettingsWidget" name="themeWidget" native="true"/>
|
<widget class="Core::Internal::ThemeChooser" name="themeChooser" native="true"/>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="languageLabel">
|
<widget class="QLabel" name="languageLabel">
|
||||||
@@ -149,9 +149,9 @@
|
|||||||
<header location="global">utils/qtcolorbutton.h</header>
|
<header location="global">utils/qtcolorbutton.h</header>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
<customwidget>
|
<customwidget>
|
||||||
<class>Core::Internal::ThemeSettingsWidget</class>
|
<class>Core::Internal::ThemeChooser</class>
|
||||||
<extends>QWidget</extends>
|
<extends>QWidget</extends>
|
||||||
<header location="global">coreplugin/themesettings.h</header>
|
<header location="global">coreplugin/themechooser.h</header>
|
||||||
<container>1</container>
|
<container>1</container>
|
||||||
</customwidget>
|
</customwidget>
|
||||||
</customwidgets>
|
</customwidgets>
|
||||||
|
|||||||
@@ -32,7 +32,6 @@
|
|||||||
#include "fancytabwidget.h"
|
#include "fancytabwidget.h"
|
||||||
#include "documentmanager.h"
|
#include "documentmanager.h"
|
||||||
#include "generalsettings.h"
|
#include "generalsettings.h"
|
||||||
#include "themesettings.h"
|
|
||||||
#include "helpmanager.h"
|
#include "helpmanager.h"
|
||||||
#include "idocumentfactory.h"
|
#include "idocumentfactory.h"
|
||||||
#include "messagemanager.h"
|
#include "messagemanager.h"
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include "coreconstants.h"
|
#include "coreconstants.h"
|
||||||
#include "icore.h"
|
#include "icore.h"
|
||||||
#include "manhattanstyle.h"
|
#include "manhattanstyle.h"
|
||||||
#include "themesettings.h"
|
#include "themechooser.h"
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/theme/theme.h>
|
#include <utils/theme/theme.h>
|
||||||
@@ -119,11 +119,11 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
class ThemeSettingsPrivate
|
class ThemeChooserPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ThemeSettingsPrivate(QWidget *widget);
|
ThemeChooserPrivate(QWidget *widget);
|
||||||
~ThemeSettingsPrivate();
|
~ThemeChooserPrivate();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ThemeListModel *m_themeListModel;
|
ThemeListModel *m_themeListModel;
|
||||||
@@ -131,7 +131,7 @@ public:
|
|||||||
bool m_refreshingThemeList;
|
bool m_refreshingThemeList;
|
||||||
};
|
};
|
||||||
|
|
||||||
ThemeSettingsPrivate::ThemeSettingsPrivate(QWidget *widget)
|
ThemeChooserPrivate::ThemeChooserPrivate(QWidget *widget)
|
||||||
: m_themeListModel(new ThemeListModel)
|
: m_themeListModel(new ThemeListModel)
|
||||||
, m_themeComboBox(new QComboBox)
|
, m_themeComboBox(new QComboBox)
|
||||||
, m_refreshingThemeList(false)
|
, m_refreshingThemeList(false)
|
||||||
@@ -144,25 +144,25 @@ ThemeSettingsPrivate::ThemeSettingsPrivate(QWidget *widget)
|
|||||||
m_themeComboBox->setModel(m_themeListModel);
|
m_themeComboBox->setModel(m_themeListModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeSettingsPrivate::~ThemeSettingsPrivate()
|
ThemeChooserPrivate::~ThemeChooserPrivate()
|
||||||
{
|
{
|
||||||
delete m_themeListModel;
|
delete m_themeListModel;
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeSettingsWidget::ThemeSettingsWidget(QWidget *parent) :
|
ThemeChooser::ThemeChooser(QWidget *parent) :
|
||||||
QWidget(parent)
|
QWidget(parent)
|
||||||
{
|
{
|
||||||
d = new ThemeSettingsPrivate(this);
|
d = new ThemeChooserPrivate(this);
|
||||||
|
|
||||||
refreshThemeList();
|
refreshThemeList();
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeSettingsWidget::~ThemeSettingsWidget()
|
ThemeChooser::~ThemeChooser()
|
||||||
{
|
{
|
||||||
delete d;
|
delete d;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThemeSettingsWidget::refreshThemeList()
|
void ThemeChooser::refreshThemeList()
|
||||||
{
|
{
|
||||||
const QList<ThemeEntry> themes = ThemeEntry::availableThemes();
|
const QList<ThemeEntry> themes = ThemeEntry::availableThemes();
|
||||||
const int selected = Utils::indexOf(themes, Utils::equal(&ThemeEntry::id,
|
const int selected = Utils::indexOf(themes, Utils::equal(&ThemeEntry::id,
|
||||||
@@ -175,7 +175,7 @@ void ThemeSettingsWidget::refreshThemeList()
|
|||||||
d->m_refreshingThemeList = false;
|
d->m_refreshingThemeList = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ThemeSettingsWidget::apply()
|
void ThemeChooser::apply()
|
||||||
{
|
{
|
||||||
const int index = d->m_themeComboBox->currentIndex();
|
const int index = d->m_themeComboBox->currentIndex();
|
||||||
if (index == -1)
|
if (index == -1)
|
||||||
@@ -23,8 +23,8 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef THEMESETTINGS_H
|
#ifndef THEMECHOOSER_H
|
||||||
#define THEMESETTINGS_H
|
#define THEMECHOOSER_H
|
||||||
|
|
||||||
#include "id.h"
|
#include "id.h"
|
||||||
|
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
namespace Core {
|
namespace Core {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class ThemeSettingsPrivate;
|
class ThemeChooserPrivate;
|
||||||
|
|
||||||
class ThemeEntry
|
class ThemeEntry
|
||||||
{
|
{
|
||||||
@@ -54,19 +54,19 @@ private:
|
|||||||
mutable QString m_displayName;
|
mutable QString m_displayName;
|
||||||
};
|
};
|
||||||
|
|
||||||
class ThemeSettingsWidget : public QWidget
|
class ThemeChooser : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ThemeSettingsWidget(QWidget *parent = 0);
|
ThemeChooser(QWidget *parent = 0);
|
||||||
~ThemeSettingsWidget();
|
~ThemeChooser();
|
||||||
|
|
||||||
void apply();
|
void apply();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void refreshThemeList();
|
void refreshThemeList();
|
||||||
ThemeSettingsPrivate *d;
|
ThemeChooserPrivate *d;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
Reference in New Issue
Block a user