[Webkit-unassigned] [Bug 185854] [GTK] Buttons are drawn too large, text not centered

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 31 05:56:05 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=185854

--- Comment #3 from Carlos Eduardo Ramalho <cadubentzen at gmail.com> ---
The buttons were only being drawn down to the minimum size:

bool RenderThemeGadget::render(cairo_t* cr, const FloatRect& paintRect, FloatRect* contentsRect)
{
    FloatRect rect = paintRect;

    auto margin = marginBox();
    rect.move(margin.left, margin.top);
    rect.contract(margin.left + margin.right, margin.top + margin.bottom);

    auto minSize = minimumSize();
    rect.setWidth(std::max<float>(rect.width(), minSize.width()));
    rect.setHeight(std::max<float>(rect.height(), minSize.height()));

    ...
}

So I created another Gadget children class RenderThemeButtonGadget, which overrides minimumSize(). 

Note: this is exactly like RenderThemeTextFieldGadget, but I created another class to be explicit and if further customization on buttons are needed in the future.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180731/eab62bd8/attachment.html>


More information about the webkit-unassigned mailing list