]> git.sesse.net Git - kdenlive/commitdiff
Parameter GUI improvements:
authorTill Theato <root@ttill.de>
Sun, 7 Nov 2010 18:55:27 +0000 (18:55 +0000)
committerTill Theato <root@ttill.de>
Sun, 7 Nov 2010 18:55:27 +0000 (18:55 +0000)
- List: name and drop-down in one row
- Position: new order + one row: name, slider, timecode editor
- Bool: new order: name, checkbox

svn path=/trunk/kdenlive/; revision=5081

src/effectstackedit.cpp
src/positionedit.cpp
src/positionedit.h
src/widgets/boolval_ui.ui
src/widgets/listval_ui.ui

index 6c96d251f60e535dfca98574c132633405cd2a77..b8d69b8b02f035d59db9926db55bb6b7f6bf030b 100644 (file)
@@ -225,8 +225,8 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
             lsval->setupUi(toFillin);
             QStringList listitems = pa.attribute("paramlist").split(',');
             QStringList listitemsdisplay = pa.attribute("paramlistdisplay").split(',');
-            if (listitemsdisplay.count() != listitems.count()) listitemsdisplay = listitems;
-            //lsval->list->addItems(listitems);
+            if (listitemsdisplay.count() != listitems.count())
+                listitemsdisplay = listitems;
             lsval->list->setIconSize(QSize(30, 30));
             for (int i = 0; i < listitems.count(); i++) {
                 lsval->list->addItem(listitemsdisplay.at(i), listitems.at(i));
@@ -240,7 +240,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
                 }
             }
             if (!value.isEmpty()) lsval->list->setCurrentIndex(listitems.indexOf(value));
-            lsval->title->setTitle(paramName);
+            lsval->name->setText(paramName);
             m_valueItems[paramName] = lsval;
             connect(lsval->list, SIGNAL(currentIndexChanged(int)) , this, SLOT(collectAllParameters()));
             m_uiItems.append(lsval);
@@ -248,7 +248,7 @@ void EffectStackEdit::transferParamDesc(const QDomElement d, int pos, int in, in
             Boolval *bval = new Boolval;
             bval->setupUi(toFillin);
             bval->checkBox->setCheckState(value == "0" ? Qt::Unchecked : Qt::Checked);
-            bval->checkBox->setText(paramName);
+            bval->name->setText(paramName);
             m_valueItems[paramName] = bval;
             connect(bval->checkBox, SIGNAL(stateChanged(int)) , this, SLOT(collectAllParameters()));
             m_uiItems.append(bval);
index 19ccb857d7c0c091cc7136fc316398b85ecc71b1..31b3ddc71b0143b086077c8a1e7e339a1a65646b 100644 (file)
@@ -16,6 +16,7 @@
  ***************************************************************************/
 
 #include "positionedit.h"
+#include "timecodedisplay.h"
 #include "kdenlivesettings.h"
 
 #include <KDebug>
 PositionEdit::PositionEdit(const QString name, int pos, int min, int max, const Timecode tc, QWidget* parent) :
         QWidget(parent)
 {
-    QVBoxLayout *l = new QVBoxLayout;
-    QLabel *lab = new QLabel(name);
-    l->addWidget(lab);
+    QHBoxLayout *layout = new QHBoxLayout(this);
+
+    QLabel *label = new QLabel(name, this);
 
-    QHBoxLayout *l2 = new QHBoxLayout;
-    m_display = new TimecodeDisplay(tc);
     m_slider = new QSlider(Qt::Horizontal);
     m_slider->setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Preferred));
+    m_slider->setRange(min, max);
+
+    m_display = new TimecodeDisplay(tc, this);
     m_display->setSizePolicy(QSizePolicy(QSizePolicy::Maximum, QSizePolicy::Preferred));
-    l2->addWidget(m_display);
-    l2->addWidget(m_slider);
     m_display->setRange(min, max);
