Added a window size change easter egg.

This commit is contained in:
cc9cii 2014-09-22 21:12:26 +10:00
parent 48f96df29d
commit c4f11785ec
3 changed files with 167 additions and 132 deletions

View file

@ -154,9 +154,30 @@ CSVSettings::Dialog::Dialog(QTabWidget *parent)
// to update the checkbox on the view menu // to update the checkbox on the view menu
connect(cbStatusBar, SIGNAL(toggled(bool)), this, SIGNAL (toggleStatusBar(bool))); connect(cbStatusBar, SIGNAL(toggled(bool)), this, SIGNAL (toggleStatusBar(bool)));
displayGroup_Window->installEventFilter(this);
setupDialog(); setupDialog();
} }
bool CSVSettings::Dialog::eventFilter(QObject *target, QEvent *event)
{
if (event->type() == QEvent::MouseButtonDblClick)
{
if(stackedWidget->currentWidget() == page_1)
{
stackedWidget->setCurrentWidget(page_2);
return false;
}
else if(stackedWidget->currentWidget() == page_2)
{
stackedWidget->setCurrentWidget(page_1);
return false;
}
}
return QTabWidget::eventFilter(target, event);
}
void CSVSettings::Dialog::slotRendererChanged(const QString &renderer) void CSVSettings::Dialog::slotRendererChanged(const QString &renderer)
{ {
cmbAntiAlias->clear(); cmbAntiAlias->clear();
@ -254,7 +275,6 @@ void CSVSettings::Dialog::buildPages()
{ {
// show the values in ini file // show the values in ini file
cmbStdWinSize->setCurrentIndex(index); cmbStdWinSize->setCurrentIndex(index);
//slotStandardToggled(true);
} }
else else
{ {
@ -263,9 +283,6 @@ void CSVSettings::Dialog::buildPages()
Qt::DisplayRole, Qt::MatchStartsWith); Qt::DisplayRole, Qt::MatchStartsWith);
if(index != -1) if(index != -1)
cmbStdWinSize->setCurrentIndex(index); cmbStdWinSize->setCurrentIndex(index);
//rbCustWinSize->setChecked(true);
//slotStandardToggled(false);
} }
// status bar // status bar
@ -331,7 +348,7 @@ void CSVSettings::Dialog::closeEvent (QCloseEvent *event)
QStringList(cmbShaderLang->currentText().toLower())); QStringList(cmbShaderLang->currentText().toLower()));
// window size // window size
if(0) //rbStdWinSize->isChecked()) if(page_2->isEnabled())
{ {
QRegExp re("^(\\d+) x (\\d+)"); QRegExp re("^(\\d+) x (\\d+)");
if(re.indexIn(cmbStdWinSize->currentText()) > -1) if(re.indexIn(cmbStdWinSize->currentText()) > -1)
@ -339,9 +356,9 @@ void CSVSettings::Dialog::closeEvent (QCloseEvent *event)
model()->setDefinitions("Window Size/Width", QStringList(re.cap(1))); model()->setDefinitions("Window Size/Width", QStringList(re.cap(1)));
model()->setDefinitions("Window Size/Height", QStringList(re.cap(2))); model()->setDefinitions("Window Size/Height", QStringList(re.cap(2)));
} }
//} }
//else else
//{ {
model()->setDefinitions("Window Size/Width", model()->setDefinitions("Window Size/Width",
QStringList(QString::number(sbWidth->value()))); QStringList(QString::number(sbWidth->value())));
model()->setDefinitions("Window Size/Height", model()->setDefinitions("Window Size/Height",

View file

@ -33,6 +33,8 @@ namespace CSVSettings {
void setupDialog(); void setupDialog();
bool eventFilter(QObject *target, QEvent *event);
private: private:
void buildPages(); void buildPages();

View file

@ -14,121 +14,8 @@
<string>User Settings</string> <string>User Settings</string>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>1</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="VideoSettings">
<attribute name="title">
<string>Video Settings</string>
</attribute>
<widget class="QWidget" name="layoutWidget_Render">
<property name="geometry">
<rect>
<x>20</x>
<y>26</y>
<width>351</width>
<height>129</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="cbOverride">
<property name="text">
<string>Use Render System Settings from OpenMW</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labRenderSys">
<property name="text">
<string>Rendering Subsystem</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="cmbRenderSys">
<property name="editable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="labAntiAlias">
<property name="text">
<string>Antialiasing</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="cbVsync">
<property name="text">
<string>Vertical Sync</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="labShaderLang">
<property name="text">
<string>Shader Language</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="cmbShaderLang"/>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="cmbAntiAlias"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="Line" name="line">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>2</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(215, 215, 215);</string>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="displayGroup_Render">
<property name="geometry">
<rect>
<x>10</x>
<y>8</y>
<width>371</width>
<height>156</height>
</rect>
</property>
<property name="title">
<string>Render System</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>9</x>
<y>169</y>
<width>371</width>
<height>101</height>
</rect>
</property>
<property name="title">
<string>title</string>
</property>
</widget>
<zorder>displayGroup_Render</zorder>
<zorder>layoutWidget_Render</zorder>
<zorder>groupBox</zorder>
</widget>
<widget class="QWidget" name="DisplaySetttings"> <widget class="QWidget" name="DisplaySetttings">
<attribute name="title"> <attribute name="title">
<string>Display Settings</string> <string>Display Settings</string>
@ -284,7 +171,7 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>100</y> <y>100</y>
<width>191</width> <width>201</width>
<height>51</height> <height>51</height>
</rect> </rect>
</property> </property>
@ -299,14 +186,14 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>20</y> <y>20</y>
<width>171</width> <width>181</width>
<height>21</height> <height>22</height>
</rect> </rect>
</property> </property>
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QWidget" name="page"> <widget class="QWidget" name="page_1">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -315,7 +202,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>171</width> <width>181</width>
<height>22</height> <height>22</height>
</rect> </rect>
</property> </property>
@ -344,15 +231,15 @@
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="page_2"> <widget class="QWidget" name="page_2">
<property name="enabled">
<bool>true</bool>
</property>
<widget class="QComboBox" name="cmbStdWinSize"> <widget class="QComboBox" name="cmbStdWinSize">
<property name="enabled">
<bool>false</bool>
</property>
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>171</width> <width>181</width>
<height>22</height> <height>22</height>
</rect> </rect>
</property> </property>
@ -373,13 +260,142 @@
<string>Show Status Bar</string> <string>Show Status Bar</string>
</property> </property>
</widget> </widget>
<zorder>layoutWidget_Subviews</zorder>
<zorder>displayGroup_Window</zorder> <zorder>displayGroup_Window</zorder>
<zorder>displayGroup_DisplayFormat</zorder> <zorder>displayGroup_DisplayFormat</zorder>
<zorder>displayGroup_Subviews</zorder> <zorder>displayGroup_Subviews</zorder>
<zorder>displayGroup_WindowSize</zorder>
<zorder>cbStatusBar</zorder> <zorder>cbStatusBar</zorder>
</widget> </widget>
<widget class="QWidget" name="VideoSettings">
<attribute name="title">
<string>Video Settings</string>
</attribute>
<widget class="QWidget" name="layoutWidget_Render">
<property name="geometry">
<rect>
<x>20</x>
<y>26</y>
<width>351</width>
<height>129</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="cbOverride">
<property name="text">
<string>Use Render System Settings from OpenMW</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="labRenderSys">
<property name="text">
<string>Rendering Subsystem</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="cmbRenderSys">
<property name="editable">
<bool>false</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="labAntiAlias">
<property name="text">
<string>Antialiasing</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QCheckBox" name="cbVsync">
<property name="text">
<string>Vertical Sync</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="labShaderLang">
<property name="text">
<string>Shader Language</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QComboBox" name="cmbShaderLang"/>
</item>
<item row="4" column="1">
<widget class="QComboBox" name="cmbAntiAlias"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="Line" name="line">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>2</height>
</size>
</property>
<property name="styleSheet">
<string notr="true">color: rgb(215, 215, 215);</string>
</property>
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QGroupBox" name="displayGroup_Render">
<property name="geometry">
<rect>
<x>10</x>
<y>8</y>
<width>371</width>
<height>156</height>
</rect>
</property>
<property name="title">
<string>Render System</string>
</property>
</widget>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>9</x>
<y>169</y>
<width>371</width>
<height>101</height>
</rect>
</property>
<property name="title">
<string>title</string>
</property>
</widget>
<zorder>displayGroup_Render</zorder>
<zorder>layoutWidget_Render</zorder>
<zorder>groupBox</zorder>
</widget>
</widget> </widget>
<tabstops>
<tabstop>cmbRecStatus</tabstop>
<tabstop>cmbRefIdType</tabstop>
<tabstop>sbWidth</tabstop>
<tabstop>sbHeight</tabstop>
<tabstop>cbStatusBar</tabstop>
<tabstop>spinBox_max_subviews</tabstop>
<tabstop>spinBox_min_subview_width</tabstop>
<tabstop>checkBox_reuse_subview</tabstop>
<tabstop>cbOverride</tabstop>
<tabstop>cmbRenderSys</tabstop>
<tabstop>cbVsync</tabstop>
<tabstop>cmbAntiAlias</tabstop>
<tabstop>cmbShaderLang</tabstop>
<tabstop>cmbStdWinSize</tabstop>
</tabstops>
<resources/> <resources/>
<connections/> <connections/>
</ui> </ui>