diff options
author | Ben Boeckel <MathStuf@gmail.com> | 2009-03-19 19:45:00 -0400 |
---|---|---|
committer | Ben Boeckel <MathStuf@gmail.com> | 2009-03-19 19:45:00 -0400 |
commit | 657acf19d896267f96bf1b659c85117e7118da64 (patch) | |
tree | 2fa08c0c9155ac3eeb090f2ca0b029f9e506ed90 /sigmodr | |
parent | 7f1b56b96c812d8b4ff6121afc933c30edae7f47 (diff) | |
download | sigen-657acf19d896267f96bf1b659c85117e7118da64.tar.gz sigen-657acf19d896267f96bf1b659c85117e7118da64.tar.xz sigen-657acf19d896267f96bf1b659c85117e7118da64.zip |
Update the Skin widget
Diffstat (limited to 'sigmodr')
-rw-r--r-- | sigmodr/widgets/SkinUI.cpp | 19 | ||||
-rw-r--r-- | sigmodr/widgets/SkinUI_p.h | 5 | ||||
-rw-r--r-- | sigmodr/widgets/gui/skin.ui | 86 |
3 files changed, 109 insertions, 1 deletions
diff --git a/sigmodr/widgets/SkinUI.cpp b/sigmodr/widgets/SkinUI.cpp index eb99a3a0..0ed370f4 100644 --- a/sigmodr/widgets/SkinUI.cpp +++ b/sigmodr/widgets/SkinUI.cpp @@ -26,6 +26,7 @@ #include <sigmod/Skin.h> // KDE includes +#include <KIntNumInput> #include <KLineEdit> using namespace Sigcore; @@ -68,8 +69,12 @@ QWidget* SkinUI::Private::makeWidgets(ObjectUI* widget) { QWidget *form = openUiFile(":/gui/skin.ui", widget); ui_name = form->findChild<KLineEdit*>("varName"); + ui_width = form->findChild<KIntNumInput*>("varWidth"); + ui_height = form->findChild<KIntNumInput*>("varHeight"); ui_script = form->findChild<ScriptWidget*>("varScript"); connect(ui_name, SIGNAL(textChanged(QString)), this, SLOT(nameChanged(QString))); + connect(ui_width, SIGNAL(valueChanged(int)), this, SLOT(widthChanged(int))); + connect(ui_height, SIGNAL(valueChanged(int)), this, SLOT(heightChanged(int))); connect(ui_script, SIGNAL(valueChanged(Sigcore::Script)), this, SLOT(scriptChanged(Sigcore::Script))); return form; } @@ -87,6 +92,20 @@ void SkinUI::Private::nameChanged(const QString& name) ui_name->setCursorPosition(cursor); } +void SkinUI::Private::widthChanged(const int width) +{ + QSize size = m_skin->size(); + size.setWidth(width); + m_skin->setSize(size); +} + +void SkinUI::Private::heightChanged(const int height) +{ + QSize size = m_skin->size(); + size.setHeight(height); + m_skin->setSize(size); +} + void SkinUI::Private::scriptChanged(const Script& script) { m_skin->setScript(script); diff --git a/sigmodr/widgets/SkinUI_p.h b/sigmodr/widgets/SkinUI_p.h index 10a49de0..816ea8ba 100644 --- a/sigmodr/widgets/SkinUI_p.h +++ b/sigmodr/widgets/SkinUI_p.h @@ -25,6 +25,7 @@ #include "ObjectUIPrivate.h" // Forward declarations +class KIntNumInput; class KLineEdit; namespace Sigcore { @@ -55,9 +56,13 @@ class SIGMODRWIDGETS_NO_EXPORT SkinUI::Private : public ObjectUIPrivate void resetGui(); protected slots: void nameChanged(const QString& name); + void widthChanged(const int width); + void heightChanged(const int height); void scriptChanged(const Sigcore::Script& script); private: KLineEdit* ui_name; + KIntNumInput* ui_width; + KIntNumInput* ui_height; CoreWidgets::ScriptWidget* ui_script; }; } diff --git a/sigmodr/widgets/gui/skin.ui b/sigmodr/widgets/gui/skin.ui index fdad07ae..d82d1bbd 100644 --- a/sigmodr/widgets/gui/skin.ui +++ b/sigmodr/widgets/gui/skin.ui @@ -31,7 +31,84 @@ </property> </widget> </item> - <item row="1" column="0" colspan="2" > + <item row="1" column="0" rowspan="2" > + <widget class="QLabel" name="labelSize" > + <property name="text" > + <string>Size:</string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>varSize</cstring> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="QWidget" name="varSize" > + <layout class="QGridLayout" > + <item row="0" column="0" > + <widget class="QLabel" name="labelWidth" > + <property name="text" > + <string>Width:</string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>varWidth</cstring> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="KIntNumInput" name="varWidth" > + <property name="toolTip" > + <string>Width of the skin</string> + </property> + <property name="statusTip" > + <string>Width of the skin</string> + </property> + <property name="whatsThis" > + <string>Width of the skin</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + <item row="1" column="0" > + <widget class="QLabel" name="labelHeight" > + <property name="text" > + <string>Height:</string> + </property> + <property name="alignment" > + <set>Qt::AlignRight|Qt::AlignVCenter</set> + </property> + <property name="buddy" > + <cstring>varHeight</cstring> + </property> + </widget> + </item> + <item row="1" column="1" > + <widget class="KIntNumInput" name="varHeight" > + <property name="toolTip" > + <string>Height of the skin</string> + </property> + <property name="statusTip" > + <string>Height of the skin</string> + </property> + <property name="whatsThis" > + <string>Height of the skin</string> + </property> + <property name="minimum" > + <number>0</number> + </property> + </widget> + </item> + </layout> + </widget> + </item> + <item row="2" column="0" colspan="2" > <widget class="QGroupBox" name="boxScript" > <property name="title" > <string>Script</string> @@ -57,6 +134,11 @@ </widget> <customwidgets> <customwidget> + <class>KIntNumInput</class> + <extends>QWidget</extends> + <header location="global" >KIntNumInput</header> + </customwidget> + <customwidget> <class>KLineEdit</class> <extends>QLineEdit</extends> <header location="global" >KLineEdit</header> @@ -69,6 +151,8 @@ </customwidgets> <tabstops> <tabstop>varName</tabstop> + <tabstop>varWidth</tabstop> + <tabstop>varHeight</tabstop> <tabstop>varScript</tabstop> </tabstops> <resources/> |