Commit 0681cd9b authored by Nicolas Carion's avatar Nicolas Carion

start redesigning effectlist

parent 8c57969d
......@@ -24,6 +24,7 @@
#include "../model/effectfilter.hpp"
#include "effects/effectsrepository.hpp"
#include <KDeclarative/KDeclarative>
#include <QStandardPaths>
#include <QQmlContext>
......@@ -37,9 +38,13 @@ EffectListWidget::EffectListWidget(QWidget *parent)
m_proxyModel = new EffectFilter(this);
m_proxyModel->setSourceModel(m_model.get());
KDeclarative::KDeclarative kdeclarative;
kdeclarative.setDeclarativeEngine(engine());
kdeclarative.initialize();
kdeclarative.setupBindings();
setResizeMode(QQuickWidget::SizeRootObjectToView);
rootContext()->setContextProperty("effectlist", this);
rootContext()->setContextProperty("effectListModel", m_proxyModel);
m_effectIconProvider.reset(new EffectIconProvider);
engine()->addImageProvider(QStringLiteral("effecticon"), m_effectIconProvider.get());
......
......@@ -23,24 +23,150 @@ import QtQuick 2.4
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtQuick.Window 2.2
import QtQuick.Layouts 1.3
Rectangle {
id: listRoot
TreeView {
ColumnLayout {
anchors.fill: parent
alternatingRowColors: false
headerVisible: false
itemDelegate: Row {
Image{
visible: styleData.value != "root"
source: 'image://effecticon/' + styleData.value
spacing: 0
RowLayout {
Layout.fillWidth: true
Layout.fillHeight: false
spacing: 6
ExclusiveGroup { id: filterGroup}
ToolButton {
id: showAll
implicitWidth: 40
implicitHeight: 40
iconName: "show-all-effects"
onClicked: console.log("show dshow-all-effects")
checkable:true
exclusiveGroup: filterGroup
tooltip: i18n('Show all effects')
}
Text{
text: effectlist.getName(styleData.index)
ToolButton {
id: showVideo
implicitWidth: 40
implicitHeight: 40
iconName: "kdenlive-show-video"
iconSource: 'qrc:///pics/kdenlive-show-video.svgz'
onClicked: console.log("show dshow video")
checkable:true
exclusiveGroup: filterGroup
tooltip: i18n('Show all video effects')
}
ToolButton {
id: showAudio
implicitWidth: 40
implicitHeight: 40
iconName: "kdenlive-show-audio"
iconSource: 'qrc:///pics/kdenlive-show-audio.svgz'
onClicked: console.log("show dshow audio")
checkable:true
exclusiveGroup: filterGroup
tooltip: i18n('Show all audio effects')
}
Rectangle {
//This is a spacer
Layout.fillHeight: true
Layout.fillWidth: true
}
ToolButton {
id: showDescription
implicitWidth: 40
implicitHeight: 40
iconName: "help-about"
onClicked: console.log("show description")
checkable:true
tooltip: i18n('Show/hide description of the effects')
}
}
/*FocusScope {
id: focusScope
width: 250; height: 28
BorderImage {
source: "images/lineedit-bg.png"
width: parent.width; height: parent.height
border { left: 4; top: 4; right: 4; bottom: 4 }
}
BorderImage {
source: "images/lineedit-bg-focus.png"
width: parent.width; height: parent.height
border { left: 4; top: 4; right: 4; bottom: 4 }
visible: parent.activeFocus ? true : false
}
Text {
id: typeSomething
anchors.fill: parent; anchors.leftMargin: 8
verticalAlignment: Text.AlignVCenter
text: "Type something..."
color: "gray"
font.italic: true
}
MouseArea {
anchors.fill: parent
onClicked: { focusScope.focus = true; textInput.openSoftwareInputPanel(); }
}
TextInput {
id: textInput
anchors { left: parent.left; leftMargin: 8; right: clear.left; rightMargin: 8; verticalCenter: parent.verticalCenter }
focus: true
selectByMouse: true
}
Image {
id: clear
anchors { right: parent.right; rightMargin: 8; verticalCenter: parent.verticalCenter }
source: "images/clear.png"
opacity: 0
MouseArea {
anchors.fill: parent
onClicked: { textInput.text = ''; focusScope.focus = true; textInput.openSoftwareInputPanel(); }
}
}
states: State {
name: "hasText"; when: textInput.text != ''
PropertyChanges { target: typeSomething; opacity: 0 }
PropertyChanges { target: clear; opacity: 1 }
}
transitions: [
Transition {
from: ""; to: "hasText"
NumberAnimation { exclude: typeSomething; properties: "opacity" }
},
Transition {
from: "hasText"; to: ""
NumberAnimation { properties: "opacity" }
}
]
} */
TreeView {
Layout.fillHeight: true
Layout.fillWidth: true
alternatingRowColors: false
headerVisible: false
itemDelegate: RowLayout {
Image{
visible: styleData.value != "root"
source: 'image://effecticon/' + styleData.value
}
Text{
text: effectlist.getName(styleData.index)
}
}
TableViewColumn { role: "id"; title: "Name"; width: 200 }
model: effectListModel
}
TableViewColumn { role: "id"; title: "Name"; width: 200 }
model: effectListModel
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment