diff --git a/src/calibre/gui2/preferences/adding.ui b/src/calibre/gui2/preferences/adding.ui index 50c978794f..4255e281f3 100644 --- a/src/calibre/gui2/preferences/adding.ui +++ b/src/calibre/gui2/preferences/adding.ui @@ -15,7 +15,7 @@ - + 2 @@ -47,10 +47,10 @@ - Swap the firstname and lastname of the author. This affects only metadata read from file names. + Swap the first name and last name of the author. This affects only metadata read from file names. - &Swap author firstname and lastname when reading author from filename + &Swap author first name and last name when reading author from filename @@ -445,6 +445,12 @@ that have been explicitly ignored below. QLineEdit
calibre/gui2/widgets.h
+ + ScrollingTabWidget + QTabWidget +
calibre/gui2/widgets2.h
+ 1 +
diff --git a/src/calibre/gui2/preferences/look_feel.ui b/src/calibre/gui2/preferences/look_feel.ui index df98d6123a..15503112bf 100644 --- a/src/calibre/gui2/preferences/look_feel.ui +++ b/src/calibre/gui2/preferences/look_feel.ui @@ -15,7 +15,7 @@ - + 2 @@ -1319,6 +1319,12 @@ column being examined (the left-hand pane) QComboBox
calibre/gui2/complete2.h
+ + ScrollingTabWidget + QTabWidget +
calibre/gui2/widgets2.h
+ 1 +
diff --git a/src/calibre/gui2/widgets2.py b/src/calibre/gui2/widgets2.py index e794eef6f9..2dea5f2f16 100644 --- a/src/calibre/gui2/widgets2.py +++ b/src/calibre/gui2/widgets2.py @@ -8,17 +8,17 @@ import weakref from PyQt5.Qt import ( QAbstractListModel, QApplication, QCheckBox, QColor, QColorDialog, QComboBox, - QDialog, QDialogButtonBox, QFont, QIcon, QKeySequence, QLabel, QLayout, - QModelIndex, QPalette, QPixmap, QPoint, QPushButton, QRect, QSize, QSizePolicy, - QStyle, QStyledItemDelegate, Qt, QTextBrowser, QToolButton, QUndoCommand, QFontInfo, - QUndoStack, QWidget, pyqtSignal + QDialog, QDialogButtonBox, QFont, QFontInfo, QIcon, QKeySequence, QLabel, + QLayout, QModelIndex, QPalette, QPixmap, QPoint, QPushButton, QRect, QScrollArea, + QSize, QSizePolicy, QStyle, QStyledItemDelegate, Qt, QTabWidget, QTextBrowser, + QToolButton, QUndoCommand, QUndoStack, QWidget, pyqtSignal ) from calibre.ebooks.metadata import rating_to_stars -from calibre.utils.config_base import tweaks from calibre.gui2 import gprefs, rating_font from calibre.gui2.complete2 import EditWithComplete, LineEdit from calibre.gui2.widgets import history +from calibre.utils.config_base import tweaks from polyglot.builtins import unicode_type @@ -482,6 +482,30 @@ class HTMLDisplay(QTextBrowser): self.anchor_clicked.emit(qurl) +class ScrollingTabWidget(QTabWidget): + + def __init__(self, parent=None): + QTabWidget.__init__(self, parent) + + def wrap_widget(self, page): + sw = QScrollArea(self) + sw.setWidget(page) + sw.setWidgetResizable(True) + page.setAutoFillBackground(False) + sw.setStyleSheet('QScrollArea { background: transparent }') + return sw + + def indexOf(self, page): + for i in range(self.count()): + t = self.widget(i) + if t.widget() is page: + return i + return -1 + + def addTab(self, page, *args): + return QTabWidget.addTab(self, self.wrap_widget(page), *args) + + if __name__ == '__main__': from calibre.gui2 import Application app = Application([])