mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Visual improvements on the alternate metadata dialogs.
1) Use a pushbutton instead of a toolbutton for config metadata download in Alt1 and Alt2 2) Add a touch of space between the left and right borders of the dialog and the buttons.
This commit is contained in:
parent
012170f1a4
commit
fce83cea05
@ -31,6 +31,7 @@ class MetadataSingleDialogBase(ResizableDialog):
|
|||||||
view_format = pyqtSignal(object, object)
|
view_format = pyqtSignal(object, object)
|
||||||
cc_two_column = tweaks['metadata_single_use_2_cols_for_custom_fields']
|
cc_two_column = tweaks['metadata_single_use_2_cols_for_custom_fields']
|
||||||
one_line_comments_toolbar = False
|
one_line_comments_toolbar = False
|
||||||
|
use_toolbutton_for_config_metadata = True
|
||||||
|
|
||||||
def __init__(self, db, parent=None):
|
def __init__(self, db, parent=None):
|
||||||
self.db = db
|
self.db = db
|
||||||
@ -71,7 +72,9 @@ class MetadataSingleDialogBase(ResizableDialog):
|
|||||||
self.l.addWidget(self.scroll_area)
|
self.l.addWidget(self.scroll_area)
|
||||||
ll = self.button_box_layout = QHBoxLayout()
|
ll = self.button_box_layout = QHBoxLayout()
|
||||||
self.l.addLayout(ll)
|
self.l.addLayout(ll)
|
||||||
|
ll.addSpacing(10)
|
||||||
ll.addWidget(self.button_box)
|
ll.addWidget(self.button_box)
|
||||||
|
ll.addSpacing(10)
|
||||||
|
|
||||||
self.setWindowIcon(QIcon(I('edit_input.png')))
|
self.setWindowIcon(QIcon(I('edit_input.png')))
|
||||||
self.setWindowTitle(_('Edit Metadata'))
|
self.setWindowTitle(_('Edit Metadata'))
|
||||||
@ -191,8 +194,12 @@ class MetadataSingleDialogBase(ResizableDialog):
|
|||||||
font.setBold(True)
|
font.setBold(True)
|
||||||
self.fetch_metadata_button.setFont(font)
|
self.fetch_metadata_button.setFont(font)
|
||||||
|
|
||||||
self.config_metadata_button = QToolButton(self)
|
if self.use_toolbutton_for_config_metadata:
|
||||||
self.config_metadata_button.setIcon(QIcon(I('config.png')))
|
self.config_metadata_button = QToolButton(self)
|
||||||
|
self.config_metadata_button.setIcon(QIcon(I('config.png')))
|
||||||
|
else:
|
||||||
|
self.config_metadata_button = QPushButton(self)
|
||||||
|
self.config_metadata_button.setText(_('Configure metadata downloading'))
|
||||||
self.config_metadata_button.clicked.connect(self.configure_metadata)
|
self.config_metadata_button.clicked.connect(self.configure_metadata)
|
||||||
self.config_metadata_button.setToolTip(
|
self.config_metadata_button.setToolTip(
|
||||||
_('Change how calibre downloads metadata'))
|
_('Change how calibre downloads metadata'))
|
||||||
@ -614,6 +621,7 @@ class MetadataSingleDialogAlt1(MetadataSingleDialogBase): # {{{
|
|||||||
|
|
||||||
cc_two_column = False
|
cc_two_column = False
|
||||||
one_line_comments_toolbar = True
|
one_line_comments_toolbar = True
|
||||||
|
use_toolbutton_for_config_metadata = False
|
||||||
|
|
||||||
on_drag_enter = pyqtSignal()
|
on_drag_enter = pyqtSignal()
|
||||||
|
|
||||||
@ -649,10 +657,8 @@ class MetadataSingleDialogAlt1(MetadataSingleDialogBase): # {{{
|
|||||||
self.tabs[0].l.addWidget(gb, 0, 0, 1, 1)
|
self.tabs[0].l.addWidget(gb, 0, 0, 1, 1)
|
||||||
gb.setLayout(tl)
|
gb.setLayout(tl)
|
||||||
|
|
||||||
self.button_box_layout.insertWidget(0, self.fetch_metadata_button)
|
self.button_box_layout.insertWidget(1, self.fetch_metadata_button)
|
||||||
self.config_metadata_button.setToolButtonStyle(Qt.ToolButtonTextOnly)
|
self.button_box_layout.insertWidget(2, self.config_metadata_button)
|
||||||
self.config_metadata_button.setText(_('Configure metadata downloading'))
|
|
||||||
self.button_box_layout.insertWidget(1, self.config_metadata_button)
|
|
||||||
sto(self.button_box, self.fetch_metadata_button)
|
sto(self.button_box, self.fetch_metadata_button)
|
||||||
sto(self.fetch_metadata_button, self.config_metadata_button)
|
sto(self.fetch_metadata_button, self.config_metadata_button)
|
||||||
sto(self.config_metadata_button, self.title)
|
sto(self.config_metadata_button, self.title)
|
||||||
@ -767,6 +773,7 @@ class MetadataSingleDialogAlt2(MetadataSingleDialogBase): # {{{
|
|||||||
|
|
||||||
cc_two_column = False
|
cc_two_column = False
|
||||||
one_line_comments_toolbar = True
|
one_line_comments_toolbar = True
|
||||||
|
use_toolbutton_for_config_metadata = False
|
||||||
|
|
||||||
def do_layout(self):
|
def do_layout(self):
|
||||||
self.central_widget.clear()
|
self.central_widget.clear()
|
||||||
@ -785,10 +792,8 @@ class MetadataSingleDialogAlt2(MetadataSingleDialogBase): # {{{
|
|||||||
l.addWidget(gb, 0, 0, 1, 1)
|
l.addWidget(gb, 0, 0, 1, 1)
|
||||||
gb.setLayout(tl)
|
gb.setLayout(tl)
|
||||||
|
|
||||||
self.button_box_layout.insertWidget(0, self.fetch_metadata_button)
|
self.button_box_layout.insertWidget(1, self.fetch_metadata_button)
|
||||||
self.config_metadata_button.setToolButtonStyle(Qt.ToolButtonTextOnly)
|
self.button_box_layout.insertWidget(2, self.config_metadata_button)
|
||||||
self.config_metadata_button.setText(_('Configure metadata downloading'))
|
|
||||||
self.button_box_layout.insertWidget(1, self.config_metadata_button)
|
|
||||||
sto(self.button_box, self.fetch_metadata_button)
|
sto(self.button_box, self.fetch_metadata_button)
|
||||||
sto(self.fetch_metadata_button, self.config_metadata_button)
|
sto(self.fetch_metadata_button, self.config_metadata_button)
|
||||||
sto(self.config_metadata_button, self.title)
|
sto(self.config_metadata_button, self.title)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user