-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better widget image scaling support. #426
Conversation
Fixes quantization glitches in SVG rendering.
* Remove pixmap-rendering for rendering SVG with a source rectangle. I added this hack when I was adding SVG support because I didn't have time to figure out the problems it caused for VU meters. * Adds a FIXED and STRETCH_ASPECT DrawMode to Paintable.
* Remove WStatusLight SizeMode as DrawMode is more general and covers its use cases. * Only call QWidget::setFixedSize if the DrawMode is FIXED. * Use FIXED as default DrawMode for most widgets for backwards compatibility. * Switch most Paintable::draw() calls to rectangle targets instead of (x,y) points. This allows the DrawMode to do the right behavior based on the mode.
* Scale WSliderComposed handle to the width or height of the widget. * Update Deere slider handles to look more like classic Deere -- still missing the dropshadow. Raster handles are usually custom-built to be the same width/height as the slider so this should not affect most existing skins.
Paintable::DrawMode SkinContext::selectScaleMode( | ||
const QDomElement& element, | ||
Paintable::DrawMode defaultDrawMode) const { | ||
QString drawModeStr = selectAttributeString( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's our policy on case-sensitivity of xml attributes? I've been hacking things to be case insensitive but I think this is still case-sensitive. I'm happy to choose one or the other but we should be consistent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DrawModeFromString doesn't care -- I prefer to have the XML match the code though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that feels like a leaky abstraction. skin designers shouldn't need to know anything about QT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, DrawMode is a Mixxx thing -- not Qt.
I agree though -- but that ship has sailed... since our new UI system is essentially a giant pile of QLayouts -- you kind of have to know about how Qt does layout .. which means understanding sizemodes, sizeincrements, minimumsize, maximumsize, etc. and how they interact.
did you test this with latenight to see if the crossfader is fixed? |
I couldn't reproduce that issue -- I didn't see any cropping of the crossfader slider or handle in LateNight in the current master. Do you have to change the skin? A better question may be -- why is LateNight's slider handle taller than the slider by 3 pixels? |
because life is not perfect :). I'll check against this branch and fix the pixmap if it's still wrong. (It would be Nice to replace the pngs with svgs but that's low on the list) |
Let's launch and iterate on this one .. I'm sure issues with it will come up but I think the direction is right. |
Better widget image scaling support.
np. I fixed LateNight so the pixmaps lined up. The reason the slider wasn't the same width as the knob was the knob has a drop shadow that makes it off-center. |
The only remaining widget that doesn't have scalemode support and still calls setFixedSize is WSpinny -- which uses QImage's instead of Paintables.