Commit c919727f authored by Stefan Majewsky's avatar Stefan Majewsky

Tweak appearance of ConfigDialog.

svn path=/trunk/KDE/kdegames/palapeli/; revision=1118569
parent b0a47292
...@@ -58,6 +58,7 @@ void Palapeli::TriggerComboBox::handleCurrentIndexChanged(int index) ...@@ -58,6 +58,7 @@ void Palapeli::TriggerComboBox::handleCurrentIndexChanged(int index)
Palapeli::ConfigDialog::ConfigDialog(QWidget* parent) Palapeli::ConfigDialog::ConfigDialog(QWidget* parent)
: KConfigDialog(parent, QString(), Settings::self()) : KConfigDialog(parent, QString(), Settings::self())
, m_triggerPage(new Palapeli::TriggerConfigWidget) , m_triggerPage(new Palapeli::TriggerConfigWidget)
, m_shownForFirstTime(false)
{ {
//setup page "General settings" //setup page "General settings"
QWidget* generalPage = new QWidget; QWidget* generalPage = new QWidget;
...@@ -96,6 +97,17 @@ void Palapeli::ConfigDialog::updateWidgetsDefault() ...@@ -96,6 +97,17 @@ void Palapeli::ConfigDialog::updateWidgetsDefault()
m_triggerPage->updateWidgetsDefault(); m_triggerPage->updateWidgetsDefault();
} }
void Palapeli::ConfigDialog::showEvent(QShowEvent* event)
{
KConfigDialog::showEvent(event);
//the dialog is usually created a bit small
if (!m_shownForFirstTime)
{
resize(minimumSize().expandedTo(geometry().size()) + QSize(50, 100));
m_shownForFirstTime = true;
}
}
//END Palapeli::ConfigDialog //END Palapeli::ConfigDialog
#include "configdialog.moc" #include "configdialog.moc"
......
...@@ -38,9 +38,11 @@ namespace Palapeli ...@@ -38,9 +38,11 @@ namespace Palapeli
virtual void updateSettings(); virtual void updateSettings();
virtual void updateWidgets(); virtual void updateWidgets();
virtual void updateWidgetsDefault(); virtual void updateWidgetsDefault();
virtual void showEvent(QShowEvent* event);
private: private:
Ui::Settings m_generalUi; Ui::Settings m_generalUi;
Palapeli::TriggerConfigWidget* m_triggerPage; Palapeli::TriggerConfigWidget* m_triggerPage;
bool m_shownForFirstTime;
}; };
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>490</width> <width>452</width>
<height>327</height> <height>327</height>
</rect> </rect>
</property> </property>
...@@ -34,14 +34,37 @@ ...@@ -34,14 +34,37 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="0"> <item row="0" column="2">
<widget class="KColorButton" name="kcfg_ViewBackgroundColor">
<property name="defaultColor">
<color>
<red>255</red>
<green>255</green>
<blue>255</blue>
</color>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Piece behavior</string>
</property>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_1"> <widget class="QLabel" name="label_1">
<property name="text"> <property name="text">
<string comment="@label:slider">Snapping precision:</string> <string comment="@label:slider">Snapping precision:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="1" colspan="2"> <item row="0" column="1">
<widget class="QSlider" name="kcfg_SnappingPrecision"> <widget class="QSlider" name="kcfg_SnappingPrecision">
<property name="minimum"> <property name="minimum">
<number>10</number> <number>10</number>
...@@ -66,16 +89,51 @@ ...@@ -66,16 +89,51 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2"> <item row="2" column="1">
<widget class="KColorButton" name="kcfg_ViewBackgroundColor"> <layout class="QHBoxLayout" name="horizontalLayout">
<property name="defaultColor"> <item>
<color> <widget class="QLabel" name="label">
<red>255</red> <property name="sizePolicy">
<green>255</green> <sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<blue>255</blue> <horstretch>0</horstretch>
</color> <verstretch>0</verstretch>
</property> </sizepolicy>
</widget> </property>
<property name="text">
<string extracomment="description for the &quot;snapping precision&quot; setting">Very precise (harder)</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::MinimumExpanding</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string extracomment="description for the &quot;snapping precision&quot; setting">Unprecise (easier)</string>
</property>
</widget>
</item>
</layout>
</item> </item>
</layout> </layout>
</widget> </widget>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment