Warning, /office/kbibtex/mobile/sailfishos/qml/pages/BibliographyListView.qml is written in an unsupported language. File is not indexed.

0001 /***************************************************************************
0002  *   SPDX-License-Identifier: GPL-2.0-or-later
0003  *                                                                         *
0004  *   SPDX-FileCopyrightText: 2016-2019 Thomas Fischer <fischer@unix-ag.uni-kl.de>
0005  *                                                                         *
0006  *   This program is free software; you can redistribute it and/or modify  *
0007  *   it under the terms of the GNU General Public License as published by  *
0008  *   the Free Software Foundation; either version 2 of the License, or     *
0009  *   (at your option) any later version.                                   *
0010  *                                                                         *
0011  *   This program is distributed in the hope that it will be useful,       *
0012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
0013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
0014  *   GNU General Public License for more details.                          *
0015  *                                                                         *
0016  *   You should have received a copy of the GNU General Public License     *
0017  *   along with this program; if not, see <https://www.gnu.org/licenses/>. *
0018  ***************************************************************************/
0019 
0020 import QtQuick 2.0
0021 import Sailfish.Silica 1.0
0022 
0023 Page {
0024     id: resultPage
0025     allowedOrientations: Orientation.All
0026 
0027     SilicaListView {
0028         id: bibliographyListView
0029         model: bibliographyModel
0030 
0031         spacing: Theme.paddingMedium
0032         anchors.fill: parent
0033 
0034         VerticalScrollDecorator {
0035             enabled: bibliographyListView.count > 0
0036         }
0037 
0038         ViewPlaceholder {
0039             enabled: bibliographyListView.count === 0
0040             text: bibliographyModel.busy
0041                   ? qsTr("Waiting for results ...")
0042                   : qsTr("Pull down to start a new search.")
0043         }
0044 
0045         ProgressBar {
0046             visible: bibliographyModel.busy
0047             value: bibliographyModel.progress
0048             anchors.bottom: parent.bottom
0049             anchors.left: parent.left
0050             anchors.right: parent.right
0051             minimumValue: 0
0052             maximumValue: 1000
0053         }
0054 
0055         delegate: BackgroundItem {
0056             id: delegate
0057             width: parent.width
0058             height: col.childrenRect.height
0059 
0060             Column {
0061                 id: col
0062                 width: parent.width - x
0063                 x: Theme.horizontalPageMargin
0064 
0065                 Label {
0066                     text: authorShort + " (" + year + ")"
0067                     width: parent.width
0068                     font.pointSize: Theme.fontSizeSmall
0069                     clip: true
0070                     color: delegate.highlighted ? Theme.secondaryHighlightColor : Theme.secondaryColor
0071                     truncationMode: TruncationMode.Fade
0072                 }
0073                 Label {
0074                     text: title
0075                     font.pointSize: Theme.fontSizeMedium
0076                     width: parent.width
0077                     clip: true
0078                     color: delegate.highlighted ? Theme.highlightColor : Theme.primaryColor
0079                     truncationMode: TruncationMode.Fade
0080                 }
0081                 Label {
0082                     visible: wherePublished.length > 0
0083                     text: wherePublished
0084                     width: parent.width
0085                     clip: true
0086                     font.pointSize: Theme.fontSizeExtraSmall
0087                     color: delegate.highlighted ? Theme.secondaryHighlightColor : Theme.secondaryColor
0088                     opacity: 0.9
0089                     truncationMode: TruncationMode.Fade
0090                 }
0091             }
0092 
0093             onClicked: pageStack.push("EntryView.qml", {
0094                                           author: author,
0095                                           title: title,
0096                                           wherePublished: wherePublished,
0097                                           year: year,
0098                                           url: url,
0099                                           doi: doi,
0100                                           foundVia: foundVia
0101                                       })
0102         }
0103 
0104         PullDownMenu {
0105             MenuItem {
0106                 text: qsTr("About")
0107                 onClicked: pageStack.push("AboutPage.qml")
0108             }
0109             MenuItem {
0110                 text: qsTr("Settings")
0111                 onClicked: pageStack.push("SettingsPage.qml")
0112             }
0113             MenuItem {
0114                 text: qsTr("New Search")
0115                 onClicked: pageStack.push("SearchForm.qml")
0116             }
0117         }
0118     }
0119 }