mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 02:45:38 +00:00
port the QML part
works correctly when a filename is fixed still to port the c++ app part
This commit is contained in:
parent
3d50fec102
commit
78d8b1f605
|
@ -17,7 +17,7 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import QtQuick 2.1
|
||||
|
||||
|
||||
ThumbnailsBase {
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
import org.kde.plasma.extras 0.1 as PlasmaExtras
|
||||
import org.kde.plasma.core 0.1 as PlasmaCore
|
||||
import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
|
||||
import org.kde.qtextracomponents 0.1
|
||||
import org.kde.okular 0.1 as Okular
|
||||
import QtQuick 2.1
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
import org.kde.kquickcontrolsaddons 2.0
|
||||
import org.kde.okular 2.0 as Okular
|
||||
|
||||
|
||||
MobileComponents.OverlayDrawer {
|
||||
|
|
|
@ -17,13 +17,13 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.core 0.1 as PlasmaCore
|
||||
import org.kde.plasma.extras 0.1 as PlasmaExtra
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
|
||||
import org.kde.qtextracomponents 0.1
|
||||
import org.kde.okular 0.1 as Okular
|
||||
import QtQuick 2.1
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.extras 2.0 as PlasmaExtra
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
import org.kde.kquickcontrolsaddons 2.0
|
||||
import org.kde.okular 2.0 as Okular
|
||||
|
||||
MouseEventListener {
|
||||
id: root
|
||||
|
|
|
@ -17,11 +17,11 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
import org.kde.plasma.core 0.1 as PlasmaCore
|
||||
import org.kde.plasma.extras 0.1 as PlasmaExtras
|
||||
import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
|
||||
import QtQuick 2.1
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||
import org.kde.plasma.mobilecomponents 2.0 as MobileComponents
|
||||
|
||||
PlasmaComponents.Page {
|
||||
property alias contentY: flickable.contentY
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
import org.kde.plasma.core 0.1 as PlasmaCore
|
||||
import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
|
||||
import QtQuick 2.1
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
|
||||
ThumbnailsBase {
|
||||
id: root
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.okular 0.1 as Okular
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
import org.kde.plasma.core 0.1 as PlasmaCore
|
||||
import org.kde.plasma.extras 0.1 as PlasmaExtras
|
||||
import org.kde.plasma.mobilecomponents 0.1 as MobileComponents
|
||||
import QtQuick 2.1
|
||||
import org.kde.okular 2.0 as Okular
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||
import org.kde.plasma.mobilecomponents 0.2 as MobileComponents
|
||||
|
||||
PlasmaComponents.Page {
|
||||
id: root
|
||||
|
@ -41,8 +41,8 @@ PlasmaComponents.Page {
|
|||
id: resultsGrid
|
||||
anchors.fill: parent
|
||||
|
||||
cellWidth: theme.defaultFont.mSize.width * 14
|
||||
cellHeight: theme.defaultFont.mSize.height * 12
|
||||
cellWidth: theme.mSize(theme.defaultFont).width * 14
|
||||
cellHeight: theme.mSize(theme.defaultFont).height * 12
|
||||
|
||||
delegate: Item {
|
||||
width: resultsGrid.cellWidth
|
||||
|
@ -66,9 +66,9 @@ PlasmaComponents.Page {
|
|||
y: parent.margins.top
|
||||
document: documentItem
|
||||
pageNumber: modelData
|
||||
width: theme.defaultFont.mSize.width * 10
|
||||
width: theme.mSize(theme.defaultFont).width * 10
|
||||
//value repeated to avoid binding loops
|
||||
height: Math.round(theme.defaultFont.mSize.width * 10 / (implicitWidth/implicitHeight))
|
||||
height: Math.round(theme.mSize(theme.defaultFont).width * 10 / (implicitWidth/implicitHeight))
|
||||
Rectangle {
|
||||
width: childrenRect.width
|
||||
height: childrenRect.height
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
import org.kde.plasma.core 0.1 as PlasmaCore
|
||||
import org.kde.qtextracomponents 0.1
|
||||
import QtQuick 2.1
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
import org.kde.plasma.core 2.0 as PlasmaCore
|
||||
import org.kde.qtextracomponents 2.0
|
||||
|
||||
Column {
|
||||
id: treeDelegate
|
||||
|
@ -66,7 +66,7 @@ Column {
|
|||
//there isn't a sane way to do a dotted line in QML1
|
||||
Rectangle {
|
||||
color: theme.textColor
|
||||
opacity: 0.1
|
||||
opacity: 2.0
|
||||
height: 1
|
||||
anchors {
|
||||
bottom: parent.bottom
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
import QtQuick 1.1
|
||||
import org.kde.okular 0.1 as Okular
|
||||
import org.kde.plasma.extras 0.1 as PlasmaExtras
|
||||
import org.kde.plasma.components 0.1 as PlasmaComponents
|
||||
import QtQuick 2.1
|
||||
import org.kde.okular 2.0 as Okular
|
||||
import org.kde.plasma.extras 2.0 as PlasmaExtras
|
||||
import org.kde.plasma.components 2.0 as PlasmaComponents
|
||||
|
||||
Image {
|
||||
id: fileBrowserRoot
|
||||
|
@ -31,10 +31,11 @@ Image {
|
|||
width: 360
|
||||
height: 360
|
||||
|
||||
/*TODO: port ResourceInstance
|
||||
PlasmaExtras.ResourceInstance {
|
||||
id: resourceInstance
|
||||
uri: documentItem.path
|
||||
}
|
||||
}*/
|
||||
|
||||
Okular.DocumentItem {
|
||||
id: documentItem
|
||||
|
|
|
@ -119,7 +119,7 @@ int DocumentItem::pageCount() const
|
|||
return m_document->pages();
|
||||
}
|
||||
|
||||
QList<int> DocumentItem::matchingPages() const
|
||||
QVariantList DocumentItem::matchingPages() const
|
||||
{
|
||||
return m_matchingPages;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ class DocumentItem : public QObject
|
|||
/**
|
||||
* A list of all pages that contain a match for the search terms. If no text has been searched, all pages are returned.
|
||||
*/
|
||||
Q_PROPERTY(QList<int> matchingPages READ matchingPages NOTIFY matchingPagesChanged)
|
||||
Q_PROPERTY(QVariantList matchingPages READ matchingPages NOTIFY matchingPagesChanged)
|
||||
|
||||
/**
|
||||
* Table of contents for the document, if available
|
||||
|
@ -114,7 +114,7 @@ public:
|
|||
|
||||
bool isSearchInProgress() const;
|
||||
|
||||
QList<int> matchingPages() const;
|
||||
QVariantList matchingPages() const;
|
||||
|
||||
TOCModel *tableOfContents() const;
|
||||
|
||||
|
@ -160,7 +160,7 @@ private:
|
|||
TOCModel *m_tocModel;
|
||||
Observer *m_thumbnailObserver;
|
||||
Observer *m_pageviewObserver;
|
||||
QList<int> m_matchingPages;
|
||||
QVariantList m_matchingPages;
|
||||
bool m_searchInProgress;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue