diff --git a/common/lc_application.cpp b/common/lc_application.cpp index a8194304..7e8b1b94 100644 --- a/common/lc_application.cpp +++ b/common/lc_application.cpp @@ -50,14 +50,9 @@ void lcPreferences::LoadDefaults() mAutoLoadMostRecent = lcGetProfileInt(LC_PROFILE_AUTOLOAD_MOSTRECENT); mRestoreTabLayout = lcGetProfileInt(LC_PROFILE_RESTORE_TAB_LAYOUT); mColorTheme = static_cast(lcGetProfileInt(LC_PROFILE_COLOR_THEME)); - mPreviewViewSphereEnabled = lcGetProfileInt(LC_PROFILE_PREVIEW_VIEW_SPHERE_ENABLED); mPreviewViewSphereSize = lcGetProfileInt(LC_PROFILE_PREVIEW_VIEW_SPHERE_SIZE); mPreviewViewSphereLocation = static_cast(lcGetProfileInt(LC_PROFILE_PREVIEW_VIEW_SPHERE_LOCATION)); - mPreviewEnabled = lcGetProfileInt(LC_PROFILE_PREVIEW_ENABLED); - mPreviewSize = lcGetProfileInt(LC_PROFILE_PREVIEW_SIZE); - mPreviewLocation = static_cast(lcGetProfileInt(LC_PROFILE_PREVIEW_LOCATION)); - mPreviewPosition = static_cast(lcGetProfileInt(LC_PROFILE_PREVIEW_POSITION)); mDrawPreviewAxis = lcGetProfileInt(LC_PROFILE_PREVIEW_DRAW_AXES); } @@ -97,14 +92,8 @@ void lcPreferences::SaveDefaults() lcSetProfileInt(LC_PROFILE_AUTOLOAD_MOSTRECENT, mAutoLoadMostRecent); lcSetProfileInt(LC_PROFILE_RESTORE_TAB_LAYOUT, mRestoreTabLayout); lcSetProfileInt(LC_PROFILE_COLOR_THEME, static_cast(mColorTheme)); - - lcSetProfileInt(LC_PROFILE_PREVIEW_ENABLED, mPreviewViewSphereEnabled); lcSetProfileInt(LC_PROFILE_PREVIEW_VIEW_SPHERE_SIZE, mPreviewViewSphereSize); lcSetProfileInt(LC_PROFILE_PREVIEW_VIEW_SPHERE_LOCATION, static_cast(mPreviewViewSphereLocation)); - lcSetProfileInt(LC_PROFILE_PREVIEW_ENABLED, mPreviewEnabled); - lcSetProfileInt(LC_PROFILE_PREVIEW_SIZE, mPreviewSize); - lcSetProfileInt(LC_PROFILE_PREVIEW_LOCATION, static_cast(mPreviewLocation)); - lcSetProfileInt(LC_PROFILE_PREVIEW_POSITION, static_cast(mPreviewPosition)); lcSetProfileInt(LC_PROFILE_PREVIEW_DRAW_AXES, mDrawPreviewAxis); } @@ -1046,8 +1035,6 @@ void lcApplication::ShowPreferencesDialog() Options.MouseShortcutsModified = false; Options.MouseShortcutsDefault = false; - lcPreviewPosition PreviewDockable = Options.Preferences.mPreviewPosition; - lcQPreferencesDialog Dialog(gMainWindow, &Options); if (Dialog.exec() != QDialog::Accepted) return; @@ -1074,11 +1061,6 @@ void lcApplication::ShowPreferencesDialog() lcSetProfileInt(LC_PROFILE_ANTIALIASING_SAMPLES, Options.AASamples); lcSetProfileInt(LC_PROFILE_STUD_LOGO, Options.StudLogo); - lcPreviewPosition Dockable = Options.Preferences.mPreviewPosition; - if (PreviewDockable != Dockable) - gMainWindow->TogglePreviewWidget( - Dockable == lcPreviewPosition::Dockable); - if (LanguageChanged || LibraryChanged || ColorsChanged || AAChanged) QMessageBox::information(gMainWindow, tr("LeoCAD"), tr("Some changes will only take effect the next time you start LeoCAD.")); diff --git a/common/lc_application.h b/common/lc_application.h index a1f9c151..731ee240 100644 --- a/common/lc_application.h +++ b/common/lc_application.h @@ -14,21 +14,6 @@ enum class lcShadingMode Full }; -enum class lcPreviewLocation -{ - TopLeft, - TopRight, - BottomLeft, - BottomRight -}; - -enum class lcPreviewPosition -{ - Dockable, - Floating, - Viewport // not implemented -}; - enum class lcColorTheme { Dark, @@ -78,13 +63,9 @@ public: bool mRestoreTabLayout; lcColorTheme mColorTheme; - int mPreviewEnabled; int mPreviewViewSphereEnabled; int mPreviewViewSphereSize; lcViewSphereLocation mPreviewViewSphereLocation; - lcPreviewLocation mPreviewLocation; - lcPreviewPosition mPreviewPosition; - int mPreviewSize; int mDrawPreviewAxis; }; diff --git a/common/lc_mainwindow.cpp b/common/lc_mainwindow.cpp index 95fe2dee..e2a958f6 100644 --- a/common/lc_mainwindow.cpp +++ b/common/lc_mainwindow.cpp @@ -554,9 +554,7 @@ void lcMainWindow::CreateMenus() ToolBarsMenu->addAction(mActions[LC_VIEW_TOOLBAR_COLORS]); ToolBarsMenu->addAction(mActions[LC_VIEW_TOOLBAR_PROPERTIES]); ToolBarsMenu->addAction(mActions[LC_VIEW_TOOLBAR_TIMELINE]); - lcPreferences& Preferences = lcGetPreferences(); - if (Preferences.mPreviewEnabled && Preferences.mPreviewPosition == lcPreviewPosition::Dockable) - ToolBarsMenu->addAction(mActions[LC_VIEW_TOOLBAR_PREVIEW]); + ToolBarsMenu->addAction(mActions[LC_VIEW_TOOLBAR_PREVIEW]); ToolBarsMenu->addSeparator(); ToolBarsMenu->addAction(mActions[LC_VIEW_TOOLBAR_STANDARD]); ToolBarsMenu->addAction(mActions[LC_VIEW_TOOLBAR_TOOLS]); @@ -775,10 +773,7 @@ void lcMainWindow::CreateToolBars() mTimelineToolBar->setWidget(mTimelineWidget); addDockWidget(Qt::RightDockWidgetArea, mTimelineToolBar); - // Preview - const lcPreferences& Preferences = lcGetPreferences(); - if (Preferences.mPreviewPosition == lcPreviewPosition::Dockable) - CreatePreviewWidget(); + CreatePreviewWidget(); tabifyDockWidget(mPartsToolBar, mPropertiesToolBar); tabifyDockWidget(mPropertiesToolBar, mTimelineToolBar); @@ -805,34 +800,8 @@ lcView* lcMainWindow::CreateView(lcModel* Model) void lcMainWindow::PreviewPiece(const QString& PartId, int ColorCode) { - lcPreferences& Preferences = lcGetPreferences(); - - if (!Preferences.mPreviewEnabled) - return; - - if (Preferences.mPreviewPosition != lcPreviewPosition::Floating) - { - if (mPreviewWidget && mPreviewWidget->SetCurrentPiece(PartId, ColorCode)) - return; - } - else - { - lcPreview* Preview = new lcPreview(); - lcViewWidget* ViewWidget = new lcViewWidget(nullptr, Preview); - - if (Preview && ViewWidget) - { - ViewWidget->setAttribute(Qt::WA_DeleteOnClose, true); - - if (Preview->SetCurrentPiece(PartId, ColorCode)) - { - ViewWidget->SetPreviewPosition(rect()); - return; - } - } - } - - QMessageBox::information(this, tr("Error"), tr("Part preview for '%1' failed.").arg(PartId)); + if (!mPreviewWidget->SetCurrentPiece(PartId, ColorCode)) + QMessageBox::information(this, tr("Error"), tr("Part preview for '%1' failed.").arg(PartId)); } void lcMainWindow::CreatePreviewWidget() @@ -1003,9 +972,7 @@ QMenu* lcMainWindow::createPopupMenu() Menu->addAction(mActions[LC_VIEW_TOOLBAR_COLORS]); Menu->addAction(mActions[LC_VIEW_TOOLBAR_PROPERTIES]); Menu->addAction(mActions[LC_VIEW_TOOLBAR_TIMELINE]); - lcPreferences& Preferences = lcGetPreferences(); - if (Preferences.mPreviewEnabled && Preferences.mPreviewPosition == lcPreviewPosition::Dockable) - Menu->addAction(mActions[LC_VIEW_TOOLBAR_PREVIEW]); + Menu->addAction(mActions[LC_VIEW_TOOLBAR_PREVIEW]); Menu->addSeparator(); Menu->addAction(mActions[LC_VIEW_TOOLBAR_STANDARD]); Menu->addAction(mActions[LC_VIEW_TOOLBAR_TOOLS]); @@ -1023,9 +990,7 @@ void lcMainWindow::UpdateDockWidgetActions() mActions[LC_VIEW_TOOLBAR_STANDARD]->setChecked(mStandardToolBar->isVisible()); mActions[LC_VIEW_TOOLBAR_TOOLS]->setChecked(mToolsToolBar->isVisible()); mActions[LC_VIEW_TOOLBAR_TIME]->setChecked(mTimeToolBar->isVisible()); - lcPreferences& Preferences = lcGetPreferences(); - if (Preferences.mPreviewEnabled && Preferences.mPreviewPosition == lcPreviewPosition::Dockable) - mActions[LC_VIEW_TOOLBAR_PREVIEW]->setChecked(mPreviewToolBar->isVisible()); + mActions[LC_VIEW_TOOLBAR_PREVIEW]->setChecked(mPreviewToolBar->isVisible()); } void lcMainWindow::UpdateGamepads() diff --git a/common/lc_model.cpp b/common/lc_model.cpp index 5d298c36..a3cee324 100644 --- a/common/lc_model.cpp +++ b/common/lc_model.cpp @@ -4288,9 +4288,7 @@ void lcModel::ShowPropertiesDialog() mProperties = Options.Properties; - lcPreferences& Preferences = lcGetPreferences(); - if (Preferences.mPreviewEnabled && Preferences.mPreviewPosition != lcPreviewPosition::Floating) - gMainWindow->GetPreviewWidget()->UpdatePreview(); + gMainWindow->GetPreviewWidget()->UpdatePreview(); SaveCheckpoint(tr("Changing Properties")); } diff --git a/common/lc_profile.cpp b/common/lc_profile.cpp index 9850fde7..d452ef8d 100644 --- a/common/lc_profile.cpp +++ b/common/lc_profile.cpp @@ -131,13 +131,9 @@ static lcProfileEntry gProfileEntries[LC_NUM_PROFILE_KEYS] = lcProfileEntry("POVRay", "Width", 1280), // LC_PROFILE_POVRAY_WIDTH lcProfileEntry("POVRay", "Height", 720), // LC_PROFILE_POVRAY_HEIGHT - lcProfileEntry("Settgins", "PreviewViewSphereEnabled", 1), // LC_PROFILE_PREVIEW_VIEW_SPHERE_ENABLED + lcProfileEntry("Settgins", "PreviewViewSphereEnabled", 0), // LC_PROFILE_PREVIEW_VIEW_SPHERE_ENABLED lcProfileEntry("Settings", "PreviewViewSphereSize", 75), // LC_PROFILE_PREVIEW_VIEW_SPHERE_SIZE lcProfileEntry("Settings", "PreviewViewSphereLocation", (int)lcViewSphereLocation::TopRight), // LC_PROFILE_PREVIEW_VIEW_SPHERE_LOCATION - lcProfileEntry("Settings", "PreviewEnabled", 1), // LC_PROFILE_PREVIEW_ENABLED - lcProfileEntry("Settings", "PreviewSize", 300), // LC_PROFILE_PREVIEW_SIZE - lcProfileEntry("Settings", "PreviewLocation", (int)lcPreviewLocation::BottomRight), // LC_PROFILE_PREVIEW_LOCATION - lcProfileEntry("Settings", "PreviewPosition", (int)lcPreviewPosition::Dockable), // LC_PROFILE_PREVIEW_POSITION lcProfileEntry("Settings", "DrawPreviewAxis", 0), // LC_PROFILE_PREVIEW_DRAW_AXES }; diff --git a/common/lc_profile.h b/common/lc_profile.h index 7277375d..31d9bbca 100644 --- a/common/lc_profile.h +++ b/common/lc_profile.h @@ -82,11 +82,6 @@ enum LC_PROFILE_KEY LC_PROFILE_PREVIEW_VIEW_SPHERE_ENABLED, LC_PROFILE_PREVIEW_VIEW_SPHERE_SIZE, LC_PROFILE_PREVIEW_VIEW_SPHERE_LOCATION, - - LC_PROFILE_PREVIEW_ENABLED, - LC_PROFILE_PREVIEW_SIZE, - LC_PROFILE_PREVIEW_LOCATION, - LC_PROFILE_PREVIEW_POSITION, LC_PROFILE_PREVIEW_DRAW_AXES, LC_NUM_PROFILE_KEYS diff --git a/common/lc_viewwidget.cpp b/common/lc_viewwidget.cpp index 94bcae22..c81e04d6 100644 --- a/common/lc_viewwidget.cpp +++ b/common/lc_viewwidget.cpp @@ -71,54 +71,6 @@ void lcViewWidget::SetView(lcView* View) mView = View; } -void lcViewWidget::SetPreviewPosition(const QRect& ParentRect) -{ - lcPreferences& Preferences = lcGetPreferences(); - lcPreview* Preview = reinterpret_cast(mView); - - setWindowTitle(tr("%1 Preview").arg(Preview->IsModel() ? "Submodel" : "Part")); - - int Size[2] = { 300,200 }; - if (Preferences.mPreviewSize == 400) - { - Size[0] = 400; Size[1] = 300; - } - mPreferredSize = QSize(Size[0], Size[1]); - - const QRect desktop = QApplication::desktop()->geometry(); - - QPoint pos; - switch (Preferences.mPreviewLocation) - { - case lcPreviewLocation::TopRight: - pos = mapToGlobal(ParentRect.topRight()); - break; - case lcPreviewLocation::TopLeft: - pos = mapToGlobal(ParentRect.topLeft()); - break; - case lcPreviewLocation::BottomRight: - pos = mapToGlobal(ParentRect.bottomRight()); - break; - default: - pos = mapToGlobal(ParentRect.bottomLeft()); - break; - } - - if (pos.x() < desktop.left()) - pos.setX(desktop.left()); - if (pos.y() < desktop.top()) - pos.setY(desktop.top()); - - if ((pos.x() + width()) > desktop.right()) - pos.setX(desktop.right() - width()); - if ((pos.y() + height()) > desktop.bottom()) - pos.setY(desktop.bottom() - height()); - move(pos); - - setMinimumSize(100,100); - show(); -} - void lcViewWidget::initializeGL() { mView->mContext->SetGLContext(context()); diff --git a/common/lc_viewwidget.h b/common/lc_viewwidget.h index 48d0c601..488387da 100644 --- a/common/lc_viewwidget.h +++ b/common/lc_viewwidget.h @@ -20,7 +20,6 @@ public: } void SetView(lcView* View); - void SetPreviewPosition(const QRect& ParentRect); QSize sizeHint() const override; diff --git a/qt/lc_qpreferencesdialog.cpp b/qt/lc_qpreferencesdialog.cpp index 139671c7..e109341c 100644 --- a/qt/lc_qpreferencesdialog.cpp +++ b/qt/lc_qpreferencesdialog.cpp @@ -141,30 +141,6 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO ui->PreviewAxisIconCheckBox->setChecked(mOptions->Preferences.mDrawPreviewAxis); - ui->PreviewViewSphereCheckBox->setChecked(mOptions->Preferences.mPreviewViewSphereEnabled); - - ui->PreviewLocationCombo->setCurrentIndex((int)mOptions->Preferences.mPreviewLocation); - - ui->PreviewPositionCombo->setCurrentIndex((int)mOptions->Preferences.mPreviewPosition); - - if (mOptions->Preferences.mPreviewEnabled) - { - switch (mOptions->Preferences.mPreviewSize) - { - case 400: - ui->PreviewSizeCombo->setCurrentIndex(2); - break; - case 300: - ui->PreviewSizeCombo->setCurrentIndex(1); - break; - default: /*Disabled*/ - ui->PreviewSizeCombo->setCurrentIndex(0); - break; - } - } - else - ui->PreviewSizeCombo->setCurrentIndex(0); - ui->PreviewViewSphereLocationCombo->setCurrentIndex((int)mOptions->Preferences.mPreviewViewSphereLocation); if (mOptions->Preferences.mPreviewViewSphereEnabled) @@ -258,13 +234,7 @@ lcQPreferencesDialog::lcQPreferencesDialog(QWidget* Parent, lcPreferencesDialogO on_gridStuds_toggled(); on_gridLines_toggled(); on_ViewSphereSizeCombo_currentIndexChanged(ui->ViewSphereSizeCombo->currentIndex()); - on_PreviewViewSphereSizeCombo_currentIndexChanged(ui->PreviewViewSphereSizeCombo->currentIndex()); - on_PreviewSizeCombo_currentIndexChanged(ui->PreviewSizeCombo->currentIndex()); - on_PreviewPositionCombo_currentIndexChanged(ui->PreviewPositionCombo->currentIndex()); - ui->PreviewLocationCombo->setEnabled( - ui->PreviewSizeCombo->currentIndex() != 0 && - ui->PreviewPositionCombo->currentIndex() != 0); updateCategories(); ui->categoriesTree->setCurrentItem(ui->categoriesTree->topLevelItem(0)); @@ -347,12 +317,15 @@ void lcQPreferencesDialog::accept() { case 3: mOptions->Preferences.mViewSphereSize = 200; + mOptions->Preferences.mViewSphereEnabled = 1; break; case 2: mOptions->Preferences.mViewSphereSize = 100; + mOptions->Preferences.mViewSphereEnabled = 1; break; case 1: mOptions->Preferences.mViewSphereSize = 50; + mOptions->Preferences.mViewSphereEnabled = 1; break; default: mOptions->Preferences.mViewSphereEnabled = 0; @@ -368,42 +341,27 @@ void lcQPreferencesDialog::accept() mOptions->Preferences.mDrawPreviewAxis = ui->PreviewAxisIconCheckBox->isChecked(); - mOptions->Preferences.mPreviewLocation = (lcPreviewLocation)ui->PreviewLocationCombo->currentIndex(); - - mOptions->Preferences.mPreviewPosition = (lcPreviewPosition)ui->PreviewPositionCombo->currentIndex(); - - switch (ui->PreviewSizeCombo->currentIndex()) - { - case 2: - mOptions->Preferences.mPreviewSize = 400; - break; - case 1: - mOptions->Preferences.mPreviewSize = 300; - break; - default: - mOptions->Preferences.mPreviewEnabled = 0; - break; - } - mOptions->Preferences.mPreviewViewSphereLocation = (lcViewSphereLocation)ui->PreviewViewSphereLocationCombo->currentIndex(); switch (ui->PreviewViewSphereSizeCombo->currentIndex()) { case 3: mOptions->Preferences.mPreviewViewSphereSize = 100; + mOptions->Preferences.mPreviewViewSphereEnabled = 1; break; case 2: mOptions->Preferences.mPreviewViewSphereSize = 75; + mOptions->Preferences.mPreviewViewSphereEnabled = 1; break; case 1: mOptions->Preferences.mPreviewViewSphereSize = 50; + mOptions->Preferences.mPreviewViewSphereEnabled = 1; break; default: + mOptions->Preferences.mPreviewViewSphereEnabled = 0; break; } - mOptions->Preferences.mPreviewViewSphereEnabled = ui->PreviewViewSphereCheckBox->isChecked(); - QDialog::accept(); } @@ -621,29 +579,9 @@ void lcQPreferencesDialog::on_PreviewViewSphereSizeCombo_currentIndexChanged(int ui->PreviewViewSphereLocationCombo->setEnabled(Index != 0); } -void lcQPreferencesDialog::on_PreviewSizeCombo_currentIndexChanged(int Index) -{ - ui->PreviewLocationCombo->setEnabled(Index != 0); - if (ui->PreviewPositionCombo->currentIndex() != 0) - ui->PreviewPositionCombo->setEnabled(Index != 0); - ui->PreviewAxisIconCheckBox->setEnabled(Index != 0); - ui->PreviewViewSphereCheckBox->setEnabled(Index != 0); -} - -void lcQPreferencesDialog::on_PreviewPositionCombo_currentIndexChanged(int Index) -{ - ui->PreviewSizeCombo->setEnabled(Index != 0); - ui->PreviewLocationCombo->setEnabled(Index != 0); -} - void lcQPreferencesDialog::on_ViewSphereSizeCombo_currentIndexChanged(int Index) { - bool Enabled = Index != 0; - - ui->ViewSphereLocationCombo->setEnabled(Enabled); - ui->ViewSphereColorButton->setEnabled(Enabled); - ui->ViewSphereTextColorButton->setEnabled(Enabled); - ui->ViewSphereHighlightColorButton->setEnabled(Enabled); + ui->ViewSphereLocationCombo->setEnabled(Index != 0); } void lcQPreferencesDialog::updateCategories() diff --git a/qt/lc_qpreferencesdialog.h b/qt/lc_qpreferencesdialog.h index 6b6b5ce6..fa448dd8 100644 --- a/qt/lc_qpreferencesdialog.h +++ b/qt/lc_qpreferencesdialog.h @@ -74,6 +74,7 @@ public slots: void on_gridStuds_toggled(); void on_gridLines_toggled(); void on_ViewSphereSizeCombo_currentIndexChanged(int Index); + void on_PreviewViewSphereSizeCombo_currentIndexChanged(int Index); void updateParts(); void on_newCategory_clicked(); void on_editCategory_clicked(); @@ -96,10 +97,6 @@ public slots: void on_studLogo_toggled(); void MouseTreeItemChanged(QTreeWidgetItem* Current); - void on_PreviewSizeCombo_currentIndexChanged(int Index); - void on_PreviewViewSphereSizeCombo_currentIndexChanged(int Index); - void on_PreviewPositionCombo_currentIndexChanged(int Index); - private: Ui::lcQPreferencesDialog *ui; diff --git a/qt/lc_qpreferencesdialog.ui b/qt/lc_qpreferencesdialog.ui index 4e613afd..d000f795 100644 --- a/qt/lc_qpreferencesdialog.ui +++ b/qt/lc_qpreferencesdialog.ui @@ -542,23 +542,85 @@ - Interface + Views - Overlays + Model Views - + Axis icon + + + + Location: + + + + + + + View Sphere: + + + + + + + Disabled + + + + + Small + + + + + Medium + + + + + Large + + + + + + + + + Top Left + + + + + Top Right + + + + + Bottom Left + + + + + Bottom Right + + + + + Qt::Horizontal @@ -628,50 +690,20 @@ - + - View Sphere + Part Preview - - - - - - Disabled - - - - - Small - - - - - Medium - - - - - Large - - + + + + + Axis Icon + - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - + + Top Left @@ -694,34 +726,13 @@ - - + + Location: - - - - Preview Location - - - - - - - Preview Size: - - - - - - - Size: - - - @@ -746,132 +757,14 @@ - - - - - Top Left - - - - - Top Right - - - - - Bottom Left - - - - - Bottom Right - - - - - - - - - - - Preview - - - - + + - Location: + View Sphere: - - - - View Sphere - - - - - - - - Dockable - - - - - Floating - - - - - - - - Position: - - - - - - - Size: - - - - - - - - Top Left - - - - - Top Right - - - - - Bottom Left - - - - - Bottom Right - - - - - - - - Axis Icon - - - - - - - - Disabled - - - - - Small - - - - - Large - - - - - + Qt::Horizontal @@ -1762,18 +1655,14 @@ HighlightNewParts HighlightNewPartsColor ShadingMode + ViewSphereSizeCombo + ViewSphereLocationCombo AxisIconCheckBox gridStuds gridLines gridLineSpacing - ViewSphereSizeCombo - ViewSphereLocationCombo PreviewViewSphereSizeCombo PreviewViewSphereLocationCombo - PreviewSizeCombo - PreviewLocationCombo - PreviewPositionCombo - PreviewViewSphereCheckBox PreviewAxisIconCheckBox BackgroundSolidRadio BackgroundSolidColorButton diff --git a/qt/lc_qpropertiestree.cpp b/qt/lc_qpropertiestree.cpp index 49760f01..7fc42d8b 100644 --- a/qt/lc_qpropertiestree.cpp +++ b/qt/lc_qpropertiestree.cpp @@ -766,16 +766,12 @@ void lcQPropertiesTree::slotSetValue(int Value) PieceInfo* Info = (PieceInfo*)editor->itemData(Value).value(); Model->SetSelectedPiecesPieceInfo(Info); - lcPreferences& Preferences = lcGetPreferences(); - if (Preferences.mPreviewEnabled && Preferences.mPreviewPosition != lcPreviewPosition::Floating) - { - int ColorIndex = gDefaultColor; - lcObject* Focus = gMainWindow->GetActiveModel()->GetFocusObject(); - if (Focus && Focus->IsPiece()) - ColorIndex = ((lcPiece*)Focus)->mColorIndex; - quint32 ColorCode = lcGetColorCode(ColorIndex); - gMainWindow->PreviewPiece(Info->mFileName, ColorCode); - } + int ColorIndex = gDefaultColor; + lcObject* Focus = gMainWindow->GetActiveModel()->GetFocusObject(); + if (Focus && Focus->IsPiece()) + ColorIndex = ((lcPiece*)Focus)->mColorIndex; + quint32 ColorCode = lcGetColorCode(ColorIndex); + gMainWindow->PreviewPiece(Info->mFileName, ColorCode); } } } @@ -950,12 +946,8 @@ void lcQPropertiesTree::SetPiece(const lcArray& Selection, lcObject* Hide = Piece->GetStepHide(); ColorIndex = Piece->mColorIndex; Info = Piece->mPieceInfo; - lcPreferences& Preferences = lcGetPreferences(); - if (Preferences.mPreviewEnabled && Preferences.mPreviewPosition != lcPreviewPosition::Floating) - { - quint32 ColorCode = lcGetColorCode(ColorIndex); - gMainWindow->PreviewPiece(Info->mFileName, ColorCode); - } + quint32 ColorCode = lcGetColorCode(ColorIndex); + gMainWindow->PreviewPiece(Info->mFileName, ColorCode); } else {