]> git.sesse.net Git - kdenlive/commitdiff
nicer layout for effects list
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 17 Feb 2008 10:26:32 +0000 (10:26 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 17 Feb 2008 10:26:32 +0000 (10:26 +0000)
svn path=/branches/KDE4/; revision=1853

src/effectslistview.cpp
src/effectslistview.h
src/widgets/effectlist_ui.ui

index 34b213a20bc4476557467eca3001846f1ac76448..e9d9876a1d1700fc9343d68503e7da38d1c461d0 100644 (file)
@@ -27,39 +27,47 @@ EffectsListView::EffectsListView(EffectsList *audioEffectList, EffectsList *vide
     : QWidget(parent), m_audioList(audioEffectList), m_videoList(videoEffectList), m_customList(customEffectList)
 {
   ui.setupUi(this);
-  initList();
-  connect(ui.video_button, SIGNAL(released()), this, SLOT(initList()));
-  connect(ui.audio_button, SIGNAL(released()), this, SLOT(initList()));
-  connect(ui.custom_button, SIGNAL(released()), this, SLOT(initList()));
-  connect(ui.effectlist, SIGNAL(itemSelectionChanged()), this, SLOT(slotDisplayInfo()));
+  initList(0);
+  connect(ui.type_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(initList(int)));
+  connect(ui.button_info, SIGNAL(stateChanged(int)), this, SLOT(showInfoPanel(int)));
+  connect(ui.effectlist, SIGNAL(itemSelectionChanged()), this, SLOT(slotUpdateInfo()));
 }
 
-void EffectsListView::initList()
+void EffectsListView::initList(int pos)
 {
   QStringList names;
-  if (ui.video_button->isChecked()) {
-    names = m_videoList->effectNames();
-  }
-  else if (ui.audio_button->isChecked()) {
-    names = m_audioList->effectNames();
-  }
-  if (ui.custom_button->isChecked()) {
-    names = m_customList->effectNames();
+  switch (pos)
+  {
+    case 0:
+      names = m_videoList->effectNames();
+      break;
+    case 1:
+      names = m_audioList->effectNames();
+      break;
+    default:
+      names = m_customList->effectNames();
+      break;
   }
   ui.effectlist->clear();
   ui.effectlist->addItems(names);
 }
 
-void EffectsListView::slotDisplayInfo()
+void EffectsListView::showInfoPanel(int state)
+{
+  if (state == 0) ui.infopanel->hide();
+  else ui.infopanel->show();
+}
+
+void EffectsListView::slotUpdateInfo()
 {
   QString info; 
-  if (ui.video_button->isChecked()) {
+  if (ui.type_combo->currentIndex() == 0) {
     info = m_videoList->getInfo(ui.effectlist->currentItem()->text());
   }
-  else if (ui.audio_button->isChecked()) {
+  else if (ui.type_combo->currentIndex() == 1) {
     info = m_audioList->getInfo(ui.effectlist->currentItem()->text());
   }
-  if (ui.custom_button->isChecked()) {
+  if (ui.type_combo->currentIndex() == 2) {
     info = m_customList->getInfo(ui.effectlist->currentItem()->text());
   }
   ui.infopanel->setText(info);
index 7050ac310a28d94b9ff62cdbe145150a3256df10..51ded6554247954760c73f58f970c44c2b0aa247 100644 (file)
@@ -41,8 +41,9 @@ class EffectsListView : public QWidget
     EffectsList *m_customList;
 
   private slots:
-     void initList();
-    void slotDisplayInfo();
+    void initList(int pos);
+    void slotUpdateInfo();
+    void showInfoPanel(int state);
 
   public slots:
  
index dcbadd6568f75ae5b369078a2c2727ffe44ec649..9a2ceb58a351cdf261d352241b9176facbf0e377 100644 (file)
@@ -5,38 +5,33 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>260</width>
-    <height>256</height>
+    <width>257</width>
+    <height>280</height>
    </rect>
   </property>
   <layout class="QGridLayout" name="gridLayout" >
    <property name="margin" >
     <number>0</number>
    </property>
-   <item row="0" column="0" colspan="2" >
+   <item row="0" column="0" >
     <layout class="QHBoxLayout" name="horizontalLayout" >
      <item>
-      <widget class="QRadioButton" name="video_button" >
-       <property name="text" >
-        <string>Video</string>
-       </property>
-       <property name="checked" >
-        <bool>true</bool>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QRadioButton" name="audio_button" >
-       <property name="text" >
-        <string>Audio</string>
-       </property>
-      </widget>
-     </item>
-     <item>
-      <widget class="QRadioButton" name="custom_button" >
-       <property name="text" >
-        <string>Custom</string>
-       </property>
+      <widget class="KComboBox" name="type_combo" >
+       <item>
+        <property name="text" >
+         <string>Video</string>
+        </property>
+       </item>
+       <item>
+        <property name="text" >
+         <string>Audio</string>
+        </property>
+       </item>
+       <item>
+        <property name="text" >
+         <string>Custom</string>
+        </property>
+       </item>
       </widget>
      </item>
      <item>
        </property>
        <property name="sizeHint" stdset="0" >
         <size>
-         <width>40</width>
-         <height>20</height>
+         <width>68</width>
+         <height>17</height>
         </size>
        </property>
       </spacer>
      </item>
+     <item>
+      <widget class="QCheckBox" name="button_info" >
+       <property name="text" >
+        <string>Info</string>
+       </property>
+       <property name="checked" >
+        <bool>true</bool>
+       </property>
+      </widget>
+     </item>
     </layout>
    </item>
    <item row="1" column="0" >
-    <widget class="KListWidget" name="effectlist" />
-   </item>
-   <item row="1" column="1" >
-    <widget class="QTextEdit" name="infopanel" >
-     <property name="frameShape" >
-      <enum>QFrame::StyledPanel</enum>
-     </property>
-     <property name="frameShadow" >
-      <enum>QFrame::Sunken</enum>
-     </property>
-     <property name="readOnly" >
-      <bool>true</bool>
+    <widget class="QSplitter" name="splitter" >
+     <property name="orientation" >
+      <enum>Qt::Vertical</enum>
      </property>
+     <widget class="KListWidget" name="effectlist" />
+     <widget class="QTextEdit" name="infopanel" >
+      <property name="frameShape" >
+       <enum>QFrame::StyledPanel</enum>
+      </property>
+      <property name="frameShadow" >
+       <enum>QFrame::Sunken</enum>
+      </property>
+      <property name="readOnly" >
+       <bool>true</bool>
+      </property>
+     </widget>
     </widget>
    </item>
   </layout>
  </widget>
  <customwidgets>
+  <customwidget>
+   <class>KComboBox</class>
+   <extends>QComboBox</extends>
+   <header>kcombobox.h</header>
+  </customwidget>
   <customwidget>
    <class>KListWidget</class>
    <extends>QListWidget</extends>