Commit ff57dddd authored by Mike Kremer's avatar Mike Kremer

Fixed some issues with the options widget:

- Adjusted size of some input boxes
- Corrected setting of frame rate restriction
- Deleted grid option (this is now a plugin)

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@10259 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 5fcdb8e0
......@@ -155,10 +155,10 @@ OptionsWidget::OptionsWidget(std::vector<PluginInfo>& _plugins, std::vector<KeyB
void OptionsWidget::getBackgroundColor(){
QColor newColor = QColorDialog::getColor ( OpenFlipperSettings().value("Core/Gui/glViewer/defaultBackgroundColor").value<QColor>() );
OpenFlipperSettings().setValue("Core/Gui/glViewer/defaultBackgroundColor", newColor);
backgroundColor_ = newColor;
QPixmap color(16,16);
color.fill( OpenFlipperSettings().value("Core/Gui/glViewer/defaultBackgroundColor").value<QColor>() );
color.fill( newColor );
backgroundButton->setIcon( QIcon(color) );
}
......@@ -368,8 +368,8 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
//Init Viewer Settings
wZoomFactor->setText( QString::number(OpenFlipperSettings().value("Core/Mouse/Wheel/ZoomFactor").toDouble(), 'f') );
wZoomFactorShift->setText( QString::number(OpenFlipperSettings().value("Core/Mouse/Wheel/ZoomFactorShift").toDouble(), 'f') );
wZoomFactor->setValue( OpenFlipperSettings().value("Core/Mouse/Wheel/ZoomFactor").toDouble() );
wZoomFactorShift->setValue( OpenFlipperSettings().value("Core/Mouse/Wheel/ZoomFactorShift").toDouble() );
wheelBox->setChecked( OpenFlipperSettings().value("Core/Gui/glViewer/showControlWheels").toBool() );
......@@ -378,6 +378,7 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
QPixmap color(16,16);
color.fill( OpenFlipperSettings().value("Core/Gui/glViewer/defaultBackgroundColor").value<QColor>() );
backgroundColor_ = OpenFlipperSettings().value("Core/Gui/glViewer/defaultBackgroundColor").value<QColor>();
backgroundButton->setIcon( QIcon(color) );
color.fill( OpenFlipper::Options::defaultBaseColor() );
......@@ -397,8 +398,6 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
viewerLayout->setCurrentIndex( OpenFlipper::Options::defaultViewerLayout() );
gridVisible->setChecked (OpenFlipper::Options::gridVisible());
if (OpenFlipper::Options::translation() == "en_US")
translation->setCurrentIndex(0);
else if (OpenFlipper::Options::translation() == "de_DE")
......@@ -670,7 +669,23 @@ void OptionsWidget::slotApply() {
}
OpenFlipper::Options::defaultViewerLayout( viewerLayout->currentIndex() );
OpenFlipper::Options::gridVisible( gridVisible->isChecked() );
// Restrict fps if desired
if(restrictFPS->isChecked()) {
OpenFlipperSettings().setValue("Core/Gui/glViewer/restrictFrameRate", true);
OpenFlipperSettings().setValue("Core/Gui/glViewer/maxFrameRate",FPS->value());
} else {
OpenFlipperSettings().setValue("Core/Gui/glViewer/restrictFrameRate", false);
}
// Set background color
OpenFlipperSettings().setValue("Core/Gui/glViewer/defaultBackgroundColor", backgroundColor_);
for ( uint i = 0 ; i < OpenFlipper::Options::examinerWidgets(); ++i )
PluginFunctions::viewerProperties(i).backgroundColor(ACG::Vec4f(((double) backgroundColor_.redF()),
((double) backgroundColor_.greenF()),
((double) backgroundColor_.blueF()),
1.0));
// Show warning message that restart is required if language has been changed...
if(translationIndexChanged_) {
......
......@@ -178,6 +178,9 @@ private:
std::vector< int > defaultViewingDirections_;
bool updatingViewerSettings_;
// Store current background color
QColor backgroundColor_;
private:
/// Starts the download of the given file
......
......@@ -23,7 +23,7 @@
<string/>
</property>
<property name="currentIndex">
<number>3</number>
<number>2</number>
</property>
<property name="usesScrollButtons">
<bool>true</bool>
......@@ -260,48 +260,48 @@
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>MouseWheel Zoom Sensitivity (shift):</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="wZoomFactor">
<widget class="QDoubleSpinBox" name="wZoomFactor">
<property name="maximumSize">
<size>
<width>100</width>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the factor to control the zooming with the mouse-wheel</string>
<property name="maximum">
<double>10.000000000000000</double>
</property>
<property name="statusTip">
<string>Set the factor to control the zooming with the mouse-wheel</string>
<property name="singleStep">
<double>0.200000000000000</double>
</property>
<property name="inputMask">
<string>9.99; </string>
<property name="value">
<double>1.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>MouseWheel Zoom Sensitivity (shift):</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="wZoomFactorShift">
<item row="3" column="1">
<widget class="QDoubleSpinBox" name="wZoomFactorShift">
<property name="maximumSize">
<size>
<width>100</width>
<width>70</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>Set the factor to control the zooming with the mouse-wheel while the shift key is pressed</string>
<property name="maximum">
<double>5.000000000000000</double>
</property>
<property name="statusTip">
<string>Set the factor to control the zooming with the mouse-wheel while the shift key is pressed</string>
<property name="singleStep">
<double>0.100000000000000</double>
</property>
<property name="inputMask">
<string>9.99; </string>
<property name="value">
<double>0.200000000000000</double>
</property>
</widget>
</item>
......@@ -319,10 +319,10 @@
<item>
<widget class="QCheckBox" name="restrictFPS">
<property name="toolTip">
<string>restrict maximum framerate</string>
<string>Restrict maximum framerate, note that this won't work if in animation mode.</string>
</property>
<property name="statusTip">
<string>restrict maximum framerate</string>
<string>Restrict maximum framerate, note that this won't work if in animation mode.</string>
</property>
<property name="text">
<string>Restrict Framerate</string>
......@@ -375,7 +375,7 @@
<item>
<widget class="QPushButton" name="backgroundButton">
<property name="text">
<string>Default background color</string>
<string>Background color</string>
</property>
</widget>
</item>
......@@ -404,7 +404,7 @@
<item>
<widget class="QCheckBox" name="randomBaseColor">
<property name="text">
<string>use random base color</string>
<string>Use random base color</string>
</property>
</widget>
</item>
......@@ -418,16 +418,6 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="gridVisible">
<property name="toolTip">
<string>show a grid in the back of every viewer</string>
</property>
<property name="text">
<string>Show grid</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="nativeMouse">
<property name="toolTip">
......
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