Kiln » TortoiseHg » TortoiseHg
Clone URL:  
Pushed to one repository · View In Graph Contained in 1.9, 1.9.1, and 1.9.2

qtlib: add app-global style for expander-like check box

Usage::

cb = QCheckBox('foo')
cb.setProperty('expander', True)

or set 'expander = True' as dynamic property by Qt Designer.

Changeset e3638d935d8d

Parent bb9ff1431552

by Yuya Nishihara

Changes to 2 files · Browse files at e3638d935d8d Showing diff from parent bb9ff1431552 Diff from another changeset...

 
44
45
46
 
 
 
 
 
 
 
47
48
49
 
44
45
46
47
48
49
50
51
52
53
54
55
56
@@ -44,6 +44,13 @@
   thgstylesheet = '* { white-space: pre; font-family: monospace; font-size: 9pt; }'   +"""app-global stylesheet""" +appstylesheet = ''' +/* expander-like check box: checkbox.setProperty('expander', True) */ +QCheckBox[expander="true"]::indicator:unchecked { image: url(:/icons/plus.png); } +QCheckBox[expander="true"]::indicator:checked { image: url(:/icons/minus.png); } +''' +  def configstyles(ui):   # extensions may provide more labels and default effects   for name, ext in extensions.extensions():
 
314
315
316
 
317
318
319
 
314
315
316
317
318
319
320
@@ -314,6 +314,7 @@
  mainapp.setOrganizationDomain('tortoisehg.org')   mainapp.setApplicationVersion(thgversion.version())   qtlib.setup_font_substitutions() + mainapp.setStyleSheet(qtlib.appstylesheet)   try:   dlg = dlgfunc(ui, *args, **opts)   if dlg: