Added support for more widgets.

- Added QCalendarWidget support (undocumented, and went from ugly to
nice).
- Added QSplashScreen support.
- Added tests for more widgets.
main
Alex Huszagh 2021-07-15 16:44:59 -05:00
parent 25ae47bf7c
commit aff2df1e75
13 changed files with 2790 additions and 2597 deletions

BIN
assets/Yellowstone.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 MiB

View File

@ -0,0 +1,5 @@
<svg width="90" height="90">
<g transform="scale(10)">
<path d="m 0.9166972,1.1894593 3.310321,3.3105408 -3.3117417,3.3105408 c -0.157702,0.1577125 -0.157702,0.4134624 0,0.5711749 0.157702,0.1577123 0.4134349,0.1577123 0.5711369,0 l 3.5973102,-3.5961283 0,0 0,0 c 0.1577019,-0.1577124 0.1577019,-0.4134624 0,-0.5711748 L 1.4864134,0.61828437 c -0.157702,-0.1577124 -0.4134349,-0.1577124 -0.5711369,0 -0.1562813,0.1577125 -0.1562813,0.41346243 0.00142,0.57117493 z" fill="^0^"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 498 B

View File

@ -0,0 +1,5 @@
<svg width="90" height="90">
<g transform="scale(10)">
<path d="m 5.0823028,1.1894593 -3.310321,3.3105408 3.3117417,3.3105408 c 0.157702,0.1577125 0.157702,0.4134624 0,0.5711749 -0.157702,0.1577123 -0.4134349,0.1577123 -0.5711369,0 l -3.59731017,-3.5961283 0,0 0,0 c -0.15770191,-0.1577124 -0.15770191,-0.4134624 0,-0.5711748 L 4.5125866,0.61828437 c 0.157702,-0.1577124 0.4134349,-0.1577124 0.5711369,0 0.1562813,0.1577125 0.1562813,0.41346243 -0.00142,0.57117493 z" fill="^0^"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 501 B

View File

@ -78,6 +78,8 @@
<file>dark/checkbox_indeterminate_disabled.svg</file>
<file>dark/checkbox_unchecked.svg</file>
<file>dark/checkbox_unchecked_disabled.svg</file>
<file>dark/calendar_next.svg</file>
<file>dark/calendar_previous.svg</file>
<file>dark/radio_checked.svg</file>
<file>dark/radio_checked_disabled.svg</file>
<file>dark/radio_unchecked.svg</file>

File diff suppressed because it is too large Load Diff

View File

@ -112,6 +112,14 @@ assets = {
'vline': {
'default': ['tree'],
},
'calendar_next': {
'default': ['foreground'],
'hover': ['hover'],
},
'calendar_previous': {
'default': ['foreground'],
'hover': ['hover'],
},
}
def replace(contents, colors, color_map):

5
dark/calendar_next.svg Normal file
View File

@ -0,0 +1,5 @@
<svg width="90" height="90">
<g transform="scale(10)">
<path d="m 0.9166972,1.1894593 3.310321,3.3105408 -3.3117417,3.3105408 c -0.157702,0.1577125 -0.157702,0.4134624 0,0.5711749 0.157702,0.1577123 0.4134349,0.1577123 0.5711369,0 l 3.5973102,-3.5961283 0,0 0,0 c 0.1577019,-0.1577124 0.1577019,-0.4134624 0,-0.5711748 L 1.4864134,0.61828437 c -0.157702,-0.1577124 -0.4134349,-0.1577124 -0.5711369,0 -0.1562813,0.1577125 -0.1562813,0.41346243 0.00142,0.57117493 z" fill="#eff0f1"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 502 B

View File

@ -0,0 +1,5 @@
<svg width="90" height="90">
<g transform="scale(10)">
<path d="m 0.9166972,1.1894593 3.310321,3.3105408 -3.3117417,3.3105408 c -0.157702,0.1577125 -0.157702,0.4134624 0,0.5711749 0.157702,0.1577123 0.4134349,0.1577123 0.5711369,0 l 3.5973102,-3.5961283 0,0 0,0 c 0.1577019,-0.1577124 0.1577019,-0.4134624 0,-0.5711748 L 1.4864134,0.61828437 c -0.157702,-0.1577124 -0.4134349,-0.1577124 -0.5711369,0 -0.1562813,0.1577125 -0.1562813,0.41346243 0.00142,0.57117493 z" fill="#3daee9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 502 B

View File

@ -0,0 +1,5 @@
<svg width="90" height="90">
<g transform="scale(10)">
<path d="m 5.0823028,1.1894593 -3.310321,3.3105408 3.3117417,3.3105408 c 0.157702,0.1577125 0.157702,0.4134624 0,0.5711749 -0.157702,0.1577123 -0.4134349,0.1577123 -0.5711369,0 l -3.59731017,-3.5961283 0,0 0,0 c -0.15770191,-0.1577124 -0.15770191,-0.4134624 0,-0.5711748 L 4.5125866,0.61828437 c 0.157702,-0.1577124 0.4134349,-0.1577124 0.5711369,0 0.1562813,0.1577125 0.1562813,0.41346243 -0.00142,0.57117493 z" fill="#eff0f1"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 505 B

View File

@ -0,0 +1,5 @@
<svg width="90" height="90">
<g transform="scale(10)">
<path d="m 5.0823028,1.1894593 -3.310321,3.3105408 3.3117417,3.3105408 c 0.157702,0.1577125 0.157702,0.4134624 0,0.5711749 -0.157702,0.1577123 -0.4134349,0.1577123 -0.5711369,0 l -3.59731017,-3.5961283 0,0 0,0 c -0.15770191,-0.1577124 -0.15770191,-0.4134624 0,-0.5711748 L 4.5125866,0.61828437 c 0.157702,-0.1577124 0.4134349,-0.1577124 0.5711369,0 0.1562813,0.1577125 0.1562813,0.41346243 -0.00142,0.57117493 z" fill="#3daee9"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 505 B

View File

@ -513,8 +513,8 @@ def main(argv=None):
# run
window.show()
app.exec_()
return app.exec_()
if __name__ == '__main__':
main(sys.argv)
sys.exit(main(sys.argv))

20
test.py
View File

@ -33,6 +33,7 @@ import argparse
import os
import random
import sys
import time
from PyQt5 import QtCore, QtGui, QtWidgets
import breeze_resources
@ -530,6 +531,21 @@ def main(argv=None):
elif args.widget == 'tooltip':
child = QtWidgets.QPushButton('Sample Label')
child.setToolTip('Sample Tooltip')
elif args.widget == 'splashscreen':
# This doesn't work with a central widget.
# Handle the run here.
pixmap = QtGui.QPixmap('assets/Yellowstone.jpg')
size = app.screens()[0].size()
scaled = pixmap.scaled(size, QtCore.Qt.KeepAspectRatio)
splash = QtWidgets.QSplashScreen(scaled)
splash.show()
time.sleep(5)
splash.finish(window)
window.show()
return app.exec()
elif args.widget == 'calendar':
child = QtWidgets.QCalendarWidget(widget)
child.setGridVisible(True)
else:
raise NotImplementedError
@ -549,7 +565,7 @@ def main(argv=None):
# run
window.show()
app.exec_()
return app.exec_()
if __name__ == '__main__':
main(sys.argv)
sys.exit(main(sys.argv))

View File

@ -810,6 +810,7 @@ QAbstractSpinBox
color: #eff0f1;
border-radius: 0.09em;
min-width: 2.6em;
min-height: 1em;
margin: 0.9em;
margin-left: 2.3em;
/* To deal with the padding of the arrows */
@ -887,6 +888,46 @@ QDoubleSpinBox
min-width: 5em;
}
/**
* `QCalendarWidget QAbstractItemView:enabled` sets the color, background
* color, and selection color for active dates in the view.
* `QCalendarWidget QAbstractItemView:enabled` sets the disabled dates.
*/
QCalendarWidget QAbstractItemView:enabled
{
color: #eff0f1;
selection-color: #eff0f1;
selection-background-color: #3daee9;
}
/* Won't take hover events. */
QCalendarWidget QToolButton#qt_calendar_nextmonth
{
border-image: url(:/dark/calendar_next.svg);
width: 0.5em;
height: 0.8em;
icon-size: 0px;
}
QCalendarWidget QToolButton#qt_calendar_prevmonth
{
border-image: url(:/dark/calendar_previous.svg);
width: 0.5em;
height: 0.8em;
icon-size: 0px;
}
QCalendarWidget QSpinBox
{
max-height: 1.5em;
min-width: 3.5em;
margin: 0em;
margin-top: 0.2em;
padding: 0em;
outline: 0em;
padding-left: 0.5em;
}
QLabel
{
border: 0em solid black;