Closed Bug 399545 Opened 17 years ago Closed 17 years ago

<textbox type="number"> spin buttons look wrong with some GTK themes

Categories

(Core :: Widget: Gtk, defect)

x86
Linux
defect
Not set
trivial

Tracking

()

RESOLVED FIXED
mozilla1.9beta3

People

(Reporter: knopper67, Assigned: twanno)

References

()

Details

(Keywords: polish, regression)

Attachments

(2 files, 3 obsolete files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a9pre) Gecko/2007101104 Minefield/3.0a9pre
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a9pre) Gecko/2007101104 Minefield/3.0a9pre

the widget thats used to select a number in the preferences window doesn't display properly. 

Reproducible: Always

Steps to Reproduce:
1.Open Preferences Dialog
2.Switch to "Privacy"
3.the widget in the "Remember visited pages for the last xxx days" looks like it had surgery.
Actual Results:  
The arrows on the widget are replaced with ugly white boxes. and the widget also looks like it's been cut in half.

Expected Results:  
This wasn't like this in firefox 2. Something must of happened. It shouldn't look like this. It should be fixed before the firefox 3 beta comes out.

In the URL section of the bug is the Url to the image that shows the problem.

I am running Ubuntu Linux 7.04 with the default theme, and the Firefox 3 Oct. 11th Nightly build.
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9a9pre) Gecko/2007101104 Minefield/3.0a9pre

Confirming. I see the problem, too.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: polish, regression
Version: unspecified → Trunk
Can you get a more specific regression range (including hours, at least)?
Flags: blocking-firefox3?
Does the widget you see when loading:
data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?><?xml-stylesheet href="chrome://global/skin/" type="text/css"?><window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"><textbox type="number"/></window>

Show the same problem? Linux only?
@ Gavin
How do i test that code in firefox...I kind of forgot, and also, the problem only exists on Linux.
@Gavin, Okay, figured it out, it also happens on web pages too.
Status: NEW → RESOLVED
Closed: 17 years ago
Flags: blocking-firefox3?
Resolution: --- → DUPLICATE
bug 399813 looks totally different to this one? why was this marked as a duplicate?
(In reply to comment #10)
> bug 399813 looks totally different to this one? why was this marked as a
> duplicate?

The reason it's "deformed" is because the anonymous "input" is too small. That's what the other bug is about.
Bug 399813 is fixed now but this bug here isn't... Gavin Sharp, is it for you? I don't think so, please reopen.
Can anyone else confirm that the URL I gave in comment 5 is still broken, or that they still see this bug?
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Michi, can you attach a screenshot of what you see?
Gavin Sharp, It looks the same as the shots in comment #3 on today's nighly. Using the testcase of comment #5, I also see the problem there. I didn't test that one before, so I don't know if something else changed.
This bug was originally about two problems:
1) input too narrow, which is now fixed by bug 399813
2) <textbox type="number"> spin buttons which look wrong

I'm mutating this bug into the second issue which remains. I reported that issue in bug 398805, but that was a separate issue.

Michael explains the problem in bug 398805 comment 4:

"As for the scroll arrows that appears to be Clearlooks' fault. When I switched
my theme to a Mac OS X style the buttons came out fine. Our code does ask GTK
to draw the native spin buttons but that doesn't seem to be happening on
clearlooks-based themes. The arrow is alright..."

I did some tests with the gtk-engines available on Ubuntu 7.10:
Clearlooks, ClearlooksClassic, Glossy, Human: spin buttons painted white.

the others are ok.


Status: REOPENED → NEW
Component: Preferences → Widget: Gtk
Product: Firefox → Core
QA Contact: preferences → gtk
Summary: widget looks deformed in preferences. → <textbox type="number"> spin buttons look wrong with some GTK themes
After a quick look it seems like this is not the themes fault. You should be drawing a box with the "spinbutton" detail and the correct shadow type over the area of both arrow buttons. Then for each of the arrow buttons a box as is already the case.
Attached patch patch, v1 (obsolete) — Splinter Review
This is adding support for NS_THEME_SPINNER so that we can paint a spinbutton box as mentioned on comment 17.

The transparent background in numberbox.css is to avoid seeing white pixels on the right of the numberbox. Otherwise, it inherits a white background (-moz-Field) from textbox.css in pinstripe.

There is still a minor visual issue: there should be no border rounding on side of the entry touching the spinbuttons.
Assignee: nobody → sylvain.pasche
Status: NEW → ASSIGNED
Attachment #290998 - Flags: review?(roc)
Attached patch patch, v1.1 (obsolete) — Splinter Review
removed an unused parameter
Attachment #290998 - Attachment is obsolete: true
Attachment #291000 - Flags: review?(roc)
Attachment #290998 - Flags: review?(roc)
Hm, how are you drawing the entry? The corner rounding is removed from the entry part of the spinbutton, when the class is GtkSpinButton instead of GtkEntry. So you are probably not passing the gSpinWidget to the entry drawing code.
Comment on attachment 291000 [details] [diff] [review]
patch, v1.1

