-
Notifications
You must be signed in to change notification settings - Fork 18
t/142: Button tooltip should not look blurry on ldpi screens #280
Conversation
It seems that this fix solves the problem with blurry tooltips. Text on labels is sharp and you can easily read it. Also, I didn't notice any issues caused by this fix. |
My only doubt is that tooltip is not so easy to use. I used to use tooltips that can be easily attached to any element by simple API or |
I'm wondering if tooltip could be a mixin? This mixin could be mixed with any |
Some example? |
The idea with mix( ButtonView, TooltipMixin );
const button = new ButtonView();
button.tooltip = 'tooltip text';
button.tooltipPosition = 's'; Is it possible? |
I don't think so. You need to either
I think neither is going to happen with |
The current code looks ok to me. It's not hard to use the tooltip. You just need to create it in your view, add it as a child of it and set its 2 properties. The button view class exposes few things (the position for instance). But if you don't have such a requirement then adding a tooltip should be 3-4 lines of code. Am I right? |
What we can do, however, is a helper like this: enableViewTooltip( view, tooltipTextAttribute, tooltipPositionAttribute ) {
const tooltipView = new TooltipView();
tooltipView.bind( 'text' ).to( view, tooltipTextAttribute );
tooltipView.bind( 'position' ).to( view, tooltipPositionAttribute );
view.element.appendChild( tooltipView.element );
// Make sure the tooltip will be destroyed along with the view.
view.addChildren( tooltipView );
return tooltipView;
} I'm not sure it would be very useful though as it hard-codes the hierarchy in DOM, etc.. |
It could be a static method of const tooltip = new TooltipView( 'title', 'position' );
this.element.appendChild( tooltip.element );
this.addChildren( tooltip ); |
That's true. It's not so complex :) Code looks fine, tooltips works 👌. I'm merging it. |
Wait :)
This is missing :) |
Anyway, for me current code is fine. |
It's not enough to implement tooltip in JS. It needs to be handled in CSS as well. .ck-button:hover {
@include ck-tooltip_visible();
} |
Suggested merge commit message (convention)
Fix: Button tooltip should not look blurry on ldpi screens. Closes ckeditor/ckeditor5#5302. Closes ckeditor/ckeditor5#5294.
BREAKING CHANGE: The
ck-tooltip__main
,ck-tooltip__arrow
andck-tooltip__elements
mixins are no longer available. CSS classes should be used instead.Additional information