# Form implementation generated from reading ui file '/home/kovid/work/calibre/src/calibre/gui2/preferences/look_feel_tabs/cover_grid.ui'
#
# Created by: PyQt6 UI code generator 6.10.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again.  Do not edit this file unless you know what you are doing.


from PyQt6 import QtCore, QtGui, QtWidgets


class Ui_cover_grid_tab(object):
    def setupUi(self, cover_grid_tab):
        cover_grid_tab.setObjectName("cover_grid_tab")
        cover_grid_tab.resize(458, 483)
        self.tab_5 = QtWidgets.QWidget()
        self.tab_5.setObjectName("tab_5")
        self.formLayout_2 = QtWidgets.QFormLayout(self.tab_5)
        self.formLayout_2.setFieldGrowthPolicy(QtWidgets.QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
        self.formLayout_2.setObjectName("formLayout_2")
        self.label_19 = QtWidgets.QLabel(parent=self.tab_5)
        self.label_19.setWordWrap(True)
        self.label_19.setObjectName("label_19")
        self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.label_19)
        spacerItem = QtWidgets.QSpacerItem(20, 10, QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Fixed)
        self.formLayout_2.setItem(3, QtWidgets.QFormLayout.ItemRole.FieldRole, spacerItem)
        self.opt_cover_grid_show_title = QtWidgets.QCheckBox(parent=self.tab_5)
        self.opt_cover_grid_show_title.setObjectName("opt_cover_grid_show_title")
        self.formLayout_2.setWidget(4, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.opt_cover_grid_show_title)
        self.label_14 = QtWidgets.QLabel(parent=self.tab_5)
        self.label_14.setObjectName("label_14")
        self.formLayout_2.setWidget(5, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_14)
        self.opt_field_under_covers_in_grid = QtWidgets.QComboBox(parent=self.tab_5)
        self.opt_field_under_covers_in_grid.setObjectName("opt_field_under_covers_in_grid")
        self.formLayout_2.setWidget(5, QtWidgets.QFormLayout.ItemRole.FieldRole, self.opt_field_under_covers_in_grid)
        self.label_16 = QtWidgets.QLabel(parent=self.tab_5)
        self.label_16.setObjectName("label_16")
        self.formLayout_2.setWidget(7, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_16)
        self.opt_cover_grid_spacing = QtWidgets.QDoubleSpinBox(parent=self.tab_5)
        self.opt_cover_grid_spacing.setDecimals(2)
        self.opt_cover_grid_spacing.setSingleStep(0.1)
        self.opt_cover_grid_spacing.setObjectName("opt_cover_grid_spacing")
        self.formLayout_2.setWidget(7, QtWidgets.QFormLayout.ItemRole.FieldRole, self.opt_cover_grid_spacing)
        self.cg_background_box = BackgroundConfig(parent=self.tab_5)
        self.cg_background_box.setObjectName("cg_background_box")
        self.formLayout_2.setWidget(8, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.cg_background_box)
        self.groupBox_4 = QtWidgets.QGroupBox(parent=self.tab_5)
        self.groupBox_4.setObjectName("groupBox_4")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox_4)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.cover_grid_larger_cover = QtWidgets.QPushButton(parent=self.groupBox_4)
        icon = QtGui.QIcon.ic("plus.png")
        self.cover_grid_larger_cover.setIcon(icon)
        self.cover_grid_larger_cover.setObjectName("cover_grid_larger_cover")
        self.gridLayout_4.addWidget(self.cover_grid_larger_cover, 1, 2, 1, 1)
        self.cover_grid_smaller_cover = QtWidgets.QPushButton(parent=self.groupBox_4)
        icon1 = QtGui.QIcon.ic("minus.png")
        self.cover_grid_smaller_cover.setIcon(icon1)
        self.cover_grid_smaller_cover.setObjectName("cover_grid_smaller_cover")
        self.gridLayout_4.addWidget(self.cover_grid_smaller_cover, 2, 2, 1, 1)
        self.label_12 = QtWidgets.QLabel(parent=self.groupBox_4)
        self.label_12.setObjectName("label_12")
        self.gridLayout_4.addWidget(self.label_12, 2, 0, 1, 1)
        self.label_11 = QtWidgets.QLabel(parent=self.groupBox_4)
        self.label_11.setObjectName("label_11")
        self.gridLayout_4.addWidget(self.label_11, 1, 0, 1, 1)
        self.opt_cover_grid_height = QtWidgets.QDoubleSpinBox(parent=self.groupBox_4)
        self.opt_cover_grid_height.setDecimals(1)
        self.opt_cover_grid_height.setObjectName("opt_cover_grid_height")
        self.gridLayout_4.addWidget(self.opt_cover_grid_height, 2, 1, 1, 1)
        self.cover_grid_reset_size = QtWidgets.QPushButton(parent=self.groupBox_4)
        self.cover_grid_reset_size.setObjectName("cover_grid_reset_size")
        self.gridLayout_4.addWidget(self.cover_grid_reset_size, 1, 3, 2, 1)
        self.cover_grid_aspect_ratio = QtWidgets.QLabel(parent=self.groupBox_4)
        self.cover_grid_aspect_ratio.setText("")
        self.cover_grid_aspect_ratio.setObjectName("cover_grid_aspect_ratio")
        self.gridLayout_4.addWidget(self.cover_grid_aspect_ratio, 3, 0, 1, 5)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
        self.gridLayout_4.addItem(spacerItem1, 1, 4, 1, 1)
        self.opt_cover_grid_width = QtWidgets.QDoubleSpinBox(parent=self.groupBox_4)
        self.opt_cover_grid_width.setDecimals(1)
        self.opt_cover_grid_width.setObjectName("opt_cover_grid_width")
        self.gridLayout_4.addWidget(self.opt_cover_grid_width, 1, 1, 1, 1)
        self.cover_size_label = QtWidgets.QLabel(parent=self.groupBox_4)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.cover_size_label.sizePolicy().hasHeightForWidth())
        self.cover_size_label.setSizePolicy(sizePolicy)
        self.cover_size_label.setWordWrap(True)
        self.cover_size_label.setObjectName("cover_size_label")
        self.gridLayout_4.addWidget(self.cover_size_label, 0, 0, 1, 5)
        self.formLayout_2.setWidget(11, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.groupBox_4)
        self.label_21 = QtWidgets.QLabel(parent=self.tab_5)
        self.label_21.setObjectName("label_21")
        self.formLayout_2.setWidget(12, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_21)
        self.opt_emblem_size = QtWidgets.QSpinBox(parent=self.tab_5)
        self.opt_emblem_size.setMinimum(16)
        self.opt_emblem_size.setMaximum(1000)
        self.opt_emblem_size.setObjectName("opt_emblem_size")
        self.formLayout_2.setWidget(12, QtWidgets.QFormLayout.ItemRole.FieldRole, self.opt_emblem_size)
        self.label_22 = QtWidgets.QLabel(parent=self.tab_5)
        self.label_22.setObjectName("label_22")
        self.formLayout_2.setWidget(13, QtWidgets.QFormLayout.ItemRole.LabelRole, self.label_22)
        self.opt_emblem_position = QtWidgets.QComboBox(parent=self.tab_5)
        self.opt_emblem_position.setObjectName("opt_emblem_position")
        self.formLayout_2.setWidget(13, QtWidgets.QFormLayout.ItemRole.FieldRole, self.opt_emblem_position)
        self.opt_cover_grid_text_flush_bottom = QtWidgets.QCheckBox(parent=self.tab_5)
        self.opt_cover_grid_text_flush_bottom.setObjectName("opt_cover_grid_text_flush_bottom")
        self.formLayout_2.setWidget(6, QtWidgets.QFormLayout.ItemRole.SpanningRole, self.opt_cover_grid_text_flush_bottom)
        cover_grid_tab.addTab(self.tab_5, "")
        self.opt_cover_grid_icon_rules = EditRulesWidget()
        self.opt_cover_grid_icon_rules.setObjectName("opt_cover_grid_icon_rules")
        cover_grid_tab.addTab(self.opt_cover_grid_icon_rules, "")
        self.config_cache = CoverCacheConfig()
        self.config_cache.setObjectName("config_cache")
        cover_grid_tab.addTab(self.config_cache, "")
        self.label_14.setBuddy(self.opt_field_under_covers_in_grid)
        self.label_16.setBuddy(self.opt_cover_grid_spacing)
        self.label_12.setBuddy(self.opt_cover_grid_height)
        self.label_11.setBuddy(self.opt_cover_grid_width)
        self.label_21.setBuddy(self.opt_emblem_size)
        self.label_22.setBuddy(self.opt_emblem_position)

        self.retranslateUi(cover_grid_tab)
        cover_grid_tab.setCurrentIndex(0)
        self.opt_cover_grid_show_title.toggled['bool'].connect(self.opt_field_under_covers_in_grid.setEnabled) # type: ignore
        QtCore.QMetaObject.connectSlotsByName(cover_grid_tab)

    def retranslateUi(self, cover_grid_tab):

        self.label_19.setText(_("Control the Cover grid view. You can enable this view by clicking the \"Layout\" button in the bottom right corner of the main calibre window."))
        self.opt_cover_grid_show_title.setText(_("Show a &field (such as title) under the covers"))
        self.label_14.setText(_("Field to show &under the covers:"))
        self.label_16.setText(_("Spac&ing between covers:"))
        self.opt_cover_grid_spacing.setToolTip(_("The spacing between covers. A value of zero means calculate automatically based on cover size."))
        self.opt_cover_grid_spacing.setSpecialValueText(_("Automatic"))
        self.opt_cover_grid_spacing.setSuffix(_(" cm"))
        self.cg_background_box.setProperty("title", _("Background for the Cover grid"))
        self.groupBox_4.setTitle(_("Cover size"))
        self.cover_grid_larger_cover.setToolTip(_("Make the covers larger, maintaining current aspect ratio."))
        self.cover_grid_larger_cover.setText(_("&Larger covers"))
        self.cover_grid_smaller_cover.setToolTip(_("Make the covers smaller, maintaining current aspect ratio."))
        self.cover_grid_smaller_cover.setText(_("&Smaller covers"))
        self.label_12.setText(_("Cover &height: "))
        self.label_11.setText(_("Cover &width: "))
        self.opt_cover_grid_height.setToolTip(_("The height of displayed covers.\n"
"A value of zero means calculate automatically."))
        self.opt_cover_grid_height.setSpecialValueText(_("Automatic"))
        self.opt_cover_grid_height.setSuffix(_(" cm"))
        self.cover_grid_reset_size.setToolTip(_("Reset size to automatic"))
        self.cover_grid_reset_size.setText(_("&Reset size"))
        self.opt_cover_grid_width.setToolTip(_("The width of displayed covers.\n"
"A value of zero means calculate automatically."))
        self.opt_cover_grid_width.setSpecialValueText(_("Automatic"))
        self.opt_cover_grid_width.setSuffix(_(" cm"))
        self.cover_size_label.setText(_("By default, calibre chooses a cover size based on your computer\'s screen size. You can change the cover size here:"))
        self.label_21.setText(_("Size of the emblems (if any) shown &next to the covers: "))
        self.opt_emblem_size.setSuffix(_(" px"))
        self.label_22.setText(_("&Location of the emblems shown next to the covers:"))
        self.opt_cover_grid_text_flush_bottom.setToolTip(_("<p>By default, the text is drawn at the bottom of the cell, leaving a gap between text and cover when the cover is small or has a wide aspect ratio. This option instead causes the text to be drawn flush with the bottom of the cover."))
        self.opt_cover_grid_text_flush_bottom.setText(_("Draw text flush with the &bottom of the rendered cover"))
        cover_grid_tab.setTabText(cover_grid_tab.indexOf(self.tab_5), _("&Layout"))
        cover_grid_tab.setTabText(cover_grid_tab.indexOf(self.opt_cover_grid_icon_rules), _("&Emblems"))
        cover_grid_tab.setTabText(cover_grid_tab.indexOf(self.config_cache), _("&Performance"))
from calibre.gui2.preferences.look_feel_tabs import BackgroundConfig, CoverCacheConfig, EditRulesWidget
