Bug 407069 - "GTK Menus ignore native vertical padding" [p=ispence@gmail.com (Ian Spence) r+sr=roc a1.9=beltzner]

This commit is contained in:
reed@reedloden.com 2007-12-11 01:19:52 -08:00
parent acd47ee708
commit b0414e42f0
3 changed files with 27 additions and 0 deletions

View File

@ -2115,6 +2115,17 @@ moz_gtk_get_toolbar_separator_width(gint* size)
return MOZ_GTK_SUCCESS;
}
gint
moz_gtk_get_menu_popup_vertical_padding(gint* vertical_padding)
{
ensure_menu_popup_widget();
gtk_widget_style_get(gMenuPopupWidget,
"vertical-padding", vertical_padding,
NULL);
return MOZ_GTK_SUCCESS;
}
gint
moz_gtk_get_expander_size(gint* size)
{

View File

@ -323,6 +323,14 @@ gint moz_gtk_get_toolbar_separator_width(gint* size);
*/
gint moz_gtk_get_expander_size(gint* size);
/**
* Get the vertical padding for menu popups
* vertical_padding: [OUT] the vertical padding for the menu popup
*
* returns: MOZ_GTK_SUCCESS if there was no error, an error code otherwise
*/
gint moz_gtk_get_menu_popup_vertical_padding(gint* vertical_padding);
/**
* Get the desired height of a menu separator
* size: [OUT] the desired height

View File

@ -814,6 +814,14 @@ nsNativeThemeGTK::GetWidgetPadding(nsIDeviceContext* aContext,
return PR_TRUE;
}
if (aWidgetType == NS_THEME_MENUPOPUP) {
gint vertical_padding;
moz_gtk_get_menu_popup_vertical_padding(&vertical_padding);
aResult->SizeTo(0, vertical_padding, 0, vertical_padding);
return PR_TRUE;
}
return PR_FALSE;
}