mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Add Kovid's ColorButton to the advanced coloring rule editor
This commit is contained in:
parent
3346f0af4f
commit
cadaab14fe
@ -1137,6 +1137,7 @@ def build_forms(srcdir, info=None):
|
||||
dat = dat.replace('import images_rc', '')
|
||||
dat = dat.replace('from library import', 'from calibre.gui2.library import')
|
||||
dat = dat.replace('from widgets import', 'from calibre.gui2.widgets import')
|
||||
dat = dat.replace('from widgets2 import', 'from calibre.gui2.widgets2 import')
|
||||
dat = dat.replace('from convert.xpath_wizard import',
|
||||
'from calibre.gui2.convert.xpath_wizard import')
|
||||
dat = re.sub(r'^ {4}def _translate\(context, text, disambig\):\s+return.*$', ' pass', dat,
|
||||
|
@ -229,9 +229,6 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
|
||||
for n1, k1 in cols:
|
||||
self.colored_field.addItem(n1, k1)
|
||||
self.colored_field.setCurrentIndex(self.colored_field.findData(color_field))
|
||||
colors = QColor.colorNames()
|
||||
colors.sort()
|
||||
self.color_name.addItems(colors)
|
||||
elif self.iconing:
|
||||
self.icon_layout.setVisible(True)
|
||||
for n1, k1 in cols:
|
||||
@ -362,7 +359,7 @@ class TemplateDialog(QDialog, Ui_TemplateDialog):
|
||||
def color_to_clipboard(self):
|
||||
app = QApplication.instance()
|
||||
c = app.clipboard()
|
||||
c.setText(unicode(self.color_name.currentText()))
|
||||
c.setText(unicode(self.color_name.color))
|
||||
|
||||
def icon_to_clipboard(self):
|
||||
app = QApplication.instance()
|
||||
|
@ -48,7 +48,7 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="color_name">
|
||||
<widget class="ColorButton" name="color_name">
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
@ -246,6 +246,13 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>ColorButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>widgets2.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
|
Loading…
x
Reference in New Issue
Block a user