From: Jean-Baptiste Mardelle Date: Sun, 17 Feb 2008 10:26:32 +0000 (+0000) Subject: nicer layout for effects list X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=64249171ceee40978d91114997ef7c2e7a3779cc;p=kdenlive nicer layout for effects list svn path=/branches/KDE4/; revision=1853 --- diff --git a/src/effectslistview.cpp b/src/effectslistview.cpp index 34b213a2..e9d9876a 100644 --- a/src/effectslistview.cpp +++ b/src/effectslistview.cpp @@ -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); diff --git a/src/effectslistview.h b/src/effectslistview.h index 7050ac31..51ded655 100644 --- a/src/effectslistview.h +++ b/src/effectslistview.h @@ -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: diff --git a/src/widgets/effectlist_ui.ui b/src/widgets/effectlist_ui.ui index dcbadd65..9a2ceb58 100644 --- a/src/widgets/effectlist_ui.ui +++ b/src/widgets/effectlist_ui.ui @@ -5,38 +5,33 @@ 0 0 - 260 - 256 + 257 + 280 0 - + - - - Video - - - true - - - - - - - Audio - - - - - - - Custom - + + + + Video + + + + + Audio + + + + + Custom + + @@ -46,33 +41,51 @@ - 40 - 20 + 68 + 17 + + + + Info + + + true + + + - - - - - - QFrame::StyledPanel - - - QFrame::Sunken - - - true + + + Qt::Vertical + + + + QFrame::StyledPanel + + + QFrame::Sunken + + + true + + + + KComboBox + QComboBox +
kcombobox.h
+
KListWidget QListWidget