add selectors for scroll arrow placement and scroll thumb size. implemented on macos to look at appearance manager. made all platforms return 0 when asking for a selector that doesn't exist, so they are all the same. r=pchen, a=hyatt.

This commit is contained in:
pinkerton%netscape.com 2000-11-30 01:51:14 +00:00
parent 2b03ecf7c9
commit 8f98851ffb
5 changed files with 48 additions and 3 deletions

View File

@ -116,9 +116,23 @@ public:
eMetric_MultiLineCaretWidth, // pixel width of caret in a multi-line field
eMetric_SubmenuDelay, // delay before submenus open
eMetric_MenusCanOverlapOSBar, // can popups overlap menu/task bar?
eMetric_DragFullWindow // show window contents while dragging?
eMetric_DragFullWindow, // show window contents while dragging?
eMetric_ScrollArrowStyle, // position of scroll arrows in a scrollbar
eMetric_ScrollSliderStyle // is scroll thumb proportional or fixed?
} nsMetricID;
enum {
eMetric_ScrollArrowStyleSingle, // single arrow at each end
eMetric_ScrollArrowStyleBothAtBottom, // both arrows at bottom/right, none at top/left
eMetric_ScrollArrowStyleBothAtEachEnd, // both arrows at both ends
eMetric_ScrollArrowStyleBothAtTop // both arrows at top/left, none at bottom/right
};
enum {
eMetric_ScrollThumbStyleNormal,
eMetric_ScrollThumbStyleProportional
};
typedef enum {
eMetricFloat_TextFieldVerticalInsidePadding,
eMetricFloat_TextFieldHorizontalInsidePadding,

View File

@ -310,6 +310,13 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
case eMetric_DragFullWindow:
aMetric = 1;
break;
case eMetric_ScrollArrowStyle:
aMetric = eMetric_ScrollArrowStyleSingle;
break;
case eMetric_ScrollSliderStyle:
aMetric = eMetric_ScrollThumbStyleProportional;
break;
default:
aMetric = 0;
res = NS_ERROR_FAILURE;

View File

@ -354,7 +354,18 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
break;
case eMetric_DragFullWindow:
aMetric = 0;
break;
case eMetric_ScrollArrowStyle:
ThemeScrollBarArrowStyle arrowStyle;
::GetThemeScrollBarArrowStyle ( &arrowStyle );
aMetric = arrowStyle;
break;
case eMetric_ScrollSliderStyle:
ThemeScrollBarThumbStyle thumbStyle;
::GetThemeScrollBarThumbStyle ( &thumbStyle );
aMetric = thumbStyle;
break;
default:
aMetric = 0;
res = NS_ERROR_FAILURE;

View File

@ -285,9 +285,15 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
// we want XUL popups to be able to overlap the task bar.
aMetric = 1;
break;
case eMetric_ScrollArrowStyle:
aMetric = eMetric_ScrollArrowStyleSingle;
break;
case eMetric_ScrollSliderStyle:
aMetric = eMetric_ScrollThumbStyleProportional;
break;
default:
aMetric = -1;
aMetric = 0;
res = NS_ERROR_FAILURE;
}
return res;

View File

@ -337,8 +337,15 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
}
break;
case eMetric_ScrollArrowStyle:
aMetric = eMetric_ScrollArrowStyleSingle;
break;
case eMetric_ScrollSliderStyle:
aMetric = eMetric_ScrollThumbStyleProportional;
break;
default:
aMetric = -1;
aMetric = 0;
res = NS_ERROR_FAILURE;
}
return res;