Don't forget to request superreview for core changes.
Attachment #291000 - Flags: superreview?(roc)
(In reply to comment #21)
> (From update of attachment 291000 [details] [diff] [review])
> Don't forget to request superreview for core changes.

ok, thanks. I'll try to remember.

(In reply to comment #20)
> Hm, how are you drawing the entry? The corner rounding is removed from the
> entry part of the spinbutton, when the class is GtkSpinButton instead of
> GtkEntry. So you are probably not passing the gSpinWidget to the entry drawing
> code.

The issue is that the entry and the spinbuttons are separate XUL elements. It means that the entry is not aware that is should be drawn differently because is sits next to a spinbuttons. I'm not sure what are the options here to solve this. 
Might need to create a new NS_THEME_SPINNER_TEXTFIELD which behaves like NS_THEME_TEXTFIELD on most platforms but differently on GTK+.
Thanks for the suggestion. I'll try to have a look at this when I get some time (either here or in a followup).

Meanwhile, do you still want to review the current patch? With the exception of the minor visual glitch above, it's still a big improvement over the current situation for common engines (Clearlooks, Human, ...).
Attached patch patch, v1.2 (obsolete) — Splinter Review
unbitrot
Attachment #291000 - Attachment is obsolete: true
Attachment #293922 - Flags: superreview?(roc)
Attachment #293922 - Flags: review?(roc)
Attachment #291000 - Flags: superreview?(roc)
Attachment #291000 - Flags: review?(roc)
Sylvain, do you mind if I take this bug from you and create a patch based on your patch with the addition of NS_THEME_SPINNER_TEXTFIELD? 
Sure, no problem. Thanks.
This is the same patch as Sylvain posted, updated to use NS_THEME_SPINNER_TEXTFIELD to allow the entry part of the spinner widget to be styled as such.

This does not include code to change the behaviour of NS_THEME_SPINNER_TEXTFIELD to NS_THEME_TEXTFIELD on other platforms then GTK. Comment 23 seems to suggest that this is needed, but winstripe and pinstripe will still use the current appearance with this patch.
Assignee: sylvain.pasche → twanno
Attachment #293922 - Attachment is obsolete: true
Attachment #293943 - Flags: superreview?(roc)
Attachment #293943 - Flags: review?(roc)
Attachment #293922 - Flags: superreview?(roc)
Attachment #293922 - Flags: review?(roc)
Comment on attachment 293943 [details] [diff] [review]
add GTK theming for spinner and spinner-textfield

treating SPINNER_TEXTFIELD as TEXTFIELD on other platforms would be nice, but we can live without it.
Attachment #293943 - Flags: superreview?(roc)
Attachment #293943 - Flags: superreview+
Attachment #293943 - Flags: review?(roc)
Attachment #293943 - Flags: review+
Comment on attachment 293943 [details] [diff] [review]
add GTK theming for spinner and spinner-textfield

Fix spin buttons with some themes.
Attachment #293943 - Flags: approval1.9?
Comment on attachment 293943 [details] [diff] [review]
add GTK theming for spinner and spinner-textfield

a=beltzner for 1.9
Attachment #293943 - Flags: approval1.9? → approval1.9+
Keywords: checkin-needed
Checking in widget/src/gtk2/gtk2drawing.c;
/cvsroot/mozilla/widget/src/gtk2/gtk2drawing.c,v  <--  gtk2drawing.c
new revision: 1.59; previous revision: 1.58
done
Checking in widget/src/gtk2/gtkdrawing.h;
/cvsroot/mozilla/widget/src/gtk2/gtkdrawing.h,v  <--  gtkdrawing.h
new revision: 1.46; previous revision: 1.45
done
Checking in widget/src/gtk2/nsNativeThemeGTK.cpp;
/cvsroot/mozilla/widget/src/gtk2/nsNativeThemeGTK.cpp,v  <--  nsNativeThemeGTK.cpp
new revision: 1.127; previous revision: 1.126
done
Checking in widget/src/gtk2/nsNativeThemeGTK.cpp;
/cvsroot/mozilla/widget/src/gtk2/nsNativeThemeGTK.cpp,v  <--  nsNativeThemeGTK.cpp
new revision: 1.128; previous revision: 1.127
done
Checking in layout/style/nsCSSKeywordList.h;
/cvsroot/mozilla/layout/style/nsCSSKeywordList.h,v  <--  nsCSSKeywordList.h
new revision: 3.97; previous revision: 3.96
done
Checking in layout/style/nsCSSProps.cpp;
/cvsroot/mozilla/layout/style/nsCSSProps.cpp,v  <--  nsCSSProps.cpp
new revision: 3.157; previous revision: 3.156
done
Checking in toolkit/themes/gnomestripe/global/numberbox.css;
/cvsroot/mozilla/toolkit/themes/gnomestripe/global/numberbox.css,v  <--  numberbox.css
new revision: 1.3; previous revision: 1.2
done
Checking in toolkit/themes/winstripe/global/spinbuttons.css;
/cvsroot/mozilla/toolkit/themes/winstripe/global/spinbuttons.css,v  <--  spinbuttons.css
new revision: 1.5; previous revision: 1.4
done
Checking in gfx/public/nsThemeConstants.h;
/cvsroot/mozilla/gfx/public/nsThemeConstants.h,v  <--  nsThemeConstants.h
new revision: 1.22; previous revision: 1.21
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago17 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M11
Depends on: 409388
I think there is a small bug still... using the Clearlooks theme, the bottom/top lines of the box don't reach to the right side (see screenshot) 
Attached image Small bug
There's also little glitch with focus, but I can't see him now.
Fixed :D ?
(In reply to comment #36)
> There's also little glitch with focus, but I can't see him now.
> Fixed :D ?

Would that be bug 409388?
Maybe :) .
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: