summaryrefslogtreecommitdiffstats
path: root/src/Authoring/Studio/UI
diff options
context:
space:
mode:
authorMiikka Heikkinen <miikka.heikkinen@qt.io>2018-08-29 16:37:29 +0300
committerMiikka Heikkinen <miikka.heikkinen@qt.io>2018-08-30 07:50:10 +0000
commitc5fe4fbb585e626add3b73368ecadabd4aff13f7 (patch)
treed4c06bd5a0be4f9080fbd5ed69d210ab04d5f4e8 /src/Authoring/Studio/UI
parent6e93581ba9af0b9f4e236abe4a42d7193d135c1f (diff)
Fix miscellaneous settings issues
- Clearer values for timeline snap options - Clearer tooltip for legacy viewer - Removed edit view background color setting, it is no longer needed with the gradient background Task-number: QT3DS-2148 Change-Id: I7c4cebf49c339e7809023f0500116deff45e2f70 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io> Reviewed-by: Antti Määttä <antti.maatta@qt.io> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/UI')
-rw-r--r--src/Authoring/Studio/UI/StudioAppPrefsPage.cpp49
-rw-r--r--src/Authoring/Studio/UI/StudioAppPrefsPage.h8
-rw-r--r--src/Authoring/Studio/UI/StudioAppPrefsPage.ui23
3 files changed, 7 insertions, 73 deletions
diff --git a/src/Authoring/Studio/UI/StudioAppPrefsPage.cpp b/src/Authoring/Studio/UI/StudioAppPrefsPage.cpp
index 03d02120..00c1349c 100644
--- a/src/Authoring/Studio/UI/StudioAppPrefsPage.cpp
+++ b/src/Authoring/Studio/UI/StudioAppPrefsPage.cpp
@@ -90,10 +90,9 @@ void CStudioAppPrefsPage::onInitDialog()
// Add tool tips for controls
m_ui->m_DefaultInterpolation->setToolTip(tr("Set default keyframe interpolation type"));
m_ui->m_checkTimelineAbsoluteSnapping->setToolTip(tr("Enable timeline snapping grid"));
- m_ui->m_checkLegacyViewer->setToolTip(tr("Enable legacy viewer preview"));
+ m_ui->m_checkLegacyViewer->setToolTip(tr("Enable preview with legacy Qt 3D Viewer 1.1"));
m_ui->m_SnapRangeCombo->setToolTip(tr("Set resolution of timeline snapping grid"));
m_ui->m_buttonRestoreDefaults->setToolTip(tr("Click to restore default Studio settings"));
- m_ui->m_EditViewBGColor->setAutoFillBackground(true);
// Set fonts for child windows.
for (auto w : findChildren<QWidget *>())
@@ -122,8 +121,6 @@ void CStudioAppPrefsPage::onInitDialog()
this, [=](){ setModified(true); enableOptions(); });
connect(m_ui->m_checkLegacyViewer, &QCheckBox::clicked,
this, [=](){ setModified(true); m_restartNeeded = true; });
- connect(m_ui->m_EditViewBGColor, &QPushButton::clicked,
- this, &CStudioAppPrefsPage::onBgColorButtonClicked);
connect(m_ui->m_EditViewStartupView, activated, this, [=](){ setModified(true); });
connect(m_ui->selectorWidth,
static_cast<void (QDoubleSpinBox::*)(double)>(&QDoubleSpinBox::valueChanged),
@@ -175,9 +172,9 @@ void CStudioAppPrefsPage::loadSettings()
m_ui->selectorLength->setValue(CStudioPreferences::getSelectorLineLength());
// The scale mode
- m_ui->m_SnapRangeCombo->addItem(tr("Low Resolution"));
- m_ui->m_SnapRangeCombo->addItem(tr("Medium Resolution"));
- m_ui->m_SnapRangeCombo->addItem(tr("High Resolution"));
+ m_ui->m_SnapRangeCombo->addItem(tr("1 Second"));
+ m_ui->m_SnapRangeCombo->addItem(tr("0.5 Seconds"));
+ m_ui->m_SnapRangeCombo->addItem(tr("0.1 Seconds"));
long theResolution = (long)CStudioPreferences::GetTimelineSnappingGridResolution();
m_ui->m_SnapRangeCombo->setCurrentIndex(theResolution);
@@ -192,19 +189,8 @@ void CStudioAppPrefsPage::loadSettings()
#if 0 // Removed until we have some other Preview configurations than just Viewer
loadPreviewSelections();
#endif
-
- m_bgColor = CStudioPreferences::GetEditViewBackgroundColor();
- updateColorButton();
-}
-
-void CStudioAppPrefsPage::updateColorButton()
-{
- QString bgColorStyle = QStringLiteral("background-color: ") + m_bgColor.name();
- m_ui->m_EditViewBGColor->setStyleSheet(bgColorStyle);
- setModified(true);
}
-//==============================================================================
/**
* SaveSettings: Save the settings from the controls to the CDoc
*
@@ -226,9 +212,6 @@ void CStudioAppPrefsPage::saveSettings()
// Legacy viewer
CStudioPreferences::SetLegacyViewerActive(m_ui->m_checkLegacyViewer->isChecked());
- // Edit View Background Color
- CStudioPreferences::SetEditViewBackgroundColor(m_bgColor);
-
// Preferred Startup View
long theSel = m_ui->m_EditViewStartupView->currentIndex();
long theNumItems = m_ui->m_EditViewStartupView->count();
@@ -396,30 +379,6 @@ void CStudioAppPrefsPage::onChangePreviewConfiguration()
}
#endif
-void CStudioAppPrefsPage::onBgColorButtonClicked()
-{
- QColor previousColor = m_bgColor;
- QColorDialog *theColorDlg = new QColorDialog(previousColor, this);
- theColorDlg->setOption(QColorDialog::DontUseNativeDialog, true);
- connect(theColorDlg, &QColorDialog::currentColorChanged,
- this, &CStudioAppPrefsPage::onBackgroundColorChanged);
- if (theColorDlg->exec() == QDialog::Accepted)
- m_bgColor = theColorDlg->selectedColor();
- else
- m_bgColor = previousColor;
- updateColorButton();
- CStudioPreferences::SetEditViewBackgroundColor(m_bgColor);
- g_StudioApp.getRenderer().RequestRender();
-}
-
-void CStudioAppPrefsPage::onBackgroundColorChanged(const QColor &color)
-{
- m_bgColor = color;
- updateColorButton();
- CStudioPreferences::SetEditViewBackgroundColor(m_bgColor);
- g_StudioApp.getRenderer().RequestRender();
-}
-
void CStudioAppPrefsPage::enableAutosave(bool enabled)
{
if (m_autosaveChanged)
diff --git a/src/Authoring/Studio/UI/StudioAppPrefsPage.h b/src/Authoring/Studio/UI/StudioAppPrefsPage.h
index dd749f4c..df9a6863 100644
--- a/src/Authoring/Studio/UI/StudioAppPrefsPage.h
+++ b/src/Authoring/Studio/UI/StudioAppPrefsPage.h
@@ -56,12 +56,8 @@ public:
explicit CStudioAppPrefsPage(QWidget *parent = nullptr);
~CStudioAppPrefsPage();
- // Dialog Data
- QColor m_bgColor;
-
public:
bool onApply() override;
- void onBackgroundColorChanged(const QColor &color);
protected:
bool m_timebarShowTime; // TRUE if timebars are to display their time value
@@ -80,7 +76,6 @@ protected:
#if 0 // Removed until we have some other Preview configurations that just Viewer
void onChangePreviewConfiguration();
#endif
- void onBgColorButtonClicked();
void enableAutosave(bool enabled);
void setAutosaveInterval(int interval);
@@ -99,9 +94,6 @@ protected:
void removePreviewPropertyControls();
#endif
QScopedPointer<QT_PREPEND_NAMESPACE(Ui::StudioAppPrefsPage)> m_ui;
-
-private:
- void updateColorButton();
};
#endif
diff --git a/src/Authoring/Studio/UI/StudioAppPrefsPage.ui b/src/Authoring/Studio/UI/StudioAppPrefsPage.ui
index 30ca4487..1af60cd3 100644
--- a/src/Authoring/Studio/UI/StudioAppPrefsPage.ui
+++ b/src/Authoring/Studio/UI/StudioAppPrefsPage.ui
@@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>347</width>
- <height>400</height>
+ <height>511</height>
</rect>
</property>
<property name="windowTitle">
@@ -59,24 +59,10 @@
<string>Editing View</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
- <item row="0" column="0" colspan="2">
- <widget class="QLabel" name="label_3">
- <property name="text">
- <string>Background Color</string>
- </property>
- <property name="buddy">
- <cstring>m_EditViewBGColor</cstring>
- </property>
- </widget>
- </item>
<item row="0" column="2" colspan="2">
- <widget class="QPushButton" name="m_EditViewBGColor">
- <property name="text">
- <string/>
- </property>
- </widget>
+ <widget class="QComboBox" name="m_EditViewStartupView"/>
</item>
- <item row="1" column="0" colspan="2">
+ <item row="0" column="0" colspan="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Preferred Startup View</string>
@@ -86,9 +72,6 @@
</property>
</widget>
</item>
- <item row="1" column="2" colspan="2">
- <widget class="QComboBox" name="m_EditViewStartupView"/>
- </item>
</layout>
</widget>
</item>