-    m_slider->setRange(min, max);
+
+    layout->addWidget(label);
+    layout->addWidget(m_slider);
+    layout->addWidget(m_display);
+
     connect(m_slider, SIGNAL(valueChanged(int)), m_display, SLOT(setValue(int)));
     connect(m_slider, SIGNAL(valueChanged(int)), this, SIGNAL(parameterChanged()));
     connect(m_display, SIGNAL(editingFinished()), this, SLOT(slotUpdatePosition()));
     m_slider->setValue(pos);
-    l->addLayout(l2);
-    setLayout(l);
 }
 
 PositionEdit::~PositionEdit()
@@ -70,7 +72,6 @@ void PositionEdit::setPosition(int pos)
     m_slider->setValue(pos);
 }
 
-
 void PositionEdit::slotUpdatePosition()
 {
     m_slider->blockSignals(true);
@@ -79,3 +80,4 @@ void PositionEdit::slotUpdatePosition()
     emit parameterChanged();
 }
 
+#include "positionedit.moc"
index 5c2d77e69fa7818b2b3cb6c564d656953d522eff..ba3163630450a60f1c8c7a2232dc40c8f1ed015b 100644 (file)
 #define POSITONEDIT_H
 
 
+#include "timecode.h"
+
 #include <QWidget>
 
-#include "timecode.h"
-#include "timecodedisplay.h"
+class QSlider;
+class TimecodeDisplay;
 
 class PositionEdit : public QWidget
 {
index 3919d61848145daa6cb7d1a124d192f7d059dd47..f2660805ed772d0c303640f244d083b55401be64 100644 (file)
@@ -1,7 +1,8 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>Boolval_UI</class>
- <widget class="QWidget" name="Boolval_UI" >
-  <property name="geometry" >
+ <widget class="QWidget" name="Boolval_UI">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
     <height>30</height>
    </rect>
   </property>
-  <layout class="QGridLayout" name="gridLayout" >
-   <property name="verticalSpacing" >
+  <layout class="QGridLayout" name="gridLayout">
+   <property name="verticalSpacing">
     <number>0</number>
    </property>
-   <property name="margin" >
+   <property name="margin">
     <number>0</number>
    </property>
-   <item row="0" column="0" >
-    <widget class="QCheckBox" name="checkBox" >
-     <property name="text" >
-      <string>CheckBox</string>
+   <item row="0" column="1">
+    <widget class="QCheckBox" name="checkBox">
+     <property name="text">
+      <string/>
+     </property>
+    </widget>
+   </item>
+   <item row="0" column="0">
+    <widget class="QLabel" name="name">
+     <property name="text">
+      <string>TextLabel</string>
      </property>
     </widget>
    </item>
index 4d26441ec19f73217e82265353e6a7cb41dd761c..b978dd1bc98c11de45775aa27b70494b6d924910 100644 (file)
@@ -1,44 +1,32 @@
-<ui version="4.0" >
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
  <class>Listval_UI</class>
- <widget class="QWidget" name="Listval_UI" >
-  <property name="geometry" >
+ <widget class="QWidget" name="Listval_UI">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>270</width>
-    <height>59</height>
+    <width>215</width>
+    <height>32</height>
    </rect>
   </property>
-  <layout class="QGridLayout" >
-   <property name="margin" >
+  <layout class="QGridLayout">
+   <property name="margin">
     <number>0</number>
    </property>
-   <property name="spacing" >
+   <property name="spacing">
     <number>0</number>
    </property>
-   <item row="0" column="0" >
-    <widget class="QGroupBox" name="title" >
-     <property name="font" >
-      <font>
-       <pointsize>8</pointsize>
-      </font>
+   <item row="0" column="0">
+    <widget class="QLabel" name="name">
+     <property name="text">
+      <string>TextLabel</string>
      </property>
-     <property name="title" >
-      <string>GroupBox</string>
-     </property>
-     <layout class="QGridLayout" >
-      <property name="margin" >
-       <number>0</number>
-      </property>
-      <property name="spacing" >
-       <number>0</number>
-      </property>
-      <item row="0" column="0" >
-       <widget class="KComboBox" name="list" />
-      </item>
-     </layout>
     </widget>
    </item>
+   <item row="0" column="1">
+    <widget class="KComboBox" name="list"/>
+   </item>
   </layout>
  </widget>
  <customwidgets>