Add scrollbars

Add scrollbars to various UI areas to be more friendly to low resolution
monitors. This works well down to vertical resolutions of 960. Below
that, things will get scrunched.
This commit is contained in:
mfeemster 2014-07-20 17:16:23 -07:00
parent e3b207c562
commit 280473c8a0
7 changed files with 2777 additions and 2549 deletions

3
.gitignore vendored
View File

@ -17,7 +17,6 @@
*.res *.res
*.ipch *.ipch
*.bsc *.bsc
Builds/MSVC/VS2010/GeneratedFiles/Release/moc_AboutDialog.cpp
*.exe *.exe
*.xml *.xml
*.ilk *.ilk
@ -27,3 +26,5 @@ Builds/MSVC/VS2010/GeneratedFiles/Release/moc_AboutDialog.cpp
*.msi *.msi
*.idb *.idb
*.flam3 *.flam3
*moc_*
*GeneratedFiles*

View File

@ -17,6 +17,7 @@ FractoriumFinalRenderDialog::FractoriumFinalRenderDialog(FractoriumSettings* set
int row = 0, spinHeight = 20; int row = 0, spinHeight = 20;
unsigned int i; unsigned int i;
double dmax = numeric_limits<double>::max();
QTableWidget* table = ui.FinalRenderGeometryTable; QTableWidget* table = ui.FinalRenderGeometryTable;
QTableWidgetItem* item = NULL; QTableWidgetItem* item = NULL;
@ -36,13 +37,13 @@ FractoriumFinalRenderDialog::FractoriumFinalRenderDialog(FractoriumSettings* set
SetupSpinner<SpinBox, int> (table, this, row, 1, m_WidthSpin, spinHeight, 10, 100000, 50, SIGNAL(valueChanged(int)), SLOT(OnWidthChanged(int)), true, 1980); SetupSpinner<SpinBox, int> (table, this, row, 1, m_WidthSpin, spinHeight, 10, 100000, 50, SIGNAL(valueChanged(int)), SLOT(OnWidthChanged(int)), true, 1980);
SetupSpinner<SpinBox, int> (table, this, row, 1, m_HeightSpin, spinHeight, 10, 100000, 50, SIGNAL(valueChanged(int)), SLOT(OnHeightChanged(int)), true, 1080); SetupSpinner<SpinBox, int> (table, this, row, 1, m_HeightSpin, spinHeight, 10, 100000, 50, SIGNAL(valueChanged(int)), SLOT(OnHeightChanged(int)), true, 1080);
SetupSpinner<SpinBox, int>(table, this, row, 1, m_QualitySpin, spinHeight, 1, 200000, 50, SIGNAL(valueChanged(int)), SLOT(OnQualityChanged(int)), true, 1000); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_QualitySpin, spinHeight, 1, dmax, 50, SIGNAL(valueChanged(double)), SLOT(OnQualityChanged(double)), true, 1000);
SetupSpinner<SpinBox, int> (table, this, row, 1, m_TemporalSamplesSpin, spinHeight, 1, 5000, 50, SIGNAL(valueChanged(int)), SLOT(OnTemporalSamplesChanged(int)), true, 1000); SetupSpinner<SpinBox, int> (table, this, row, 1, m_TemporalSamplesSpin, spinHeight, 1, 5000, 50, SIGNAL(valueChanged(int)), SLOT(OnTemporalSamplesChanged(int)), true, 1000);
SetupSpinner<SpinBox, int> (table, this, row, 1, m_SupersampleSpin, spinHeight, 1, 4, 1, SIGNAL(valueChanged(int)), SLOT(OnSupersampleChanged(int)), true, 2); SetupSpinner<SpinBox, int> (table, this, row, 1, m_SupersampleSpin, spinHeight, 1, 4, 1, SIGNAL(valueChanged(int)), SLOT(OnSupersampleChanged(int)), true, 2);
row++;//Memory usage. row++;//Memory usage.
TwoButtonWidget* tbw = new TwoButtonWidget("...", "Open", 22, 40, 24, table); TwoButtonWidget* tbw = new TwoButtonWidget("...", "Open", 22, 40, 22, table);
table->setCellWidget(row, 1, tbw); table->setCellWidget(row, 1, tbw);
table->item(row++, 1)->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter); table->item(row++, 1)->setTextAlignment(Qt::AlignRight | Qt::AlignVCenter);
connect(tbw->m_Button1, SIGNAL(clicked(bool)), this, SLOT(OnFileButtonClicked(bool)), Qt::QueuedConnection); connect(tbw->m_Button1, SIGNAL(clicked(bool)), this, SLOT(OnFileButtonClicked(bool)), Qt::QueuedConnection);
@ -134,7 +135,7 @@ unsigned int FractoriumFinalRenderDialog::DeviceIndex() { return ui.FinalRenderD
unsigned int FractoriumFinalRenderDialog::ThreadCount() { return ui.FinalRenderThreadCountSpin->value(); } unsigned int FractoriumFinalRenderDialog::ThreadCount() { return ui.FinalRenderThreadCountSpin->value(); }
unsigned int FractoriumFinalRenderDialog::Width() { return m_WidthSpin->value(); } unsigned int FractoriumFinalRenderDialog::Width() { return m_WidthSpin->value(); }
unsigned int FractoriumFinalRenderDialog::Height() { return m_HeightSpin->value(); } unsigned int FractoriumFinalRenderDialog::Height() { return m_HeightSpin->value(); }
unsigned int FractoriumFinalRenderDialog::Quality() { return m_QualitySpin->value(); } double FractoriumFinalRenderDialog::Quality() { return m_QualitySpin->value(); }
unsigned int FractoriumFinalRenderDialog::TemporalSamples() { return m_TemporalSamplesSpin->value(); } unsigned int FractoriumFinalRenderDialog::TemporalSamples() { return m_TemporalSamplesSpin->value(); }
unsigned int FractoriumFinalRenderDialog::Supersample() { return m_SupersampleSpin->value(); } unsigned int FractoriumFinalRenderDialog::Supersample() { return m_SupersampleSpin->value(); }
@ -338,7 +339,7 @@ void FractoriumFinalRenderDialog::OnHeightChanged(int d)
/// The quality spinner was changed, recompute required memory. /// The quality spinner was changed, recompute required memory.
/// </summary> /// </summary>
/// <param name="d">Ignored</param> /// <param name="d">Ignored</param>
void FractoriumFinalRenderDialog::OnQualityChanged(int d) void FractoriumFinalRenderDialog::OnQualityChanged(double d)
{ {
SetMemory(); SetMemory();
} }

View File

@ -64,7 +64,7 @@ public:
unsigned int ThreadCount(); unsigned int ThreadCount();
unsigned int Width(); unsigned int Width();
unsigned int Height(); unsigned int Height();
unsigned int Quality(); double Quality();
unsigned int TemporalSamples(); unsigned int TemporalSamples();
unsigned int Supersample(); unsigned int Supersample();
FinalRenderGuiState State(); FinalRenderGuiState State();
@ -81,7 +81,7 @@ public Q_SLOTS:
void OnScaleRadioButtonChanged(bool checked); void OnScaleRadioButtonChanged(bool checked);
void OnWidthChanged(int d); void OnWidthChanged(int d);
void OnHeightChanged(int d); void OnHeightChanged(int d);
void OnQualityChanged(int d); void OnQualityChanged(double d);
void OnTemporalSamplesChanged(int d); void OnTemporalSamplesChanged(int d);
void OnSupersampleChanged(int d); void OnSupersampleChanged(int d);
void OnFileButtonClicked(bool checked); void OnFileButtonClicked(bool checked);
@ -101,7 +101,7 @@ private:
Timing m_RenderTimer; Timing m_RenderTimer;
SpinBox* m_WidthSpin; SpinBox* m_WidthSpin;
SpinBox* m_HeightSpin; SpinBox* m_HeightSpin;
SpinBox* m_QualitySpin; DoubleSpinBox* m_QualitySpin;
SpinBox* m_TemporalSamplesSpin; SpinBox* m_TemporalSamplesSpin;
SpinBox* m_SupersampleSpin; SpinBox* m_SupersampleSpin;
QLineEdit* m_PrefixEdit; QLineEdit* m_PrefixEdit;

View File

@ -44,6 +44,42 @@
<property name="bottomMargin"> <property name="bottomMargin">
<number>6</number> <number>6</number>
</property> </property>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>507</width>
<height>789</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="spacing">
<number>5</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item> <item>
<layout class="QGridLayout" name="gridLayout" columnstretch="0,0"> <layout class="QGridLayout" name="gridLayout" columnstretch="0,0">
<item row="1" column="1"> <item row="1" column="1">
@ -306,7 +342,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="FinalRenderPlatformCombo"> <widget class="QComboBox" name="FinalRenderDeviceCombo">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -328,7 +364,7 @@
</widget> </widget>
</item> </item>
<item> <item>
<widget class="QComboBox" name="FinalRenderDeviceCombo"> <widget class="QComboBox" name="FinalRenderPlatformCombo">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch> <horstretch>0</horstretch>
@ -382,13 +418,13 @@
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>218</height> <height>200</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="maximumSize">
<size> <size>
<width>16777215</width> <width>16777215</width>
<height>218</height> <height>200</height>
</size> </size>
</property> </property>
<property name="focusPolicy"> <property name="focusPolicy">
@ -458,13 +494,13 @@
<bool>false</bool> <bool>false</bool>
</attribute> </attribute>
<attribute name="verticalHeaderDefaultSectionSize"> <attribute name="verticalHeaderDefaultSectionSize">
<number>24</number> <number>22</number>
</attribute> </attribute>
<attribute name="verticalHeaderHighlightSections"> <attribute name="verticalHeaderHighlightSections">
<bool>false</bool> <bool>false</bool>
</attribute> </attribute>
<attribute name="verticalHeaderMinimumSectionSize"> <attribute name="verticalHeaderMinimumSectionSize">
<number>24</number> <number>22</number>
</attribute> </attribute>
<attribute name="verticalHeaderStretchLastSection"> <attribute name="verticalHeaderStretchLastSection">
<bool>false</bool> <bool>false</bool>
@ -859,6 +895,10 @@
</item> </item>
</layout> </layout>
</widget> </widget>
</widget>
</item>
</layout>
</widget>
<customwidgets> <customwidgets>
<customwidget> <customwidget>
<class>TableWidget</class> <class>TableWidget</class>

View File

@ -38,7 +38,7 @@ struct FinalRenderGuiState
unsigned int m_ThreadCount; unsigned int m_ThreadCount;
unsigned int m_Width; unsigned int m_Width;
unsigned int m_Height; unsigned int m_Height;
unsigned int m_Quality; double m_Quality;
unsigned int m_TemporalSamples; unsigned int m_TemporalSamples;
unsigned int m_Supersample; unsigned int m_Supersample;
}; };

File diff suppressed because it is too large Load Diff

View File

@ -8,6 +8,7 @@ void Fractorium::InitParamsUI()
{ {
int row = 0; int row = 0;
int spinHeight = 20; int spinHeight = 20;
double dmax = numeric_limits<double>::max();
vector<string> comboVals; vector<string> comboVals;
QTableWidget* table = ui.ColorTable; QTableWidget* table = ui.ColorTable;
@ -86,7 +87,7 @@ void Fractorium::InitParamsUI()
table = ui.IterationTable; table = ui.IterationTable;
SetupSpinner<SpinBox, int> (table, this, row, 1, m_PassesSpin, spinHeight, 1, 3, 1, SIGNAL(valueChanged(int)), SLOT(OnPassesChanged(int)), true, 1, 1, 1); SetupSpinner<SpinBox, int> (table, this, row, 1, m_PassesSpin, spinHeight, 1, 3, 1, SIGNAL(valueChanged(int)), SLOT(OnPassesChanged(int)), true, 1, 1, 1);
SetupSpinner<SpinBox, int> (table, this, row, 1, m_TemporalSamplesSpin, spinHeight, 1, 5000, 50, SIGNAL(valueChanged(int)), SLOT(OnTemporalSamplesChanged(int)), true, 1000); SetupSpinner<SpinBox, int> (table, this, row, 1, m_TemporalSamplesSpin, spinHeight, 1, 5000, 50, SIGNAL(valueChanged(int)), SLOT(OnTemporalSamplesChanged(int)), true, 1000);
SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_QualitySpin, spinHeight, 1, 200000, 50, SIGNAL(valueChanged(double)), SLOT(OnQualityChanged(double)), true, 10, 10, 10); SetupSpinner<DoubleSpinBox, double>(table, this, row, 1, m_QualitySpin, spinHeight, 1, dmax, 50, SIGNAL(valueChanged(double)), SLOT(OnQualityChanged(double)), true, 10, 10, 10);
SetupSpinner<SpinBox, int> (table, this, row, 1, m_SupersampleSpin, spinHeight, 1, 4, 1, SIGNAL(valueChanged(int)), SLOT(OnSupersampleChanged(int)), true, 1, 1, 1); SetupSpinner<SpinBox, int> (table, this, row, 1, m_SupersampleSpin, spinHeight, 1, 4, 1, SIGNAL(valueChanged(int)), SLOT(OnSupersampleChanged(int)), true, 1, 1, 1);
comboVals.clear(); comboVals.clear();