This commit is contained in:
dnk-88 2010-12-01 12:27:44 +02:00
commit f7374c55cf
3 changed files with 84 additions and 12 deletions

View file

@ -68,6 +68,10 @@ public:
{ {
return _SkeletonTreeModel; return _SkeletonTreeModel;
} }
QPalette getOriginalPalette() const
{
return _originalPalette;
}
private Q_SLOTS: private Q_SLOTS:
void open(); void open();

View file

@ -24,6 +24,8 @@
#include <QtGui/QWidget> #include <QtGui/QWidget>
#include <QtGui/QMessageBox> #include <QtGui/QMessageBox>
#include <QtGui/QFileDialog> #include <QtGui/QFileDialog>
#include <QtGui/QStyleFactory>
#include <QtGui/QStyle>
// NeL includes // NeL includes
#include <nel/misc/path.h> #include <nel/misc/path.h>
@ -278,6 +280,12 @@ void CSettingsDialog::loadGraphicsSettings()
ui.enableBloomCheckBox->setChecked(Modules::objView().getBloomEffect()); ui.enableBloomCheckBox->setChecked(Modules::objView().getBloomEffect());
ui.squareBloomCheckBox->setChecked(NL3D::CBloomEffect::instance().getSquareBloom()); ui.squareBloomCheckBox->setChecked(NL3D::CBloomEffect::instance().getSquareBloom());
ui.bloomDensityHorizontalSlider->setValue(NL3D::CBloomEffect::instance().getDensityBloom()); ui.bloomDensityHorizontalSlider->setValue(NL3D::CBloomEffect::instance().getDensityBloom());
ui.styleComboBox->addItems(QStyleFactory::keys());
ui.styleComboBox->setCurrentIndex(ui.styleComboBox->findText(Modules::config().getValue("QtStyle", std::string("")).c_str()));
ui.paletteCheckBox->setChecked(Modules::config().getValue("QtPalette", false));
} }
void CSettingsDialog::loadSoundSettings() void CSettingsDialog::loadSoundSettings()
@ -326,6 +334,16 @@ void CSettingsDialog::saveGraphicsSettings()
Modules::config().getConfigFile().getVar("BloomEffect").setAsInt(ui.enableBloomCheckBox->isChecked()); Modules::config().getConfigFile().getVar("BloomEffect").setAsInt(ui.enableBloomCheckBox->isChecked());
Modules::config().getConfigFile().getVar("BloomSquare").setAsInt(ui.squareBloomCheckBox->isChecked()); Modules::config().getConfigFile().getVar("BloomSquare").setAsInt(ui.squareBloomCheckBox->isChecked());
Modules::config().getConfigFile().getVar("BloomDensity").setAsInt(ui.bloomDensityHorizontalSlider->value()); Modules::config().getConfigFile().getVar("BloomDensity").setAsInt(ui.bloomDensityHorizontalSlider->value());
Modules::config().getConfigFile().getVar("QtStyle").setAsString(ui.styleComboBox->currentText().toStdString());
Modules::config().getConfigFile().getVar("QtPalette").setAsInt(ui.paletteCheckBox->isChecked());
QApplication::setStyle(QStyleFactory::create(ui.styleComboBox->currentText()));
if (ui.paletteCheckBox->isChecked())
QApplication::setPalette(QApplication::style()->standardPalette());
else
QApplication::setPalette(Modules::mainWin().getOriginalPalette());
} }
void CSettingsDialog::saveSoundSettings() void CSettingsDialog::saveSoundSettings()

View file

@ -24,7 +24,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2"> <item row="0" column="0" rowspan="2">
<widget class="QListWidget" name="listWidget"> <widget class="QListWidget" name="listWidget">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding"> <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
@ -60,17 +60,7 @@
</item> </item>
</widget> </widget>
</item> </item>
<item row="1" column="0" colspan="3"> <item row="0" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QStackedWidget" name="stackedWidget"> <widget class="QStackedWidget" name="stackedWidget">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding"> <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
@ -177,6 +167,49 @@
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="2" column="0">
<widget class="QGroupBox" name="qtStyleGroupBox">
<property name="title">
<string>Qt Style</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Style</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QComboBox" name="styleComboBox"/>
</item>
</layout>
</item>
<item>
<widget class="QCheckBox" name="paletteCheckBox">
<property name="text">
<string>Use style's standard palette</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="3" column="0">
<spacer name="verticalSpacer_2"> <spacer name="verticalSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
@ -581,6 +614,23 @@
</widget> </widget>
</widget> </widget>
</item> </item>
<item row="1" column="1">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<tabstops> <tabstops>