зеркало из https://github.com/mozilla/gecko-dev.git
On second thought, only allocate the extra space when determining the element size; still paint the indicator at its "real" size. Not part of the build.
This commit is contained in:
Родитель
2146dda363
Коммит
2dc8e8d0a0
|
@ -172,13 +172,6 @@ moz_gtk_checkbox_get_metrics(gint* indicator_size, gint* indicator_spacing)
|
||||||
if (indicator_spacing)
|
if (indicator_spacing)
|
||||||
*indicator_spacing = klass->indicator_spacing;
|
*indicator_spacing = klass->indicator_spacing;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* hack alert: many themes don't correctly report the indicator size,
|
|
||||||
and have indicators larger than the default 10px indicator_size.
|
|
||||||
So, leave a little slop room. Too bad there's no way to tell
|
|
||||||
if the theme has overridden the default indicator size. */
|
|
||||||
|
|
||||||
*indicator_size = MAX(*indicator_size, 14);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -194,8 +187,8 @@ moz_gtk_checkbox_paint(GdkWindow* window, GtkStyle* style,
|
||||||
|
|
||||||
moz_gtk_checkbox_get_metrics(&indicator_size, NULL);
|
moz_gtk_checkbox_get_metrics(&indicator_size, NULL);
|
||||||
|
|
||||||
/* left justified, vertically centered within the rect */
|
/* centered within the rect */
|
||||||
x = rect->x;
|
x = rect->x + (rect->width - indicator_size) / 2;
|
||||||
y = rect->y + (rect->height - indicator_size) / 2;
|
y = rect->y + (rect->height - indicator_size) / 2;
|
||||||
width = indicator_size;
|
width = indicator_size;
|
||||||
height = indicator_size;
|
height = indicator_size;
|
||||||
|
|
|
@ -519,7 +519,12 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsIRenderingContext* aContext,
|
||||||
|
|
||||||
gint indicator_size, indicator_spacing;
|
gint indicator_size, indicator_spacing;
|
||||||
moz_gtk_checkbox_get_metrics(&indicator_size, &indicator_spacing);
|
moz_gtk_checkbox_get_metrics(&indicator_size, &indicator_spacing);
|
||||||
aResult->width = aResult->height = indicator_size;
|
|
||||||
|
// Hack alert: several themes have indicators larger than the default
|
||||||
|
// 10px size, but don't set the indicator size property. So, leave
|
||||||
|
// a little slop room by making the minimum size 14px.
|
||||||
|
|
||||||
|
aResult->width = aResult->height = MAX(indicator_size, 14);
|
||||||
*aIsOverridable = PR_FALSE;
|
*aIsOverridable = PR_FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -519,7 +519,12 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsIRenderingContext* aContext,
|
||||||
|
|
||||||
gint indicator_size, indicator_spacing;
|
gint indicator_size, indicator_spacing;
|
||||||
moz_gtk_checkbox_get_metrics(&indicator_size, &indicator_spacing);
|
moz_gtk_checkbox_get_metrics(&indicator_size, &indicator_spacing);
|
||||||
aResult->width = aResult->height = indicator_size;
|
|
||||||
|
// Hack alert: several themes have indicators larger than the default
|
||||||
|
// 10px size, but don't set the indicator size property. So, leave
|
||||||
|
// a little slop room by making the minimum size 14px.
|
||||||
|
|
||||||
|
aResult->width = aResult->height = MAX(indicator_size, 14);
|
||||||
*aIsOverridable = PR_FALSE;
|
*aIsOverridable = PR_FALSE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче