From ff57dddd5c4e8df1e79ff2f1969951f2af656b19 Mon Sep 17 00:00:00 2001 From: Mike Kremer Date: Fri, 19 Nov 2010 12:00:24 +0000 Subject: [PATCH] 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 --- widgets/optionsWidget/optionsWidget.cc | 31 +++++++++--- widgets/optionsWidget/optionsWidget.hh | 3 ++ widgets/optionsWidget/optionsWidget.ui | 68 +++++++++++--------------- 3 files changed, 55 insertions(+), 47 deletions(-) diff --git a/widgets/optionsWidget/optionsWidget.cc b/widgets/optionsWidget/optionsWidget.cc index 6961ce17..f845a1b7 100644 --- a/widgets/optionsWidget/optionsWidget.cc +++ b/widgets/optionsWidget/optionsWidget.cc @@ -155,10 +155,10 @@ OptionsWidget::OptionsWidget(std::vector& _plugins, std::vector() ); - OpenFlipperSettings().setValue("Core/Gui/glViewer/defaultBackgroundColor", newColor); - + backgroundColor_ = newColor; + QPixmap color(16,16); - color.fill( OpenFlipperSettings().value("Core/Gui/glViewer/defaultBackgroundColor").value() ); + 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() ); + backgroundColor_ = OpenFlipperSettings().value("Core/Gui/glViewer/defaultBackgroundColor").value(); 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_) { diff --git a/widgets/optionsWidget/optionsWidget.hh b/widgets/optionsWidget/optionsWidget.hh index 33cd592c..9bb29664 100644 --- a/widgets/optionsWidget/optionsWidget.hh +++ b/widgets/optionsWidget/optionsWidget.hh @@ -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 diff --git a/widgets/optionsWidget/optionsWidget.ui b/widgets/optionsWidget/optionsWidget.ui index d2566623..4641974e 100644 --- a/widgets/optionsWidget/optionsWidget.ui +++ b/widgets/optionsWidget/optionsWidget.ui @@ -23,7 +23,7 @@ - 3 + 2 true @@ -260,48 +260,48 @@ + + + + MouseWheel Zoom Sensitivity (shift): + + + - + - 100 + 70 16777215 - - Set the factor to control the zooming with the mouse-wheel + + 10.000000000000000 - - Set the factor to control the zooming with the mouse-wheel + + 0.200000000000000 - - 9.99; + + 1.000000000000000 - - - - MouseWheel Zoom Sensitivity (shift): - - - - - + + - 100 + 70 16777215 - - Set the factor to control the zooming with the mouse-wheel while the shift key is pressed + + 5.000000000000000 - - Set the factor to control the zooming with the mouse-wheel while the shift key is pressed + + 0.100000000000000 - - 9.99; + + 0.200000000000000 @@ -319,10 +319,10 @@ - restrict maximum framerate + Restrict maximum framerate, note that this won't work if in animation mode. - restrict maximum framerate + Restrict maximum framerate, note that this won't work if in animation mode. Restrict Framerate @@ -375,7 +375,7 @@ - Default background color + Background color @@ -404,7 +404,7 @@ - use random base color + Use random base color @@ -418,16 +418,6 @@ - - - - show a grid in the back of every viewer - - - Show grid - - - -- GitLab