Closed Bug 1311499 Opened 8 years ago Closed 3 years ago

incorrect scale input checkbox on gtk 3.20

Categories

(Core :: Widget: Gtk, defect, P3)

49 Branch
x86_64
Linux
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: vitalik.perevertun, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: tpi:+)

Attachments

(11 files)

Attached image checkbox.png (deleted) —
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:42.0) Gecko/20100101 Firefox/42.0 Build ID: 20151029151421 Steps to reproduce: open any site with checkbox Linux x86_64 GTK 3.22 Firefox 48,49 Actual results: After migrate firefox to gtk3, checkbox is incorrect scaled. See screenshot "before". More detail info see bug in gnome bugzilla. https://bugzilla.gnome.org/show_bug.cgi?id=773059 Expected results: checkbox must be look like as screenshot "after".
Severity: normal → major
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Component: Untriaged → Widget: Gtk
Product: Firefox → Core
Blocks: gtk-3.22
Summary: incorrect scale input checkbox on gtk3 → incorrect scale input checkbox on gtk 3.22
Priority: -- → P3
Whiteboard: tpi:+
Same with Adwaita 3.20.
Blocks: gtk-3.20
No longer blocks: gtk-3.22
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: incorrect scale input checkbox on gtk 3.22 → incorrect scale input checkbox on gtk 3.20
Attached patch checkbox.patch (deleted) — Splinter Review
patch to firefox-50.1.0.source.tar.xz
I think, i found problem. For checkbox(also radiobox) 'indicator-size' and 'indicator-spacing' is deprecated. See https://developer.gnome.org/gtk3/stable/GtkCheckButton.html#GtkCheckButton--s-indicator-size GtkCheckButton:indicator-size has been deprecated since version 3.20 and should not be used in newly-written code. Use CSS min-width and min-height on the indicator node. GtkCheckButton:indicator-spacing has been deprecated since version 3.20 and should not be used in newly-written code. Use CSS margins of the indicator node, the value of this style property is ignored. in https://hg.mozilla.org/mozilla-central/file/tip/widget/gtk/gtk2drawing.c line 1048 in moz_gtk_toggle_paint() If 'indicator-spacing' set to zero, then problem is gone. (need add line '* {-GtkCheckButton-indicator-spacing: 0;}' to gtk theme style) I prepared a patch that should solve this problem. 1) use min-width/min-height instead of indicator-size 2) use margin width/height instead of indicator-spacing This also fix problem if min-width/min-height have different size (more than 16px) Also need adapt code in widget/gtk/gtk3drawing.cpp I hope it will help in solving this bug.
Attached file test_checkbox.c (deleted) —
test program. compile with this gcc `pkg-config --cflags gtk+-3.0` -o test_checkbox test_checkbox.c `pkg-config --libs gtk+-3.0`
Thanks for the patch, but AFAIK the Gtk2 code is going to be removed soon. We may need such patch for Gtk3.
I just showed the sample solution on the gtk2. I do not know all the dependencies in the code, so i can miss something. > Also need adapt code in widget/gtk/gtk3drawing.cpp The word 'code' i mean 'patch'.
Attached patch remove unused functions (deleted) — Splinter Review
Attached file test1 gtk theme (deleted) —
$ cd .themes/ $ tar -xvf test1.tar.xz select gtk theme 'Test1'
Attached file test gtk program with checkbox (deleted) —
gcc `pkg-config --cflags gtk+-3.0` -o test_checkbox3 test_checkbox3.c `pkg-config --libs gtk+-3.0`
Attached file test_checkbox3 output (deleted) —
patch applied to https://hg.mozilla.org/mozilla-central/ I have not tested the patch, but it should work.
Attached patch ff51_checkbox.patch (deleted) — Splinter Review
tested on firefox 51.0.1.
Attached image fix_checkbox.png (deleted) —
Test1 theme: $ cat ~/.themes/test1/gtk-3.22/gtk.css @import url("resource:///org/gtk/libgtk/theme/Adwaita/gtk-contained.css"); check { border: 2px solid red; padding: 2px; } /* focus can be changed with 'outline' style properties. */

Hello!I have tried to reproduce the issue with firefox 96.0a1, 95.0a1 and 94.0 on Ubuntu 20.04, the issue does not occur in the latest version, continuing with marking this issue as RESOLVED->WORKSFORME.

If this issue is still valid please feel free to reopen this issue.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: