mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-06 09:15:37 +01:00
Compare commits
2 commits
528efd3d88
...
9a73323fa3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a73323fa3 | ||
|
|
894f7d547a |
5 changed files with 21 additions and 12 deletions
|
|
@ -30,8 +30,9 @@
|
|||
|
||||
|
||||
def get_filters():
|
||||
archives = ['zip', 'rar']
|
||||
return [
|
||||
(_('Books'), BOOK_EXTENSIONS),
|
||||
(_('Books'), [x for x in BOOK_EXTENSIONS if x not in archives]),
|
||||
(_('EPUB books'), ['epub', 'kepub']),
|
||||
(_('Kindle books'), ['mobi', 'prc', 'azw', 'azw3', 'kfx', 'tpz', 'azw1', 'azw4']),
|
||||
(_('PDF books'), ['pdf', 'azw4']),
|
||||
|
|
@ -39,7 +40,7 @@ def get_filters():
|
|||
(_('LIT books'), ['lit']),
|
||||
(_('Text books'), ['txt', 'text', 'rtf', 'md', 'markdown', 'textile', 'txtz']),
|
||||
(_('Comics'), ['cbz', 'cbr', 'cbc']),
|
||||
(_('Archives'), ['zip', 'rar']),
|
||||
(_('Archives'), archives),
|
||||
(_('Wordprocessor files'), ['odt', 'doc', 'docx']),
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -5,9 +5,9 @@
|
|||
import json
|
||||
from operator import itemgetter
|
||||
from qt.core import (
|
||||
QAction, QComboBox, QGridLayout, QHBoxLayout, QIcon, QInputDialog,
|
||||
QItemSelectionModel, QLabel, QListWidget, QListWidgetItem, QPushButton, Qt,
|
||||
QWidget, pyqtSignal
|
||||
QAbstractItemView, QAction, QComboBox, QGridLayout, QHBoxLayout, QIcon,
|
||||
QInputDialog, QItemSelectionModel, QLabel, QListWidget, QListWidgetItem,
|
||||
QPushButton, QScroller, Qt, QWidget, pyqtSignal
|
||||
)
|
||||
|
||||
from calibre.gui2 import choose_files, choose_save_file
|
||||
|
|
@ -32,6 +32,8 @@ def __init__(self, parent=None):
|
|||
self.addAction(ac)
|
||||
self.ac_delete = ac = QAction(QIcon(I('trash.png')), _('Remove this bookmark'), self)
|
||||
self.addAction(ac)
|
||||
QScroller.grabGesture(self.viewport(), QScroller.ScrollerGestureType.TouchGesture)
|
||||
self.setVerticalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel)
|
||||
|
||||
@property
|
||||
def current_non_removed_item(self):
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
QAbstractItemView, QColor, QDialog, QFont, QHBoxLayout, QIcon, QImage,
|
||||
QItemSelectionModel, QKeySequence, QLabel, QMenu, QPainter, QPainterPath,
|
||||
QPalette, QPixmap, QPushButton, QRect, QSizePolicy, QStyle, Qt, QTextCursor,
|
||||
QTextEdit, QTreeWidget, QTreeWidgetItem, QVBoxLayout, QWidget, pyqtSignal
|
||||
QTextEdit, QTreeWidget, QTreeWidgetItem, QVBoxLayout, QWidget, pyqtSignal, QScroller
|
||||
)
|
||||
|
||||
from calibre.constants import (
|
||||
|
|
@ -175,6 +175,8 @@ def __init__(self, parent=None):
|
|||
self.uuid_map = {}
|
||||
self.section_font = QFont(self.font())
|
||||
self.section_font.setItalic(True)
|
||||
QScroller.grabGesture(self.viewport(), QScroller.ScrollerGestureType.TouchGesture)
|
||||
self.setVerticalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel)
|
||||
|
||||
def show_context_menu(self, point):
|
||||
index = self.indexAt(point)
|
||||
|
|
|
|||
|
|
@ -6,8 +6,9 @@
|
|||
from collections import Counter, OrderedDict
|
||||
from html import escape
|
||||
from qt.core import (
|
||||
QCheckBox, QComboBox, QFont, QHBoxLayout, QIcon, QLabel, Qt, QToolButton,
|
||||
QTreeWidget, QTreeWidgetItem, QVBoxLayout, QWidget, pyqtSignal
|
||||
QAbstractItemView, QCheckBox, QComboBox, QFont, QHBoxLayout, QIcon, QLabel,
|
||||
QScroller, Qt, QToolButton, QTreeWidget, QTreeWidgetItem, QVBoxLayout, QWidget,
|
||||
pyqtSignal
|
||||
)
|
||||
from threading import Thread
|
||||
|
||||
|
|
@ -471,6 +472,8 @@ def __init__(self, parent=None):
|
|||
self.section_map = {}
|
||||
self.search_results = []
|
||||
self.item_map = {}
|
||||
QScroller.grabGesture(self.viewport(), QScroller.ScrollerGestureType.TouchGesture)
|
||||
self.setVerticalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel)
|
||||
|
||||
def current_item_changed(self, current, previous):
|
||||
if current is not None:
|
||||
|
|
|
|||
|
|
@ -4,11 +4,10 @@
|
|||
|
||||
import re
|
||||
from functools import partial
|
||||
|
||||
from qt.core import (
|
||||
QApplication, QFont, QHBoxLayout, QIcon, QMenu, QModelIndex, QStandardItem,
|
||||
QStandardItemModel, QStyledItemDelegate, Qt, QToolButton, QToolTip, QTreeView,
|
||||
QWidget, pyqtSignal, QEvent
|
||||
QAbstractItemView, QApplication, QEvent, QFont, QHBoxLayout, QIcon, QMenu,
|
||||
QModelIndex, QScroller, QStandardItem, QStandardItemModel, QStyledItemDelegate,
|
||||
Qt, QToolButton, QToolTip, QTreeView, QWidget, pyqtSignal
|
||||
)
|
||||
|
||||
from calibre.gui2 import error_dialog
|
||||
|
|
@ -48,6 +47,8 @@ def __init__(self, *args):
|
|||
self.setContextMenuPolicy(Qt.ContextMenuPolicy.CustomContextMenu)
|
||||
self.customContextMenuRequested.connect(self.context_menu)
|
||||
QApplication.instance().palette_changed.connect(self.set_style_sheet, type=Qt.ConnectionType.QueuedConnection)
|
||||
QScroller.grabGesture(self.viewport(), QScroller.ScrollerGestureType.TouchGesture)
|
||||
self.setVerticalScrollMode(QAbstractItemView.ScrollMode.ScrollPerPixel)
|
||||
|
||||
def setModel(self, model):
|
||||
QTreeView.setModel(self, model)
|
||||
|
|
|
|||
Loading…
Reference in a new issue