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)
Palapeli::ConfigDialog::ConfigDialog(QWidget* parent)
: KConfigDialog(parent, QString(), Settings::self())
, m_triggerPage(new Palapeli::TriggerConfigWidget)
, m_shownForFirstTime(false)
{
//setup page "General settings"
QWidget* generalPage = new QWidget;
......@@ -96,6 +97,17 @@ void Palapeli::ConfigDialog::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
#include "configdialog.moc"
......
......@@ -38,9 +38,11 @@ namespace Palapeli
virtual void updateSettings();
virtual void updateWidgets();
virtual void updateWidgetsDefault();
virtual void showEvent(QShowEvent* event);
private:
Ui::Settings m_generalUi;
Palapeli::TriggerConfigWidget* m_triggerPage;
bool m_shownForFirstTime;
};
}
......
......@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>490</width>
<width>452</width>
<height>327</height>
</rect>
</property>
......@@ -34,14 +34,37 @@
</property>
</widget>
</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">
<property name="text">
<string comment="@label:slider">Snapping precision:</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<item row="0" column="1">
<widget class="QSlider" name="kcfg_SnappingPrecision">
<property name="minimum">
<number>10</number>
......@@ -66,16 +89,51 @@
</property>
</widget>
</item>
<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 row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<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">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>
</layout>
</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