Bug 1257811 - set min-height for input widgets. r=karlt

This commit is contained in:
Martin Stransky 2016-04-01 04:43:00 +02:00
parent 98086d4e12
commit a2db24fb14
3 changed files with 34 additions and 0 deletions

View File

@ -3098,6 +3098,27 @@ moz_gtk_get_menu_separator_height(gint *size)
return MOZ_GTK_SUCCESS;
}
void
moz_gtk_get_entry_min_height(gint* height)
{
ensure_entry_widget();
GtkStyleContext* style = gtk_widget_get_style_context(gEntryWidget);
if (!gtk_check_version(3, 20, 0)) {
gtk_style_context_get(style, gtk_style_context_get_state(style),
"min-height", height,
nullptr);
} else {
*height = 0;
}
GtkBorder border;
GtkBorder padding;
gtk_style_context_get_border(style, GTK_STATE_FLAG_NORMAL, &border);
gtk_style_context_get_padding(style, GTK_STATE_FLAG_NORMAL, &padding);
*height += (border.top + border.bottom + padding.top + padding.bottom);
}
void
moz_gtk_get_scale_metrics(GtkOrientation orient, gint* scale_width,
gint* scale_height)

View File

@ -398,6 +398,13 @@ void
moz_gtk_get_arrow_size(GtkThemeWidgetType widgetType,
gint* width, gint* height);
/**
* Get the minimum height of a entry widget
* size: [OUT] the minimum height
*
*/
void moz_gtk_get_entry_min_height(gint* height);
/**
* Get the desired size of a toolbar separator
* size: [OUT] the desired width

View File

@ -1591,6 +1591,12 @@ nsNativeThemeGTK::GetMinimumWidgetSize(nsPresContext* aPresContext,
aResult->height += border.top + border.bottom;
}
break;
case NS_THEME_NUMBER_INPUT:
case NS_THEME_TEXTFIELD:
{
moz_gtk_get_entry_min_height(&aResult->height);
}
break;
case NS_THEME_TOOLBAR_SEPARATOR:
{
gint separator_width;