mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use averageCharWidth instead of 'n's
This commit is contained in:
parent
638a017fb1
commit
8ada8a8e6b
@ -404,6 +404,13 @@ metadata_single_use_2_cols_for_custom_fields = True
|
||||
# metadata_edit_custom_column_order = ['#genre', '#mytags', '#etc']
|
||||
metadata_edit_custom_column_order = []
|
||||
|
||||
#: Edit metadata custom column label width
|
||||
# Set the width of custom column labels shown in the edit metadata dialogs.
|
||||
# Labels longer than this length will be elided. The width is computed by
|
||||
# multiplying the average width of characters in the font by the number provided.
|
||||
metadata_edit_bulk_cc_label_width = 25
|
||||
metadata_edit_single_cc_label_width = 12
|
||||
|
||||
#: The number of seconds to wait before sending emails
|
||||
# The number of seconds to wait before sending emails when using a
|
||||
# public email server like GMX/Hotmail/Gmail. Default is: 5 minutes
|
||||
@ -543,9 +550,3 @@ exclude_fields_on_paste = []
|
||||
# Useful if for some reason your operating systems network checking
|
||||
# facilities are not reliable (for example NetworkManager on Linux).
|
||||
skip_network_check = False
|
||||
|
||||
#: Edit metadata custom column label width
|
||||
# Set the width of custom column labels shown in the edit metadata dialogs.
|
||||
# Labels longer than this length will be elided. The length is in 'n'self
|
||||
metadata_edit_bulk_cc_label_length = 25
|
||||
metadata_edit_single_cc_label_length = 10
|
||||
|
@ -788,11 +788,11 @@ def populate_metadata_page(layout, db, book_id, bulk=False, two_column=False, pa
|
||||
if label_width == 0:
|
||||
font_metrics = wij.fontMetrics()
|
||||
if bulk:
|
||||
label_width = font_metrics.width('n' *
|
||||
tweaks['metadata_edit_bulk_cc_label_length'])
|
||||
label_width = (font_metrics.averageCharWidth() *
|
||||
tweaks['metadata_edit_bulk_cc_label_length'])
|
||||
else:
|
||||
label_width = font_metrics.width('n' *
|
||||
tweaks['metadata_edit_single_cc_label_length'])
|
||||
label_width = (font_metrics.averageCharWidth() *
|
||||
tweaks['metadata_edit_single_cc_label_length'])
|
||||
wij.setMaximumWidth(label_width)
|
||||
if c == 0:
|
||||
wij.setSizePolicy(QSizePolicy.Maximum, QSizePolicy.Preferred)
|
||||
|
Loading…
x
Reference in New Issue
Block a user