repdf 0.0.18__tar.gz → 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {repdf-0.0.18 → repdf-0.1.0}/PKG-INFO +2 -2
- {repdf-0.0.18 → repdf-0.1.0}/README.md +1 -1
- {repdf-0.0.18 → repdf-0.1.0}/pyproject.toml +1 -1
- {repdf-0.0.18 → repdf-0.1.0}/pyproject.toml.orig +1 -1
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/app.py +3 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/icons.py +9 -4
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/search_panel.py +5 -22
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/theme.py +4 -4
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/__init__.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/__main__.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/assets/check-dark.svg +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/assets/check.svg +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/assets/partial-dark.svg +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/assets/partial.svg +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/assets/repdf.ico +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/assets/repdf.png +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/core.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/entrypoint.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/images.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/navigation.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/ocr.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/packaging_smoke.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/page_view.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/pdf_navigation.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/preferences.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/preview.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/print_preview.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/printing.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/render_worker.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/renderer.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/search.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/strings.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/toolbar.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/widgets.py +0 -0
- {repdf-0.0.18 → repdf-0.1.0}/src/repdf/workers.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: repdf
|
|
3
|
-
Version: 0.0
|
|
3
|
+
Version: 0.1.0
|
|
4
4
|
Summary: RePDF (Read the PDF): a desktop PDF reader with printing, search, bookmarks, OCR and page rearrangement.
|
|
5
5
|
Requires-Dist: onnxruntime>=1.31.0,<2
|
|
6
6
|
Requires-Dist: pillow>=11.0,<13
|
|
@@ -206,7 +206,7 @@ repdf
|
|
|
206
206
|
### 複製文字、區域 OCR 與擷取圖片
|
|
207
207
|
|
|
208
208
|
- 三種模式互斥;一般預覽與全螢幕皆可使用。
|
|
209
|
-
-
|
|
209
|
+
- 啟用時按鈕以 hover 底色與強調色圖示標示,不顯示外框;關閉後恢復拖放排序。
|
|
210
210
|
- 複製文字:啟用後拖曳選取,放開滑鼠即可複製;掃描影像中的文字請使用區域 OCR。
|
|
211
211
|
- 區域 OCR:啟用後拖曳矩形範圍,放開滑鼠後辨識並複製;空白範圍保留原剪貼簿。
|
|
212
212
|
- 擷取圖片:啟用後點選內嵌點陣圖片,再選擇位置另存為 PNG。
|
|
@@ -189,7 +189,7 @@ repdf
|
|
|
189
189
|
### 複製文字、區域 OCR 與擷取圖片
|
|
190
190
|
|
|
191
191
|
- 三種模式互斥;一般預覽與全螢幕皆可使用。
|
|
192
|
-
-
|
|
192
|
+
- 啟用時按鈕以 hover 底色與強調色圖示標示,不顯示外框;關閉後恢復拖放排序。
|
|
193
193
|
- 複製文字:啟用後拖曳選取,放開滑鼠即可複製;掃描影像中的文字請使用區域 OCR。
|
|
194
194
|
- 區域 OCR:啟用後拖曳矩形範圍,放開滑鼠後辨識並複製;空白範圍保留原剪貼簿。
|
|
195
195
|
- 擷取圖片:啟用後點選內嵌點陣圖片,再選擇位置另存為 PNG。
|
|
@@ -799,6 +799,9 @@ class MainWindow(QMainWindow):
|
|
|
799
799
|
for action in self.toolbar.actions():
|
|
800
800
|
button = self.toolbar.widgetForAction(action)
|
|
801
801
|
if isinstance(button, QToolButton):
|
|
802
|
+
if action.isCheckable():
|
|
803
|
+
button.setProperty('stateButton', True)
|
|
804
|
+
button.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
|
|
802
805
|
if button is self.zoom_display:
|
|
803
806
|
button.setFixedHeight(34)
|
|
804
807
|
else:
|
|
@@ -7,14 +7,17 @@ from PySide6.QtWidgets import QApplication
|
|
|
7
7
|
|
|
8
8
|
def toolbar_icon(kind: str) -> QIcon:
|
|
9
9
|
icon = QIcon()
|
|
10
|
-
for mode, group in (
|
|
11
|
-
|
|
10
|
+
for mode, group, state, role in (
|
|
11
|
+
(QIcon.Mode.Normal, QPalette.ColorGroup.Active, QIcon.State.Off, QPalette.ColorRole.ButtonText),
|
|
12
|
+
(QIcon.Mode.Normal, QPalette.ColorGroup.Active, QIcon.State.On, QPalette.ColorRole.Highlight),
|
|
13
|
+
(QIcon.Mode.Disabled, QPalette.ColorGroup.Disabled, QIcon.State.Off, QPalette.ColorRole.ButtonText),
|
|
14
|
+
(QIcon.Mode.Disabled, QPalette.ColorGroup.Disabled, QIcon.State.On, QPalette.ColorRole.ButtonText)):
|
|
12
15
|
pixmap = QPixmap(48, 48)
|
|
13
16
|
pixmap.fill(Qt.GlobalColor.transparent)
|
|
14
17
|
painter = QPainter(pixmap)
|
|
15
18
|
painter.setRenderHint(QPainter.RenderHint.Antialiasing)
|
|
16
19
|
painter.scale(2, 2)
|
|
17
|
-
painter.setPen(QPen(QApplication.palette().color(group,
|
|
20
|
+
painter.setPen(QPen(QApplication.palette().color(group, role),
|
|
18
21
|
1.0, Qt.PenStyle.SolidLine, Qt.PenCapStyle.RoundCap,
|
|
19
22
|
Qt.PenJoinStyle.RoundJoin))
|
|
20
23
|
if kind == "more":
|
|
@@ -158,5 +161,7 @@ def toolbar_icon(kind: str) -> QIcon:
|
|
|
158
161
|
if kind == "zoom_in":
|
|
159
162
|
painter.drawLine(9, 6, 9, 13)
|
|
160
163
|
painter.end()
|
|
161
|
-
icon.addPixmap(pixmap, mode)
|
|
164
|
+
icon.addPixmap(pixmap, mode, state)
|
|
165
|
+
if mode == QIcon.Mode.Normal:
|
|
166
|
+
icon.addPixmap(pixmap, QIcon.Mode.Active, state)
|
|
162
167
|
return icon
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
from html import escape
|
|
4
4
|
|
|
5
|
-
from PySide6.QtCore import QEvent, QObject,
|
|
6
|
-
from PySide6.QtGui import QAction, QActionGroup, QColor, QIcon, QPainter,
|
|
5
|
+
from PySide6.QtCore import QEvent, QObject, QSize, Qt, QTimer, Signal
|
|
6
|
+
from PySide6.QtGui import QAction, QActionGroup, QColor, QIcon, QPainter, QPixmap
|
|
7
7
|
from PySide6.QtWidgets import (
|
|
8
8
|
QAbstractItemView, QColorDialog, QComboBox, QHBoxLayout, QLabel, QLayout, QLineEdit, QListView, QListWidget,
|
|
9
9
|
QListWidgetItem, QMenu, QSplitter, QStyle, QStyledItemDelegate, QStyleOptionViewItem,
|
|
@@ -52,30 +52,11 @@ class ParagraphDelegate(QStyledItemDelegate):
|
|
|
52
52
|
return QSize(0, option.fontMetrics.height() + 10)
|
|
53
53
|
|
|
54
54
|
|
|
55
|
-
class SearchOptionButton(QToolButton):
|
|
56
|
-
"""Paint the thin rounded outline with antialiasing at the current DPI."""
|
|
57
|
-
|
|
58
|
-
def __init__(self):
|
|
59
|
-
super().__init__()
|
|
60
|
-
# Retain QSS backgrounds and sizing, replacing only its raster outline.
|
|
61
|
-
self.setStyleSheet('QToolButton { border-color: transparent; }')
|
|
62
|
-
|
|
63
|
-
def paintEvent(self, event):
|
|
64
|
-
super().paintEvent(event)
|
|
65
|
-
if self.isEnabled() and (self.isChecked() or self.hasFocus()):
|
|
66
|
-
painter = QPainter(self)
|
|
67
|
-
painter.setRenderHint(QPainter.RenderHint.Antialiasing)
|
|
68
|
-
painter.setPen(QPen(self.palette().highlight().color(), 1.0))
|
|
69
|
-
painter.setBrush(Qt.BrushStyle.NoBrush)
|
|
70
|
-
painter.drawRoundedRect(QRectF(self.rect()).adjusted(0.5, 0.5, -0.5, -0.5), 3.5, 3.5)
|
|
71
|
-
painter.end()
|
|
72
|
-
|
|
73
|
-
|
|
74
55
|
class SearchPanel(QWidget):
|
|
75
56
|
highlight_color_changed = Signal(str)
|
|
76
57
|
|
|
77
58
|
def _button(self, kind, label):
|
|
78
|
-
button =
|
|
59
|
+
button = QToolButton()
|
|
79
60
|
button.setText(tr(label))
|
|
80
61
|
button.setToolTip(tr(label))
|
|
81
62
|
button.setAccessibleName(tr(label))
|
|
@@ -125,6 +106,8 @@ class SearchPanel(QWidget):
|
|
|
125
106
|
for button in (self.regular_expression, self.case_sensitive, self.whole_word):
|
|
126
107
|
button.setObjectName('searchOptionButton')
|
|
127
108
|
button.setCheckable(True)
|
|
109
|
+
button.setProperty('stateButton', True)
|
|
110
|
+
button.setAttribute(Qt.WidgetAttribute.WA_Hover, True)
|
|
128
111
|
options.addWidget(self.regular_expression)
|
|
129
112
|
options.addWidget(self.case_sensitive)
|
|
130
113
|
options.addWidget(self.whole_word)
|
|
@@ -74,7 +74,6 @@ class ThemeController(QObject):
|
|
|
74
74
|
slider_handle = "#ff9d45" if dark else "#0b57d0"
|
|
75
75
|
hover = "#3b2a56" if dark else "#e7ebf0"
|
|
76
76
|
pressed = "#4d376e" if dark else "#d8e3f3"
|
|
77
|
-
selected_tool = "#36432b" if dark else "#d8e7ff"
|
|
78
77
|
mark_suffix = "-dark" if dark else ""
|
|
79
78
|
check = files("repdf").joinpath("assets", f"check{mark_suffix}.svg").as_posix()
|
|
80
79
|
partial = files("repdf").joinpath("assets", f"partial{mark_suffix}.svg").as_posix()
|
|
@@ -96,10 +95,11 @@ class ThemeController(QObject):
|
|
|
96
95
|
border-radius: 4px; padding: 4px; color: palette(button-text); }}
|
|
97
96
|
QToolButton:hover {{ background: {hover}; }}
|
|
98
97
|
QToolButton:pressed {{ background: {pressed}; }}
|
|
99
|
-
QToolButton#copyTextTool:checked, QToolButton#regionOcrTool:checked, QToolButton#extractImageTool:checked,
|
|
100
|
-
QToolButton#searchOptionButton:checked, QToolButton#bookmarksTool:checked {{ background: {selected_tool};
|
|
101
|
-
border-color: {slider_fill}; }}
|
|
102
98
|
QToolButton:focus {{ border-color: {slider_fill}; }}
|
|
99
|
+
QToolButton[stateButton="true"] {{ border-color: transparent; border-radius: 8px; }}
|
|
100
|
+
QToolButton[stateButton="true"]:checked {{ background: {hover}; border-color: transparent; }}
|
|
101
|
+
QToolButton[stateButton="true"]:checked:hover {{ background: {pressed}; }}
|
|
102
|
+
QToolButton[stateButton="true"]:disabled {{ background: transparent; }}
|
|
103
103
|
QToolButton:disabled {{ color: {disabled}; background: transparent; }}
|
|
104
104
|
QPushButton {{ background: {card}; color: palette(button-text);
|
|
105
105
|
border: 1px solid {border}; border-radius: 5px;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|