-
Notifications
You must be signed in to change notification settings - Fork 3
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
Beautify Shade labels #26
Conversation
@@ -402,8 +402,8 @@ void WOverview::mouseMoveEvent(QMouseEvent* e) { | |||
// the hotcue rendered on top must be assigned to m_pHoveredMark to show | |||
// the CueMenu. To accomplish this, m_marksToRender is iterated in reverse | |||
// and the loop breaks as soon as m_pHoveredMark is set. | |||
for (auto it = m_marksToRender.crbegin(); it != m_marksToRender.crend(); ++it) { | |||
auto pMark = *it; | |||
for (int i = m_marksToRender.size() - 1; i >= 0 ; --i) { |
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.
Thanks, this is easier to understand anyway.
@@ -14,9 +14,6 @@ | |||
<PlayPosColor>#00FF00</PlayPosColor> | |||
<EndOfTrackColor>#EA0000</EndOfTrackColor> | |||
<PlayedOverlayColor>#60000000</PlayedOverlayColor> | |||
<LabelBackgroundColor>#80000000</LabelBackgroundColor> | |||
<LabelTextColor>#ffffff</LabelTextColor> | |||
<LabelFontSize>9</LabelFontSize> |
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.
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.
If you want to increase the vertical height of the overview to allow a bigger text size, that would be fine with me.
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.
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.
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.
Ok, so I guess we need to set a font as well.
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.
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.
Got it. See the latest commit. Your font seems to have higher charters for Î or such. But this is not relevant here, so we can use the pixel high, which only encounters the height of "Hg"
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.
Why should we assume that the user isn't using tall characters like Î? The label can be any text the user wants.
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.
The user can still use Î, depending to the font it may now hit or exceed the background. This is OK for me since the majority of characters are looking well.
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.
I don't think this is a good idea. The area of the background should cover any possible character.
painter.setBrush(QBrush(backgroundColor)); | ||
painter.drawRoundedRect(0, 0, pixmapRect.width(), pixmapRect.height(), 5.0, 5.0); | ||
painter.drawRoundedRect(0, 0, pixmapRect.width(), pixmapRect.height(), 2.0, 2.0); |
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.
Why was this changed?
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.
src/waveform/waveformmarklabel.cpp
Outdated
// We take the pixelSize for background height, to not consider exotic | ||
// high characters. | ||
pixmapRect.setHeight( | ||
math_max(font.pixelSize() * 1.2, |
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.
As far as I can tell this makes no difference. The label is still hidden in Shade when I hover a hotcue.
2fe49ae
to
651aa27
Compare
OK, I have forced pushed a better solution. m_labelFontSize is now adjusted to be Font Type independent. |
651aa27
to
0800962
Compare
src/widget/woverview.cpp
Outdated
|| pMark->m_label.intersects(m_timeRulerPositionLabel) | ||
|| pMark->m_label.intersects(m_timeRulerDistanceLabel)) { | ||
continue; | ||
} |
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.
Revert this. Labels should not overlap.
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.
ping
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.
It is not the right place to force this here. This code skips to draw the label just because the font is too big or the waveform too small. I agree that the labels should not overlap, but if there is a skin issue it should be rendered anyway to see the overlap.
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.
This is required for normal functionality. It is not to work around bugs in skins. It is normal for the intro/outro cue markers and durations which are rendered on top, and the main cue label which is rendered at vertical center in Tango, to overlap the labels when holding right click.
if there is a skin issue it should be rendered anyway to see the overlap.
I disagree. The label disappearing makes bugs easier to catch.
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.
Some pixel vertical overlap is no issue, rectifies not drawing the lable, especially because the position and distance labels are still painted overlapping. We need here a solution that detects the cue type and hides the labels based on that.
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.
No, we need to not have overlap. Please do not make this any more complicated. It was already working well. I will not merge this without this commit being reverted (or removed with a rebase).
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.
We need a solution for the root issue first: Different font heights on different systems. Will you fix it in your branch?
Than I can finally adjust this code here.
src/widget/woverview.cpp
Outdated
QFont refFont; | ||
refFont.setPixelSize(labelFontSize); | ||
QFontMetricsF fontMetrics(refFont); | ||
m_labelFontSize = labelFontSize / fontMetrics.height() * labelFontSize; |
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.
I don't understand this math. Why not just use fontMetrics.height()
?
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.
The labelFontSize is the high of "Hg" decent() + capitalHight()
My system font is Ubuntu, you have a different font. The ascent() is different.
Here we adjust the m_labelFontSize for an almost equal font independent hight().
I think I need to improve the comment.
Does this produce a good result on you side?
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.
almost equal font independent hight()
This goal does not make sense to me. The actual height of the text as it is rendered is what is needed.
My system font is Ubuntu, you have a different font.
This seems to be the root of the issues. Does Shade not specify a font? If so, let's fix that issue so we get consistent results on both our computers.
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.
almost equal font independent hight()
This goal does not make sense to me. The actual height of the text as it is rendered is what is needed.
Yes, but the actual height is finally kind of random since the skin designer does not know the system font. The skin designer can optimize the looking with the pixel size of its local font. If user uses a font with the same pixel size but taller or lower characters, the labels might overlap. This has happened on your and my system. This math here takes care, that the actual pixel size for the tall font is lower in a way that Üg = Üg and not only Ug = Ug
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.
Does Shade not specify a font?
It does: font-family: "Open Sans";
But as long as we do not install the font it can be any fallback.
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.
How about setting the maximum label height in the skin xml rather then setting the font pixel size?
This way the font can defined by style sheets and if it exceeds the lable the size is adjusted.
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.
I have tried replacing font-family: "Open Sans"
with font-family: Ubuntu
in Shade's style.qss and the label still gets hidden when hovering.
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.
The font used in my case is already Ubuntu. We need to find a way to define the Mixxx shipped font on all systems.
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.
With font-family: Ubuntu
, I am able to increase the LabelFontSize for Shade up to 12. With "Open Sans", 11 is the max size that fits. Either we can decrease the font size to 11 or explicitly specify to use the Ubuntu font for Shade (which we also use for Tango).
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.
Ping. You can either explicitly specify the Ubuntu font or change the font size to 11. I think explicitly specifying the font would be better to ensure a consistent appearance.
@ronso0 do you have any hints why we are seeing different results with the labels being hidden on our different computers? I think if we cannot figure out why this is happening soon we should just stick with a font size of 9 for Shade's labels and get 2.3 beta out already. I don't think increasing the font size by a pixel or two is worth continuing to delay this. |
Not at first glance. I can have a look at it soonish, like tomorrow night. |
Looking on this again, I think it is a conceptual issue to set the font size via skin.xml but the font type via css. Can we remove the size feature form the skin? |
0800962
to
8ab55f4
Compare
Ok, WOverview has the cue labels and the status messages, so it makes sense the set the label font size via skin xml. I have reverted the critical commits and set the font to "Open Sans" for WOverview explicit. Finally it looks nice. @Be-ing, ok for merging? |
Hmm, I can't reproduce these results now. I'm not sure what I did to get them. The maximum font size with Open Sans is 8 and it is 10 with Ubuntu. I tested this on my branch and got the same results. Without specifying a font-family for WOverview in style.qss, the max font size is 9 as it is in my branch. I do not know what default font that is falling back to. |
@Be-ing: Does this mean the issue is fixed for you as well? Merge? |
No, this is still not working. |
Why not? Can you attach a screenshot? |
I stated the fix before: change the font size to 8 with Open Sans or 10 with Ubuntu. |
But why? Here it looks nice now. How does it look at you side? |
The problem is as it has been whole time of this PR. The labels disappear when hovered with the mouse if the text is too big because of the overlap. |
With my latest changes it doesn't happen any more and it is independent from the system font now. |
8ab55f4
to
1745f3c
Compare
1745f3c
to
1e947ab
Compare
Does the 100% version works for you now? |
The font has the same size, but the label is bigger. Maybe it depends on the Qt version. |
Ups, this is a bigger issue, because the overview deck and the mini decks of every skin are suffering the same issue. |
No. As before, the scale factor has no impact on this bug. |
Perhaps? I can't come up with any other explanation for why we are getting different results on our computers. |
Okay, so decrease the font size.
Again, I don't think we should mess with this. This PR for trivial polishing details has been open for 3 weeks now, IMO it was never necessary in the first place, meanwhile we still have no beta release. Can we please just decrease the font size and move on already? |
This PR discovers an other system dependent relationship than we have first discussed. This means the skin designer has no control if the skin works or not. This needs to be fixed before merge. Reducing the font size for the mimum decks a small value makes the info ugly or even unreadable. With 300 % scaling, you will of course be able to read any font size this is not the case with 100 %. For a complete solution, I think we need to dig down the issue first. I have already tried to find differences caused by the Qt Version, but reviewing the Qt git history did not discover anything so far. I think I will add some debug statements, to get it finally. As a quick hack we may limit the lable high to 1/3 of the overview hight. This will at least stop the "disappearing" bug. Cutting some pixels of some exotic characters is a neglegtable issue compared to this. What do you think. |
No it does not. Please keep perspective here. Nobody expects perfection from a beta release. We are already going on a year without a release. We are talking about literally 1 pixel difference in font sizes.
No more hacks. Just reduce the font size and let's get this release out already. |
That would be no issue for me with the Shade main overview. The real issue is the unreliable label background size and the unreadable font size in the overview and preview player. I cannot fix this here, because the label too big issue on your side. |
How about we introduce a boolean skin element to disable showing the times on cue hover for the preview deck and mini decks? |
Good idea. So we need to find only the bug for the different label heights. |
No we don't. Just make the text one pixel size smaller. |
OK |
If you want to look into the differences in rendering later, you can do that. But continuing to hold this up over literally one pixel in font size is IMO absurd. |
…the cue lable disappear on some systems.
No description provided.