diff --git a/src/contents/ui/UrlDelegate.qml b/src/contents/ui/UrlDelegate.qml index 5c82842..3180947 100644 --- a/src/contents/ui/UrlDelegate.qml +++ b/src/contents/ui/UrlDelegate.qml @@ -1,110 +1,109 @@ /*************************************************************************** * * * Copyright 2014-2015 Sebastian Kügler * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * * * ***************************************************************************/ import QtQuick 2.3 import QtQuick.Controls 2.0 as Controls import QtQuick.Layouts 1.3 import org.kde.kirigami 2.5 as Kirigami Kirigami.AbstractListItem { id: urlDelegate property bool showRemove: true property string highlightText property var regex: new RegExp(highlightText, 'i') property string highlightedText: "$&" height: Kirigami.Units.gridUnit * 3 width: parent.width Kirigami.Theme.colorSet: Kirigami.Theme.View onClicked: { load(url) //tabs.newTab(url) //contentView.state = "hidden" } signal removed Rectangle { Kirigami.Theme.inherit: true anchors.fill: parent color: Kirigami.Theme.backgroundColor } RowLayout { Kirigami.Theme.inherit: true Item { Layout.preferredHeight: parent.height Layout.preferredWidth: parent.height Image { anchors.fill: parent fillMode: Image.PreserveAspectFit source: model.icon ? model.icon : "" } Image { source: preview == undefined ? "" : preview } } ColumnLayout { Layout.fillWidth: true // title Controls.Label { text: title ? title.replace(regex, highlightedText) : "" elide: Qt.ElideRight maximumLineCount: 1 Layout.fillWidth: true } // url Controls.Label { text: url ? url.replace(regex, highlightedText) : "" opacity: 0.6 - font.pointSize: theme.smallestFont.pointSize elide: Qt.ElideRight maximumLineCount: 1 Layout.fillWidth: true } } // We can't use SwipeListItem for performance reasons Kirigami.Icon { height: Kirigami.Units.gridUnit * 2 width: height source: "list-remove" visible: urlDelegate.showRemove MouseArea { anchors.fill: parent onClicked: urlDelegate.removed(); } } } }