Bug 373696 - style toolbar separators natively p=Simon Bunzli (busy) <zeniko@gmail.com> r=emaijala, sr=neil, a=dsicore

This commit is contained in:
asqueella@gmail.com 2007-08-25 13:30:43 -07:00
Родитель ff20db8b9f
Коммит 37e520ea83
2 изменённых файлов: 27 добавлений и 7 удалений

Просмотреть файл

@ -86,10 +86,13 @@ toolbar[mode="text"] .toolbarbutton-text {
/* ::::: toolbar decorations ::::: */ /* ::::: toolbar decorations ::::: */
toolbarseparator { toolbarseparator {
margin : 2px 0.2em; -moz-appearance: separator;
border-right : 1px solid ThreeDHighlight; border-top: 2px solid transparent;
border-left : 1px solid ThreeDShadow; border-bottom: 2px solid transparent;
width : 2px; border-left: 3px solid transparent;
border-right: 3px solid transparent;
-moz-border-left-colors : transparent transparent ThreeDShadow;
-moz-border-right-colors : transparent transparent ThreeDHighlight;
} }
toolbarspacer { toolbarspacer {

Просмотреть файл

@ -85,6 +85,9 @@
#define TKP_FOCUSED 4 #define TKP_FOCUSED 4
#define TKP_DISABLED 5 #define TKP_DISABLED 5
// Toolbar constants
#define TP_SEPARATOR 5
// Toolbarbutton constants // Toolbarbutton constants
#define TB_CHECKED 5 #define TB_CHECKED 5
#define TB_HOVER_CHECKED 6 #define TB_HOVER_CHECKED 6
@ -461,7 +464,8 @@ nsNativeThemeWin::GetTheme(PRUint8 aWidgetType)
return mRebarTheme; return mRebarTheme;
} }
case NS_THEME_TOOLBAR: case NS_THEME_TOOLBAR:
case NS_THEME_TOOLBAR_BUTTON: { case NS_THEME_TOOLBAR_BUTTON:
case NS_THEME_TOOLBAR_SEPARATOR: {
if (!mToolbarTheme) if (!mToolbarTheme)
mToolbarTheme = openTheme(NULL, L"Toolbar"); mToolbarTheme = openTheme(NULL, L"Toolbar");
return mToolbarTheme; return mToolbarTheme;
@ -734,6 +738,11 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType,
return NS_OK; return NS_OK;
} }
case NS_THEME_TOOLBAR_SEPARATOR: {
aPart = TP_SEPARATOR;
aState = TS_NORMAL;
return NS_OK;
}
case NS_THEME_SCROLLBAR_BUTTON_UP: case NS_THEME_SCROLLBAR_BUTTON_UP:
case NS_THEME_SCROLLBAR_BUTTON_DOWN: case NS_THEME_SCROLLBAR_BUTTON_DOWN:
case NS_THEME_SCROLLBAR_BUTTON_LEFT: case NS_THEME_SCROLLBAR_BUTTON_LEFT:
@ -1312,7 +1321,8 @@ nsNativeThemeWin::GetWidgetBorder(nsIDeviceContext* aContext,
aWidgetType == NS_THEME_SCROLLBAR_TRACK_VERTICAL || aWidgetType == NS_THEME_SCROLLBAR_TRACK_VERTICAL ||
aWidgetType == NS_THEME_MENUITEM || aWidgetType == NS_THEME_CHECKMENUITEM || aWidgetType == NS_THEME_MENUITEM || aWidgetType == NS_THEME_CHECKMENUITEM ||
aWidgetType == NS_THEME_RADIOMENUITEM || aWidgetType == NS_THEME_MENUPOPUP || aWidgetType == NS_THEME_RADIOMENUITEM || aWidgetType == NS_THEME_MENUPOPUP ||
aWidgetType == NS_THEME_MENUIMAGE || aWidgetType == NS_THEME_MENUITEMTEXT) aWidgetType == NS_THEME_MENUIMAGE || aWidgetType == NS_THEME_MENUITEMTEXT ||
aWidgetType == NS_THEME_TOOLBAR_SEPARATOR)
return NS_OK; // Don't worry about it. return NS_OK; // Don't worry about it.
if (!getThemeContentRect) if (!getThemeContentRect)
@ -1513,6 +1523,12 @@ nsNativeThemeWin::GetMinimumWidgetSize(nsIRenderingContext* aContext, nsIFrame*
aWidgetType == NS_THEME_SCALE_THUMB_VERTICAL) { aWidgetType == NS_THEME_SCALE_THUMB_VERTICAL) {
*aIsOverridable = PR_FALSE; *aIsOverridable = PR_FALSE;
} }
else if (aWidgetType == NS_THEME_TOOLBAR_SEPARATOR) {
// that's 2px left margin, 2px right margin and 2px separator
// (the margin is drawn as part of the separator, though)
aResult->width = 6;
return NS_OK;
}
PRInt32 part, state; PRInt32 part, state;
nsresult rv = GetThemePartAndState(aFrame, aWidgetType, part, state); nsresult rv = GetThemePartAndState(aFrame, aWidgetType, part, state);
@ -1563,7 +1579,8 @@ nsNativeThemeWin::WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType,
aWidgetType == NS_THEME_PROGRESSBAR_VERTICAL || aWidgetType == NS_THEME_PROGRESSBAR_VERTICAL ||
aWidgetType == NS_THEME_TOOLTIP || aWidgetType == NS_THEME_TOOLTIP ||
aWidgetType == NS_THEME_TAB_PANELS || aWidgetType == NS_THEME_TAB_PANELS ||
aWidgetType == NS_THEME_TAB_PANEL) { aWidgetType == NS_THEME_TAB_PANEL ||
aWidgetType == NS_THEME_TOOLBAR_SEPARATOR) {
*aShouldRepaint = PR_FALSE; *aShouldRepaint = PR_FALSE;
return NS_OK; return NS_OK;
} }