зеркало из https://github.com/mozilla/pjs.git
don't put a dropmarker in comboboxes if nsITheme says not to. b=370282 r/sr=roc
This commit is contained in:
Родитель
90cc522fcd
Коммит
53ebf783e5
|
@ -151,6 +151,11 @@ public:
|
|||
virtual PRBool ThemeDrawsFocusForWidget(nsPresContext* aPresContext,
|
||||
nsIFrame* aFrame,
|
||||
PRUint8 aWidgetType)=0;
|
||||
|
||||
/**
|
||||
* Should we insert a dropmarker inside of combobox button?
|
||||
*/
|
||||
virtual PRBool ThemeNeedsComboboxDropmarker()=0;
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsITheme, NS_ITHEME_IID)
|
||||
|
|
|
@ -653,15 +653,21 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
|
|||
|
||||
// Get the width of the vertical scrollbar. That will be the width of the
|
||||
// dropdown button.
|
||||
nsIScrollableFrame* scrollable;
|
||||
CallQueryInterface(mListControlFrame, &scrollable);
|
||||
NS_ASSERTION(scrollable, "List must be a scrollable frame");
|
||||
nsBoxLayoutState bls(PresContext(), aReflowState.rendContext);
|
||||
nscoord buttonWidth = scrollable->GetDesiredScrollbarSizes(&bls).LeftRight();
|
||||
|
||||
if (buttonWidth > aReflowState.ComputedWidth()) {
|
||||
nscoord buttonWidth;
|
||||
const nsStyleDisplay *disp = GetStyleDisplay();
|
||||
if (IsThemed(disp) && !aPresContext->GetTheme()->ThemeNeedsComboboxDropmarker()) {
|
||||
buttonWidth = 0;
|
||||
}
|
||||
else {
|
||||
nsIScrollableFrame* scrollable;
|
||||
CallQueryInterface(mListControlFrame, &scrollable);
|
||||
NS_ASSERTION(scrollable, "List must be a scrollable frame");
|
||||
nsBoxLayoutState bls(PresContext(), aReflowState.rendContext);
|
||||
buttonWidth = scrollable->GetDesiredScrollbarSizes(&bls).LeftRight();
|
||||
if (buttonWidth > aReflowState.ComputedWidth()) {
|
||||
buttonWidth = 0;
|
||||
}
|
||||
}
|
||||
|
||||
mDisplayWidth = aReflowState.ComputedWidth() - buttonWidth;
|
||||
|
||||
|
|
|
@ -84,6 +84,7 @@ public:
|
|||
PRBool ThemeSupportsWidget(nsPresContext* aPresContext, nsIFrame* aFrame, PRUint8 aWidgetType);
|
||||
PRBool WidgetIsContainer(PRUint8 aWidgetType);
|
||||
PRBool ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, PRUint8 aWidgetType);
|
||||
PRBool ThemeNeedsComboboxDropmarker();
|
||||
|
||||
protected:
|
||||
|
||||
|
|
|
@ -1393,3 +1393,9 @@ nsNativeThemeCocoa::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFra
|
|||
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsNativeThemeCocoa::ThemeNeedsComboboxDropmarker()
|
||||
{
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
|
|
@ -1072,3 +1072,9 @@ nsNativeThemeGTK::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame
|
|||
{
|
||||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsNativeThemeGTK::ThemeNeedsComboboxDropmarker()
|
||||
{
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
|
|
@ -90,6 +90,8 @@ public:
|
|||
NS_IMETHOD_(PRBool) ThemeDrawsFocusForWidget(nsPresContext* aPresContext,
|
||||
nsIFrame* aFrame, PRUint8 aWidgetType);
|
||||
|
||||
PRBool ThemeNeedsComboboxDropmarker();
|
||||
|
||||
nsNativeThemeGTK();
|
||||
virtual ~nsNativeThemeGTK();
|
||||
|
||||
|
|
|
@ -1289,6 +1289,12 @@ nsNativeThemeWin::ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame
|
|||
return PR_FALSE;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsNativeThemeWin::ThemeNeedsComboboxDropmarker()
|
||||
{
|
||||
return PR_TRUE;
|
||||
}
|
||||
|
||||
/* Windows 9x/NT/2000/Classic XP Theme Support */
|
||||
|
||||
PRBool
|
||||
|
|
|
@ -83,6 +83,8 @@ public:
|
|||
|
||||
PRBool ThemeDrawsFocusForWidget(nsPresContext* aPresContext, nsIFrame* aFrame, PRUint8 aWidgetType);
|
||||
|
||||
PRBool ThemeNeedsComboboxDropmarker();
|
||||
|
||||
nsNativeThemeWin();
|
||||
virtual ~nsNativeThemeWin();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче