X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Feffectslistview.cpp;h=fafd97553ad30bed357c067d20eb934d1bcc834b;hb=fd3954b6965b2bc81eeed9fadd40dbbf9607fa37;hp=050029b666c1f8c1d02bfca40f60ffaddd16b70c;hpb=4e71606a3c8fbb73a07bbc37be6933a01e394c20;p=kdenlive diff --git a/src/effectslistview.cpp b/src/effectslistview.cpp index 050029b6..fafd9755 100644 --- a/src/effectslistview.cpp +++ b/src/effectslistview.cpp @@ -35,20 +35,34 @@ EffectsListView::EffectsListView(QWidget *parent) : { setupUi(this); - QMenu *menu = new QMenu(this); - m_effectsList = new EffectsListWidget(menu); + QString style = "QTreeView::branch:has-siblings:!adjoins-item{border-image:none;border:0px} \ + QTreeView::branch:has-siblings:adjoins-item {border-image: none;border:0px} \ + QTreeView::branch:!has-children:!has-siblings:adjoins-item {border-image: none;border:0px} \ + QTreeView::branch:has-children:!has-siblings:closed,QTreeView::branch:closed:has-children:has-siblings { \ + border-image: none;image: url(:/images/stylesheet-branch-closed.png);} \ + QTreeView::branch:open:has-children:!has-siblings,QTreeView::branch:open:has-children:has-siblings { \ + border-image: none;image: url(:/images/stylesheet-branch-open.png);}"; + + QMenu *contextMenu = new QMenu(this); + m_effectsList = new EffectsListWidget(contextMenu); + m_effectsList->setStyleSheet(style); QVBoxLayout *lyr = new QVBoxLayout(effectlistframe); lyr->addWidget(m_effectsList); lyr->setContentsMargins(0, 0, 0, 0); search_effect->setTreeWidget(m_effectsList); + search_effect->setToolTip(i18n("Search in the effect list")); buttonInfo->setIcon(KIcon("help-about")); + buttonInfo->setToolTip(i18n("Show/Hide the effect description")); setFocusPolicy(Qt::StrongFocus); setFocusProxy(search_effect); + m_effectsList->setFocusProxy(search_effect); - if (KdenliveSettings::showeffectinfo()) { + if (KdenliveSettings::showeffectinfo()) buttonInfo->setDown(true); - } else infopanel->hide(); - menu->addAction(KIcon("edit-delete"), i18n("Delete effect"), this, SLOT(slotRemoveEffect())); + else + infopanel->hide(); + + contextMenu->addAction(KIcon("edit-delete"), i18n("Delete effect"), this, SLOT(slotRemoveEffect())); connect(type_combo, SIGNAL(currentIndexChanged(int)), this, SLOT(filterList(int))); connect(buttonInfo, SIGNAL(clicked()), this, SLOT(showInfoPanel())); @@ -103,7 +117,12 @@ void EffectsListView::showInfoPanel() void EffectsListView::slotEffectSelected() { QDomElement effect = m_effectsList->currentEffect(); - if (!effect.isNull()) emit addEffect(effect); + QTreeWidgetItem* item=m_effectsList->currentItem(); + if (item && m_effectsList->indexOfTopLevelItem(item)!=-1){ + item->setExpanded(!item->isExpanded()); + } + if (!effect.isNull()) + emit addEffect(effect); } void EffectsListView::slotUpdateInfo() @@ -111,9 +130,9 @@ void EffectsListView::slotUpdateInfo() infopanel->setText(m_effectsList->currentInfo()); } -void EffectsListView::reloadEffectList() +void EffectsListView::reloadEffectList(QMenu *effectsMenu, KActionCategory *effectActions) { - m_effectsList->initList(); + m_effectsList->initList(effectsMenu, effectActions); } void EffectsListView::slotRemoveEffect() @@ -162,6 +181,8 @@ void EffectsListView::slotUpdateSearch(QTreeWidgetItem *item, bool hidden) void EffectsListView::slotAutoExpand(QString text) { + search_effect->updateSearch(); + for (int i = 0; i < m_effectsList->topLevelItemCount(); ++i) { QTreeWidgetItem *folder = m_effectsList->topLevelItem(i); bool expandFolder = false;