mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 409773 - "gtk: in small scrolled area handle is not shown" (Make scrollbar thumbs smaller when they exceed the available space) [p=twanno@lycos.nl (Teune van Steeg) r+sr=roc a1.9=schrep]
This commit is contained in:
parent
4776066496
commit
0790141f34
@ -964,12 +964,27 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsIRenderingContext* aContext,
|
|||||||
MozGtkScrollbarMetrics metrics;
|
MozGtkScrollbarMetrics metrics;
|
||||||
moz_gtk_get_scrollbar_metrics(&metrics);
|
moz_gtk_get_scrollbar_metrics(&metrics);
|
||||||
|
|
||||||
|
nsRect rect = aFrame->GetParent()->GetRect();
|
||||||
|
PRInt32 p2a = aFrame->PresContext()->DeviceContext()->
|
||||||
|
AppUnitsPerDevPixel();
|
||||||
|
nsMargin margin;
|
||||||
|
|
||||||
|
/* Get the available space, if that is smaller then the minimum size,
|
||||||
|
* adjust the mininum size to fit into it.
|
||||||
|
* Setting aIsOverridable to PR_TRUE has no effect for thumbs. */
|
||||||
|
aFrame->GetMargin(margin);
|
||||||
|
rect.Deflate(margin);
|
||||||
|
aFrame->GetParent()->GetBorderAndPadding(margin);
|
||||||
|
rect.Deflate(margin);
|
||||||
|
|
||||||
if (aWidgetType == NS_THEME_SCROLLBAR_THUMB_VERTICAL) {
|
if (aWidgetType == NS_THEME_SCROLLBAR_THUMB_VERTICAL) {
|
||||||
aResult->width = metrics.slider_width;
|
aResult->width = metrics.slider_width;
|
||||||
aResult->height = metrics.min_slider_size;
|
aResult->height = PR_MIN(NSAppUnitsToIntPixels(rect.height, p2a),
|
||||||
|
metrics.min_slider_size);
|
||||||
} else {
|
} else {
|
||||||
aResult->width = metrics.min_slider_size;
|
|
||||||
aResult->height = metrics.slider_width;
|
aResult->height = metrics.slider_width;
|
||||||
|
aResult->width = PR_MIN(NSAppUnitsToIntPixels(rect.width, p2a),
|
||||||
|
metrics.min_slider_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
*aIsOverridable = PR_FALSE;
|
*aIsOverridable = PR_FALSE;
|
||||||
|
Loading…
Reference in New Issue
Block a user