Merged duplicate preview view sphere settings.

This commit is contained in:
Leonardo Zide 2020-12-26 16:00:51 -08:00
parent 18ad850e1a
commit 81817ac4ad
6 changed files with 8 additions and 12 deletions

View file

@ -59,7 +59,6 @@ void lcPreferences::LoadDefaults()
mPreviewLocation = static_cast<lcPreviewLocation>(lcGetProfileInt(LC_PROFILE_PREVIEW_LOCATION)); mPreviewLocation = static_cast<lcPreviewLocation>(lcGetProfileInt(LC_PROFILE_PREVIEW_LOCATION));
mPreviewPosition = static_cast<lcPreviewPosition>(lcGetProfileInt(LC_PROFILE_PREVIEW_POSITION)); mPreviewPosition = static_cast<lcPreviewPosition>(lcGetProfileInt(LC_PROFILE_PREVIEW_POSITION));
mDrawPreviewAxis = lcGetProfileInt(LC_PROFILE_PREVIEW_DRAW_AXES); mDrawPreviewAxis = lcGetProfileInt(LC_PROFILE_PREVIEW_DRAW_AXES);
mDrawPreviewViewSphere = lcGetProfileInt(LC_PROFILE_PREVIEW_DRAW_VIEW_SPHERE);
} }
void lcPreferences::SaveDefaults() void lcPreferences::SaveDefaults()
@ -107,7 +106,6 @@ void lcPreferences::SaveDefaults()
lcSetProfileInt(LC_PROFILE_PREVIEW_LOCATION, static_cast<int>(mPreviewLocation)); lcSetProfileInt(LC_PROFILE_PREVIEW_LOCATION, static_cast<int>(mPreviewLocation));
lcSetProfileInt(LC_PROFILE_PREVIEW_POSITION, static_cast<int>(mPreviewPosition)); lcSetProfileInt(LC_PROFILE_PREVIEW_POSITION, static_cast<int>(mPreviewPosition));
lcSetProfileInt(LC_PROFILE_PREVIEW_DRAW_AXES, mDrawPreviewAxis); lcSetProfileInt(LC_PROFILE_PREVIEW_DRAW_AXES, mDrawPreviewAxis);
lcSetProfileInt(LC_PROFILE_PREVIEW_DRAW_VIEW_SPHERE, mDrawPreviewViewSphere);
} }
void lcPreferences::SetInterfaceColors(lcColorTheme ColorTheme) void lcPreferences::SetInterfaceColors(lcColorTheme ColorTheme)

View file

@ -86,7 +86,6 @@ public:
lcPreviewPosition mPreviewPosition; lcPreviewPosition mPreviewPosition;
int mPreviewSize; int mPreviewSize;
int mDrawPreviewAxis; int mDrawPreviewAxis;
int mDrawPreviewViewSphere;
}; };
class lcApplication : public QApplication class lcApplication : public QApplication

View file

@ -844,8 +844,9 @@ void lcMainWindow::TogglePreviewWidget(bool Visible)
void lcMainWindow::EnableWindowFlags(bool Detached) void lcMainWindow::EnableWindowFlags(bool Detached)
{ {
if (Detached) { if (Detached)
QDockWidget *DockWidget = qobject_cast<QDockWidget *>(sender()); {
QDockWidget* DockWidget = qobject_cast<QDockWidget*>(sender());
DockWidget->setWindowFlags(Qt::CustomizeWindowHint | DockWidget->setWindowFlags(Qt::CustomizeWindowHint |
Qt::Window | Qt::Window |
Qt::WindowMinimizeButtonHint | Qt::WindowMinimizeButtonHint |
@ -2181,12 +2182,12 @@ void lcMainWindow::UpdateUndoRedo(const QString& UndoText, const QString& RedoTe
void lcMainWindow::ViewFocusReceived() void lcMainWindow::ViewFocusReceived()
{ {
SetActiveView(dynamic_cast<lcView*>(sender())); SetActiveView(qobject_cast<lcView*>(sender()));
} }
void lcMainWindow::ViewCameraChanged() void lcMainWindow::ViewCameraChanged()
{ {
lcView* View = dynamic_cast<lcView*>(sender()); lcView* View = qobject_cast<lcView*>(sender());
if (!View || !View->IsLastFocused()) if (!View || !View->IsLastFocused())
return; return;

View file

@ -139,7 +139,6 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] =
lcProfileEntry("Settings", "PreviewLocation", (int)lcPreviewLocation::BottomRight), // LC_PROFILE_PREVIEW_LOCATION lcProfileEntry("Settings", "PreviewLocation", (int)lcPreviewLocation::BottomRight), // LC_PROFILE_PREVIEW_LOCATION
lcProfileEntry("Settings", "PreviewPosition", (int)lcPreviewPosition::Dockable), // LC_PROFILE_PREVIEW_POSITION lcProfileEntry("Settings", "PreviewPosition", (int)lcPreviewPosition::Dockable), // LC_PROFILE_PREVIEW_POSITION
lcProfileEntry("Settings", "DrawPreviewAxis", 0), // LC_PROFILE_PREVIEW_DRAW_AXES lcProfileEntry("Settings", "DrawPreviewAxis", 0), // LC_PROFILE_PREVIEW_DRAW_AXES
lcProfileEntry("Settings", "DrawPreviewViewSphere",1) // LC_PROFILE_PREVIEW_DRAW_VIEW_SPHERE
}; };
void lcRemoveProfileKey(LC_PROFILE_KEY Key) void lcRemoveProfileKey(LC_PROFILE_KEY Key)

View file

@ -88,7 +88,6 @@ enum LC_PROFILE_KEY
LC_PROFILE_PREVIEW_LOCATION, LC_PROFILE_PREVIEW_LOCATION,
LC_PROFILE_PREVIEW_POSITION, LC_PROFILE_PREVIEW_POSITION,
LC_PROFILE_PREVIEW_DRAW_AXES, LC_PROFILE_PREVIEW_DRAW_AXES,
LC_PROFILE_PREVIEW_DRAW_VIEW_SPHERE,
LC_NUM_PROFILE_KEYS LC_NUM_PROFILE_KEYS
}; };

View file

@ -134,7 +134,7 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO
ui->PreviewAxisIconCheckBox->setChecked(mOptions->Preferences.mDrawPreviewAxis); ui->PreviewAxisIconCheckBox->setChecked(mOptions->Preferences.mDrawPreviewAxis);
ui->PreviewViewSphereCheckBox->setChecked(mOptions->Preferences.mDrawPreviewViewSphere); ui->PreviewViewSphereCheckBox->setChecked(mOptions->Preferences.mPreviewViewSphereEnabled);
ui->PreviewLocationCombo->setCurrentIndex((int)mOptions->Preferences.mPreviewLocation); ui->PreviewLocationCombo->setCurrentIndex((int)mOptions->Preferences.mPreviewLocation);
@ -361,8 +361,6 @@ void lcQPreferencesDialog::accept()
mOptions->Preferences.mDrawPreviewAxis = ui->PreviewAxisIconCheckBox->isChecked(); mOptions->Preferences.mDrawPreviewAxis = ui->PreviewAxisIconCheckBox->isChecked();
mOptions->Preferences.mDrawPreviewViewSphere = ui->PreviewViewSphereCheckBox->isChecked();
mOptions->Preferences.mPreviewLocation = (lcPreviewLocation)ui->PreviewLocationCombo->currentIndex(); mOptions->Preferences.mPreviewLocation = (lcPreviewLocation)ui->PreviewLocationCombo->currentIndex();
mOptions->Preferences.mPreviewPosition = (lcPreviewPosition)ui->PreviewPositionCombo->currentIndex(); mOptions->Preferences.mPreviewPosition = (lcPreviewPosition)ui->PreviewPositionCombo->currentIndex();
@ -397,6 +395,8 @@ void lcQPreferencesDialog::accept()
break; break;
} }
mOptions->Preferences.mPreviewViewSphereEnabled = ui->PreviewViewSphereCheckBox->isChecked();
QDialog::accept(); QDialog::accept();
} }