After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 773059 - change size check box to 16 px
change size check box to 16 px
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Themes
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-10-16 23:21 UTC by vitalik_p
Modified: 2016-12-24 16:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sceenshot check box before and after (1.63 KB, image/png)
2016-10-16 23:21 UTC, vitalik_p
  Details
test theme (2.31 KB, application/x-compressed-tar)
2016-10-16 23:24 UTC, vitalik_p
  Details
draft patch (2.89 KB, patch)
2016-10-16 23:25 UTC, vitalik_p
none Details | Review

Description vitalik_p 2016-10-16 23:21:54 UTC
Created attachment 337802 [details]
sceenshot check box before and after

after migrate firefox to gtk3, check box is incorrect scaled.
gtk3 Adwaita theme draw check box with 14 px size,
but firefox try scale this size to 16 px.

to resolve this i can set style "-moz-transform: scale(0.875);" to input element checkbox, but this need do for every site.

I understand that this bug is on the side firefox, but this can easy fixed in gtk3.

see attached screenshot.
Comment 1 vitalik_p 2016-10-16 23:24:33 UTC
Created attachment 337803 [details]
test theme

unpack to ~/.themes and switch theme on newtheme1
Comment 2 vitalik_p 2016-10-16 23:25:31 UTC
Created attachment 337804 [details] [review]
draft patch
Comment 3 Lapo Calamandrei 2016-10-17 14:22:40 UTC
Setting min-height and min-width to 16px actually draws a 18px x 18px check (since those acts on the padding-box you'll have to add the border), also making the check graphic blurry since it's 14px x 14px. This really is firefox bug, I don't feel like working around.
Comment 4 Lapo Calamandrei 2016-10-19 17:10:16 UTC
P.S. : don't get me wrong your effort is appreciated, but I don't really see any possible solution here other than fixing the firefox bug :-/
Comment 5 vitalik_p 2016-10-19 19:39:41 UTC
Ok.
I reported a bug to firefox bugzilla.

https://bugzilla.mozilla.org/show_bug.cgi?id=1311499
Comment 6 vitalik_p 2016-12-24 15:34:32 UTC
I found commit https://git.gnome.org/browse/gtk+/commit/gtk/gtkcheckbutton.c?h=gtk-3-22&id=0291978acc10a8cc4bcff8dbc2600703facd3a0e

Deprecated: 3.20: Use CSS min-width and min-height on the indicator node.

How get "min-width" and "min-height" for checkbox with css in c program code?

This code using in firefox:
gtk_widget_style_get(widget,
                         "indicator_size", indicator_size,
                         "indicator_spacing", indicator_spacing,
                         NULL);

Now "indicator_size" statically return 16px.

How to fix this?
Comment 7 Emmanuele Bassi (:ebassi) 2016-12-24 16:09:33 UTC
Hi;

Bugzilla is a bug tracking system not a help forum. You should ask on gtk-app-devel-list@gnome.org or on gtk-list@gnome.org.

Querying the state of the style is usually the indication of some wrong assumption, or some code ported from the old GTK+ 2.x style system.

Please: send an email to the mailing list, describing your use case and some additional code to provide context.

Thanks again.
Comment 8 vitalik_p 2016-12-24 16:23:29 UTC
https://hg.mozilla.org/mozilla-central/file/tip/widget/gtk/gtk2drawing.c

line 1048 and 786

gint
moz_gtk_radio_get_metrics(gint* indicator_size, gint* indicator_spacing)
{
    ensure_radiobutton_widget();

    gtk_widget_style_get (gRadiobuttonWidget,
                          "indicator_size", indicator_size,
                          "indicator_spacing", indicator_spacing,
                          NULL);

    return MOZ_GTK_SUCCESS;
}

...

gtk_paint_check(style, drawable, state_type, shadow_type, cliprect, 
                        gCheckboxWidget, "checkbutton", x, y, width, height);
Comment 9 Emmanuele Bassi (:ebassi) 2016-12-24 16:28:45 UTC
Again, please: use the mailing list.

Additionally, that's GTK 2.x API, whereas this bug relates to the 3.x API series of GTK+.