Commit fe8ee24e authored by Jan Möbius's avatar Jan Möbius
Browse files

Added spinbox for shininess for better control. closes #527

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@14332 383ad7c9-94d9-4d36-a494-682f7c89f535
parent f9d8e470
......@@ -126,6 +126,7 @@ QtMaterialDialog::QtMaterialDialog( QWidget * _parent,
setButtonColor( ui_.specularColorButton, specular_ );
ui_.shininessSlider->setValue((int)shine_);
ui_.shininessBox->setValue((int)shine_);
ui_.pointSizeSpinBox->setValue((int)point_size_);
ui_.lineWidthSpinBox->setValue((int)line_width_);
ui_.roundPointsCheckBox->setChecked(round_points_);
......@@ -164,6 +165,7 @@ QtMaterialDialog::QtMaterialDialog( QWidget * _parent,
connect( ui_.diffuseColorButton, SIGNAL( clicked() ), this, SLOT( enableProperty() ) );
connect( ui_.specularColorButton, SIGNAL( clicked() ), this, SLOT( enableProperty() ) );
connect( ui_.shininessSlider, SIGNAL( sliderPressed() ), this, SLOT( enableProperty() ) );
connect( ui_.shininessBox, SIGNAL( valueChanged(int) ), this, SLOT( enableProperty(int) ) );
connect( ui_.pointSizeSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( enableProperty(int) ) );
connect( ui_.lineWidthSpinBox, SIGNAL( valueChanged(int) ), this, SLOT( enableProperty(int) ) );
connect( ui_.roundPointsCheckBox, SIGNAL( pressed() ), this, SLOT( enableProperty() ) );
......@@ -182,7 +184,7 @@ QtMaterialDialog::QtMaterialDialog( QWidget * _parent,
this, SLOT( changeDiffuseColor(QColor) ) );
connect( ui_.specularColorButton, SIGNAL( colorChanged(QColor) ),
this, SLOT( changeSpecularColor(QColor) ) );
connect( ui_.shininessSlider, SIGNAL( sliderMoved(int) ),
connect( ui_.shininessSlider, SIGNAL( valueChanged(int) ),
this, SLOT( changeShine(int) ) );
connect( ui_.pointSizeSpinBox, SIGNAL( valueChanged(int) ),
......@@ -713,6 +715,7 @@ QtMaterialDialog::enableProperty(int /*i*/)
else if (sender() == ui_.diffuseColorButton) ui_.materialActive->setChecked( true );
else if (sender() == ui_.specularColorButton) ui_.materialActive->setChecked( true );
else if (sender() == ui_.shininessSlider) ui_.materialActive->setChecked( true );
else if (sender() == ui_.shininessBox) ui_.materialActive->setChecked( true );
else if (sender() == ui_.pointSizeSpinBox) ui_.pointSizeActive->setChecked( true );
else if (sender() == ui_.lineWidthSpinBox) ui_.lineWidthActive->setChecked( true );
else if (sender() == ui_.roundPointsCheckBox) ui_.roundPointsActive->setChecked( true );
......@@ -735,6 +738,7 @@ QtMaterialDialog::enableProperty()
else if (sender() == ui_.diffuseColorButton) ui_.materialActive->setChecked( true );
else if (sender() == ui_.specularColorButton) ui_.materialActive->setChecked( true );
else if (sender() == ui_.shininessSlider) ui_.materialActive->setChecked( true );
else if (sender() == ui_.shininessBox) ui_.materialActive->setChecked( true );
else if (sender() == ui_.pointSizeSpinBox) ui_.pointSizeActive->setChecked( true );
else if (sender() == ui_.lineWidthSpinBox) ui_.lineWidthActive->setChecked( true );
else if (sender() == ui_.roundPointsCheckBox) ui_.roundPointsActive->setChecked( true );
......
......@@ -74,34 +74,15 @@
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<item row="0" column="0">
<widget class="QtColorChooserButton" name="baseColorButton">
<property name="text">
<string>Base Color</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QSlider" name="shininessSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<string/>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="label_4">
<item row="0" column="1">
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
......@@ -109,12 +90,12 @@
</sizepolicy>
</property>
<property name="text">
<string>Specular Color</string>
<string>Base Color</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QtColorChooserButton" name="specularColorButton">
<item row="1" column="0">
<widget class="QtColorChooserButton" name="ambientColorButton">
<property name="text">
<string/>
</property>
......@@ -153,15 +134,15 @@
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QtColorChooserButton" name="baseColorButton">
<item row="3" column="0">
<widget class="QtColorChooserButton" name="specularColorButton">
<property name="text">
<string/>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="label_5">
<item row="3" column="1">
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
......@@ -169,26 +150,49 @@
</sizepolicy>
</property>
<property name="text">
<string>Shininess</string>
<string>Specular Color</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QtColorChooserButton" name="ambientColorButton">
<item row="4" column="1">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string/>
<string>Shininess</string>
</property>
</widget>
</item>
<item row="4" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QSlider" name="shininessSlider">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="shininessBox"/>
</item>
</layout>
</item>
</layout>
</item>
<item row="2" column="1">
<spacer>
<item row="1" column="2">
<spacer name="s3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
......@@ -198,10 +202,13 @@
</property>
</spacer>
</item>
<item row="1" column="2">
<spacer name="s3">
<item row="2" column="1">
<spacer>
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
......@@ -748,5 +755,38 @@ back is visible should be rendered.</string>
</customwidget>
</customwidgets>
<resources/>
<connections/>
<connections>
<connection>
<sender>shininessSlider</sender>
<signal>valueChanged(int)</signal>
<receiver>shininessBox</receiver>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>62</x>
<y>240</y>
</hint>
<hint type="destinationlabel">
<x>154</x>
<y>245</y>
</hint>
</hints>
</connection>
<connection>
<sender>shininessBox</sender>
<signal>valueChanged(int)</signal>
<receiver>shininessSlider</receiver>
<slot>setValue(int)</slot>
<hints>
<hint type="sourcelabel">
<x>161</x>
<y>227</y>
</hint>
<hint type="destinationlabel">
<x>75</x>
<y>229</y>
</hint>
</hints>
</connection>
</connections>
</ui>
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