Closed Bug 409773 Opened 18 years ago Closed 18 years ago

gtk: in small scrolled area handle is not shown

Categories

(Core :: Widget: Gtk, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta3

People

(Reporter: u294409, Assigned: twanno)

References

(Depends on 1 open bug)

Details

Attachments

(2 files, 2 obsolete files)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.9b3pre) Gecko/2007122305 Minefield/3.0b3pre Build Identifier: Mozilla/5.0 (X11; U; Linux i686; pl; rv:1.9b3pre) Gecko/2007122305 Minefield/3.0b3pre in small areas scrollbar's handle isn't shown. Reproducible: Always Steps to Reproduce: 1. open eg. mozilla bugzilla 2. click "new bug" link 3. try to scroll "component" area Actual Results: handle is not shown. Expected Results: handle is shown.
I'm not seeing this in bugzilla pages. Do you mean a testcase like this? data:text/html,<select%20size="2"><option>foo</option><option>bar</option><option>baz</option></select>
Attached image screenshot —
WFM on Ubuntu 7.10, Clearlooks Theme. Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9b3pre) Gecko/2007122604 Minefield/3.0b3pre
Component: OS Integration → Widget: Gtk
Product: Firefox → Core
QA Contact: os.integration → gtk
Version: unspecified → Trunk
I was able to reproduce it on that page, depending on my zoom level. Hardy Heron beta, Clearlooks Theme. Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b3pre) Gecko/2008010504 Minefield/3.0b3preMozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b3pre) Gecko/2008010504 Minefield/3.0b3pre Steps to reproduce: 1. Use testcase from Comment #1 2. Zoom out as far as you can (make the content as small as possible) 3. Note that the scrollbars for the select have likely disappeared. 4. Press Ctrl++ until the scrollbar buttons (not the slider, but the background and the up/down buttons) appear. 5. Press Ctrl++ until the scrollbar slider appears. The bug relates to the time between 4 and 5, where the slider doesn't appear, but the buttons do.
But I wasn't using zoom. It was only bugzilla loaded. Bug was theme independent (sometimes still they're not drawn).
I have also seen this. My guess would be that the handle is not drawn when the minimal slider size defined in GTK exceeds the available space. You'll see it if you put this in your gtkrc GtkScrollbar::min_slider_length = 50 Sliders in native GTK apps are adjusted to the available space when that is smaller then min_slider_length.
Status: UNCONFIRMED → NEW
Ever confirmed: true
So, it was Nodoka theme issue?
(In reply to comment #7) > So, it was Nodoka theme issue? > No, that is a strange conclusion to make from what I wrote in my last comment. It _is_ a Mozilla issue, if it was a Nodoka issue I would have resolved this bug Invalid.
ping
Component: Widget: Gtk → Layout
QA Contact: gtk → layout
This mimics what GTK does: just make the thumb the size of the available space when the scrollbar area is too small. AFAIK this would not cause problems on Windows, as thumbs can be very small there (from what I remember). I don't know about Mac, but what I read in other bugs is that a smaller thumb is used when the area gets smaller.
Assignee: nobody → twanno
Status: NEW → ASSIGNED
Attachment #297622 - Flags: superreview?
Attachment #297622 - Flags: review?
Attachment #297622 - Flags: superreview?(bzbarsky)
Attachment #297622 - Flags: superreview?
Attachment #297622 - Flags: review?(bzbarsky)
Attachment #297622 - Flags: review?
(In reply to comment #11) > I don't know about Mac, but what I read in other > bugs is that a smaller thumb is used when the area gets smaller. > Or even better (for this patch): it seems that on Mac the thumb is just not painted when it is smaller then a given size (bug 380185).
I'm probably the wrong reviewer for this code. I'd suggest roc instead, at least if review is desired before May or later...
Attachment #297622 - Flags: superreview?(roc)
Attachment #297622 - Flags: superreview?(bzbarsky)
Attachment #297622 - Flags: review?(roc)
Attachment #297622 - Flags: review?(bzbarsky)
Do you really want to make the thumb one pixel high? Wouldn't it make more sense to just change GetMinimumWidgetSize for THUMB widgets?
(In reply to comment #14) > Do you really want to make the thumb one pixel high? Native GTK thumbs are resized to fill the smallest spaces (I can't see them disappear), so I'd like to have that here too. Or would that cause problems? (from what I tested not visually at least) > ... Wouldn't it make more > sense to just change GetMinimumWidgetSize for THUMB widgets? This patch does that.
Attachment #297622 - Attachment is obsolete: true
Attachment #297622 - Flags: superreview?(roc)
Attachment #297622 - Flags: review?(roc)
Attachment #298620 - Flags: superreview?(roc)
Attachment #298620 - Flags: review?(roc)
I don't get it. Why don't you just return 1?
The thumbs in GTK have a minimum size which can be define in a .gtkrc file. This means that in case of a large scrollable area, the thumb will not get smaller then that value (Clearlooks: 20px, Nodoka git: 40px). Whereas in e.g. Windows the thumb will readily have a size of about 3px in that case. That will happen too if we just return 1: the thumb will get smaller when the page length grows and will eventually reach 1px, while at this point (when the scrollbar is large enough) we want the thumb to be the defined minimum. So we don't want to get smaller when there is enough space in the slider. But when the slider gets too small: smaller then the minimum size defined in the .gtkrc on GTK the thumb gets the same size as the available space. That I try to copy here.
Component: Layout → Widget: Gtk
QA Contact: layout → gtk
OK, so why don't you return PR_TRUE for aIsOverridable and return the metrics for the minimum size?
I have looked into that: Returning PR_TRUE has no use: the max size (returned from nsIBox::AddCSSMaxSize()) is always bigger then the min size at the point that GetMinimumWidgetSize is called for the scrollbar thumb (values are compared in nsBox::BoundsCheck()): I'm guessing that the actual page length or something similar is used for the max size at this point. Only at a point in nsSliderFrame::DoLayout, where I inserted code in my first patch, is the actual maximal size of the thumb (the size of the slider) acquired with GetClientRect(); GetMinimumWidgetSize is called as a result of thumbBox->GetPrefSize() in the same function (nsSliderFrame::DoLayout) BTW. stack: thumbox->GetPrefSize() nsIBox::AddCSSPrefSize() nsBox::GetMinSize(); -> nsIBox::AddCSSMinSize() -> nsITheme->GetMinimumWidgetSize nsBox::GetMaxSize(); -> nsIBox::AddCSSMaxSize() nsBox::BoundsCheck(prefsize, minsize, maxsize)
Comment on attachment 298620 [details] [diff] [review] Make scrollbar thumbs smaller when they exceed the available space OK this makes sense now. Please use PR_MIN instead of MIN.
Attachment #298620 - Flags: superreview?(roc)
Attachment #298620 - Flags: superreview+
Attachment #298620 - Flags: review?(roc)
Attachment #298620 - Flags: review+
Comment on attachment 298620 [details] [diff] [review] Make scrollbar thumbs smaller when they exceed the available space Fix a problem with scrollbar thumbs disappearing.
Attachment #298620 - Flags: approval1.9?
Update of the previous patch: this uses PR_MIN instead of MIN. And adds a comment that setting aIsOverridable to PR_TRUE has no effect.
Attachment #298620 - Attachment is obsolete: true
Attachment #298714 - Flags: approval1.9?
Attachment #298620 - Flags: approval1.9?
Attachment #298714 - Flags: approval1.9? → approval1.9+
Keywords: checkin-needed
Checking in widget/src/gtk2/nsNativeThemeGTK.cpp; /cvsroot/mozilla/widget/src/gtk2/nsNativeThemeGTK.cpp,v <-- nsNativeThemeGTK.cpp new revision: 1.139; previous revision: 1.138 done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9 M11
Depends on: 416192
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: