Открыть боковую панель
Aurora OS
Libraries
AmberPDF QML Plugin
Коммиты
fa9efd98
Коммит
fa9efd98
создал
Ноя 20, 2023
по автору
OMP Education
Зафиксировано автором
k.sagalakova
Фев 15, 2024
Просмотр файлов
[notes] Add pageIndex for Note.
Co-Authored-By:
Anton Zernin
<
a.zernin@omp.ru
>
владелец
0b052d6c
Изменения
6
Скрыть пробелы
Построчно
Рядом
plugin/PdfView.qml
Просмотр файла @
fa9efd98
// SPDX-FileCopyrightText: 2022 Open Mobile Platform LLC <community@omp.ru>
// SPDX-FileCopyrightText: 2022
-2023
Open Mobile Platform LLC <community@omp.ru>
// SPDX-License-Identifier: BSD-3-Clause
import
QtQuick
2.0
...
...
@@ -34,7 +34,7 @@ Rectangle {
signal
clicked
()
signal
clickedUrl
(
string
url
)
signal
noteActivate
(
string
noteText
,
string
author
)
signal
noteActivate
(
string
noteText
,
string
author
,
int
pageIndex
)
signal
contentChanged
()
signal
documentSaved
(
bool
saveStatus
)
signal
holding
(
var
lastMouse
,
var
screenCoordinates
)
...
...
@@ -91,7 +91,7 @@ Rectangle {
onItemScaleChanged
:
root
.
correctPosition
()
onClickedUrl
:
root
.
clickedUrl
(
url
)
onClickedGoToPage
:
root
.
correctPosition
()
onNoteActivated
:
root
.
noteActivate
(
noteText
,
author
)
onNoteActivated
:
root
.
noteActivate
(
noteText
,
author
,
pageIndex
)
onDocumentSaved
:
root
.
documentSaved
(
saveStatus
)
onNoteRemoved
:
root
.
noteRemoved
(
pageIndex
,
noteId
,
result
)
},
...
...
plugin/src/pdfpagecontainer.cpp
Просмотр файла @
fa9efd98
// SPDX-FileCopyrightText: 2022
-
2023 Open Mobile Platform LLC <community@omp.ru>
// SPDX-FileCopyrightText: 2022
-
2023 Open Mobile Platform LLC <community@omp.ru>
// SPDX-License-Identifier: BSD-3-Clause
#include
"QQuickWindow"
...
...
@@ -538,7 +538,7 @@ void PdfPageContainer::_loadAnnotations()
if
(
annotation
->
type
==
BaseAnnotation
::
AnnotationType
::
HighLight
||
annotation
->
type
==
BaseAnnotation
::
AnnotationType
::
Text
)
{
auto
noteItem
=
new
PdfSimpleNote
(
this
,
annotation
);
connect
(
noteItem
,
&
PdfSimpleNote
::
triggered
,
this
,
&
PdfPageContainer
::
noteActivate
);
connect
(
noteItem
,
&
PdfSimpleNote
::
triggered
,
this
,
&
PdfPageContainer
::
_
noteActivate
);
connect
(
this
,
&
PdfPageContainer
::
yChanged
,
noteItem
,
&
PdfSimpleNote
::
clearHighlight
);
noteItem
->
setOpacity
(
m_notesPaint
?
1.0
:
0.0
);
noteItem
->
setX
(
annotation
->
rect
.
x
()
*
pageRate
);
...
...
@@ -575,3 +575,8 @@ void PdfPageContainer::_prepareBackgroundPage()
m_backgroundPage
->
setRenderable
(
true
);
m_backgroundPage
->
setZ
(
-
1
);
}
void
PdfPageContainer
::
_noteActivate
(
QString
noteText
,
QString
author
)
{
emit
noteActivate
(
noteText
,
author
,
m_pageSource
->
pageNumber
());
}
plugin/src/pdfpagecontainer.h
Просмотр файла @
fa9efd98
// SPDX-FileCopyrightText: 2022
-
2023 Open Mobile Platform LLC <community@omp.ru>
// SPDX-FileCopyrightText: 2022
-
2023 Open Mobile Platform LLC <community@omp.ru>
// SPDX-License-Identifier: BSD-3-Clause
#ifndef PDFPAGECONTAINER_H
...
...
@@ -70,7 +70,7 @@ signals:
void
annotationsLoaded
();
void
annotationActivate
(
BaseAnnotation
*
);
void
notesPaintChanged
(
bool
notesPaint
);
void
noteActivate
(
QString
,
QString
);
void
noteActivate
(
QString
,
QString
,
int
);
void
noteRemoved
(
int
,
bool
);
void
noteEdited
(
int
,
bool
);
...
...
@@ -80,6 +80,7 @@ private slots:
void
_updateVisible
();
void
_loadAnnotations
();
void
_prepareBackgroundPage
();
void
_noteActivate
(
QString
noteText
,
QString
author
);
private:
PageGeometry
m_pageGeometry
;
...
...
plugin/src/pdfsimplenote.cpp
Просмотр файла @
fa9efd98
// SPDX-FileCopyrightText: 2022 Open Mobile Platform LLC <community@omp.ru>
// SPDX-FileCopyrightText: 2022
-2023
Open Mobile Platform LLC <community@omp.ru>
// SPDX-License-Identifier: BSD-3-Clause
#include
<QQuickWindow>
...
...
plugin/src/pdfsimplenote.h
Просмотр файла @
fa9efd98
// SPDX-FileCopyrightText: 2022 Open Mobile Platform LLC <community@omp.ru>
// SPDX-FileCopyrightText: 2022
-2023
Open Mobile Platform LLC <community@omp.ru>
// SPDX-License-Identifier: BSD-3-Clause
#ifndef PDFSIMPLENOTE_H
...
...
plugin/src/pdfview.h
Просмотр файла @
fa9efd98
...
...
@@ -124,7 +124,7 @@ signals:
void
clickedUrl
(
QString
url
)
const
;
void
clickedGoToPage
(
int
pageNumber
,
QPointF
coordinateOnPage
)
const
;
void
notesPaintChanged
(
bool
notesPaint
);
void
noteActivated
(
QString
noteText
,
QString
author
);
void
noteActivated
(
QString
noteText
,
QString
author
,
int
pageIndex
);
void
documentProviderChanged
(
BaseDocument
*
documentProvider
);
void
pdfPathChanged
(
QString
pdfPath
);
void
pageRangeChanged
(
QString
pageRange
);
...
...
Редактирование
Предварительный просмотр
Поддерживает Markdown
0%
Попробовать снова
или
прикрепить новый файл
.
Отмена
You are about to add
0
people
to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Отмена
Пожалуйста,
зарегистрируйтесь
или
войдите
чтобы прокомментировать