2 Copyright (C) 2010 Klarälvdalens Datakonsult AB,
3 a KDAB Group company, info@kdab.net,
4 author Tobias Koenig <tokoe@kdab.com>
6 This library is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Library General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or (at your
9 option) any later version.
11 This library is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 License for more details.
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 import org.kde.pim.mobileui 4.5 as KPIM
29 property int actionItemHeight : 70
30 property int actionItemWidth : 200
31 property int actionItemSpacing : 0
32 property int bottomMargin
33 anchors.bottomMargin : bottomMargin
35 property alias model : snippetsView.model
37 property alias customActions : actionColumn.content
39 signal triggered(string triggeredName)
42 KPIM.DecoratedListView {
44 anchors { top: parent.top; bottom: parent.bottom; left: parent.left }
45 width: parent.width - actionColumn.width
59 opacity: snippetDelegate.QML.ListView.isCurrentItem ? 0.25 : 0
60 color: "lightsteelblue"
65 anchors.leftMargin: model.isSnippetGroup ? 5 : 25
67 font.bold: model.isSnippetGroup
68 horizontalAlignment: QML.Text.AlignLeft
69 verticalAlignment: QML.Text.AlignVCenter
74 onClicked: { snippetDelegate.QML.ListView.view.currentIndex = model.index; }
78 onCurrentIndexChanged : {
79 snippetsEditor.setRowSelected( currentIndex )
83 KPIM.ActionMenuContainer {
85 width : _topLevel.actionItemWidth
86 anchors.top : parent.top
87 anchors.bottom : parent.bottom
88 anchors.right : parent.right
89 actionItemWidth : width
90 actionItemHeight : _topLevel.actionItemHeight
93 KPIM.ActionListItem { name : "snippetseditor_insert_snippet"; title: KDE.i18n("Insert\nSnippet") },
94 KPIM.ActionListItem { name : "snippetseditor_add_snippet"; title: KDE.i18n("Add\nSnippet") },
95 KPIM.ActionListItem { name : "snippetseditor_edit_snippet"; title: KDE.i18n("Edit\nSnippet") },
96 KPIM.ActionListItem { name : "snippetseditor_delete_snippet"; title: KDE.i18n("Delete\nSnippet") },
97 KPIM.ActionListItem { name : "snippetseditor_add_snippetgroup"; title: KDE.i18n("Add\nGroup") },
98 KPIM.ActionListItem { name : "snippetseditor_edit_snippetgroup"; title: KDE.i18n("Edit\nGroup") },
99 KPIM.ActionListItem { name : "snippetseditor_delete_snippetgroup"; title: KDE.i18n("Delete\nGroup") }
103 if ( triggeredName == "snippetseditor_insert_snippet" ) {
109 onActionItemSpacingChanged : {
110 actionColumn.refresh();
113 onActionItemHeightChanged : {
114 actionColumn.refresh();