зеркало из https://github.com/mozilla/gecko-dev.git
Bug 332314: Menu items are improperly aligned when using iconic menuitems, patch by Kai Liu <kliu@mozilla.kailiu.com>, r=me, r=zeniko, r=roc, a=damon
This commit is contained in:
Родитель
2465d10594
Коммит
4e5991fe09
|
@ -80,15 +80,15 @@ menuitem.spell-suggestion {
|
|||
}
|
||||
|
||||
.menu-text {
|
||||
-moz-padding-start: 1.28em !important;
|
||||
-moz-padding-start: 1.45em !important;
|
||||
-moz-appearance: menuitemtext;
|
||||
}
|
||||
|
||||
.menu-text,
|
||||
.menu-iconic-text {
|
||||
font-weight: inherit;
|
||||
padding-left: 2px;
|
||||
padding-right: 2px;
|
||||
-moz-margin-start: 2px !important;
|
||||
-moz-padding-end: 2px;
|
||||
}
|
||||
|
||||
.menu-description {
|
||||
|
@ -106,7 +106,7 @@ menuitem.spell-suggestion {
|
|||
|
||||
.menu-iconic-left,
|
||||
.menu-right {
|
||||
min-width: 1.28em;
|
||||
min-width: 1.45em;
|
||||
min-height: 1.21em;
|
||||
}
|
||||
|
||||
|
@ -117,11 +117,16 @@ menuitem.spell-suggestion {
|
|||
|
||||
menu.menu-iconic > .menu-iconic-left,
|
||||
menuitem.menuitem-iconic > .menu-iconic-left {
|
||||
/* there's only space for 15px - make room for one more */
|
||||
-moz-margin-start: -1px;
|
||||
-moz-appearance: menuimage;
|
||||
}
|
||||
|
||||
menu.menu-iconic > .menu-iconic-left > .menu-iconic-icon,
|
||||
menuitem.menuitem-iconic > .menu-iconic-left > .menu-iconic-icon {
|
||||
/* reduce icon-text crowding */
|
||||
-moz-margin-start: -1px;
|
||||
-moz-margin-end: 1px;
|
||||
}
|
||||
|
||||
/* ..... menu arrow box ..... */
|
||||
|
||||
.menu-right {
|
||||
|
|
|
@ -1539,7 +1539,7 @@ nsNativeThemeWin::GetWidgetPadding(nsIDeviceContext* aContext,
|
|||
}
|
||||
|
||||
HANDLE theme = GetTheme(aWidgetType);
|
||||
if (!theme && aWidgetType != NS_THEME_MENUITEMTEXT)
|
||||
if (!theme)
|
||||
return PR_FALSE;
|
||||
|
||||
if (aWidgetType == NS_THEME_MENUPOPUP)
|
||||
|
@ -1588,7 +1588,7 @@ nsNativeThemeWin::GetWidgetPadding(nsIDeviceContext* aContext,
|
|||
switch (aWidgetType)
|
||||
{
|
||||
case NS_THEME_MENUIMAGE:
|
||||
right = 9;
|
||||
right = 8;
|
||||
left = 3;
|
||||
break;
|
||||
case NS_THEME_MENUCHECKBOX:
|
||||
|
@ -1597,17 +1597,10 @@ nsNativeThemeWin::GetWidgetPadding(nsIDeviceContext* aContext,
|
|||
left = 0;
|
||||
break;
|
||||
case NS_THEME_MENUITEMTEXT:
|
||||
if (!theme)
|
||||
{
|
||||
left = 18;
|
||||
}
|
||||
else
|
||||
{
|
||||
// There seem to be exactly 4 pixels from the edge
|
||||
// of the gutter to the text
|
||||
SIZE size(GetGutterSize(theme, NULL));
|
||||
left = size.cx + 4;
|
||||
}
|
||||
// There seem to be exactly 4 pixels from the edge
|
||||
// of the gutter to the text: 2px margin (CSS) + 2px padding (here)
|
||||
SIZE size(GetGutterSize(theme, NULL));
|
||||
left = size.cx + 2;
|
||||
break;
|
||||
case NS_THEME_MENUSEPARATOR:
|
||||
{
|
||||
|
@ -1724,12 +1717,11 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame*
|
|||
}
|
||||
break;
|
||||
case NS_THEME_MENUIMAGE:
|
||||
aResult->width = 1;
|
||||
case NS_THEME_MENUCHECKBOX:
|
||||
case NS_THEME_MENURADIO:
|
||||
{
|
||||
SIZE boxSize(GetGutterSize(theme, NULL));
|
||||
aResult->width += boxSize.cx+2;
|
||||
aResult->width = boxSize.cx+2;
|
||||
aResult->height = boxSize.cy;
|
||||
*aIsOverridable = PR_FALSE;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче