Bug 427256 - "Scroll Control Arrows don't work when moved to the top" (Add missing check for arrow style) [p=mstange@themasta.com (Markus Stange) r=josh sr=roc a1.9=beltzner]

This commit is contained in:
reed%reedloden.com 2008-04-09 06:38:01 +00:00
Родитель b3e6cd690b
Коммит b814d7e98f
3 изменённых файлов: 7 добавлений и 1 удалений

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

@ -52,6 +52,7 @@ protected:
// Apple hasn't defined a constant for scollbars with two arrows on each end, so we'll use this one.
static const int kThemeScrollBarArrowsBoth = 2;
static const int kThemeScrollBarArrowsUpperLeft = 3;
typedef enum {
//theme accent variation colours on Mac OS,

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

@ -547,11 +547,15 @@ NS_IMETHODIMP nsLookAndFeel::GetMetric(const nsMetricID aID, PRInt32 & aMetric)
case kThemeScrollBarArrowsSingle:
aMetric = eMetric_ScrollArrowStyleSingle;
break;
// This constant isn't selectable in System Preferences like the other two (don't know why)
// These constants aren't selectable in System Preferences like the other two (don't know why)
// `defaults write -g AppleScrollBarVariant DoubleBoth` to enable it.
case kThemeScrollBarArrowsBoth:
aMetric = eMetric_ScrollArrowStyleBothAtEachEnd;
break;
// `defaults write -g AppleScrollBarVariant DoubleMin` to enable it.
case kThemeScrollBarArrowsUpperLeft:
aMetric = eMetric_ScrollArrowStyleBothAtTop;
break;
default:
NS_WARNING("Not handling all possible ThemeScrollBarArrowStyle values");
// fall through so we default to BothAtBottom

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

@ -891,6 +891,7 @@ nsNativeThemeCocoa::GetScrollbarDrawInfo(HIThemeTrackDrawInfo& aTdi, nsIFrame *a
// It seems that unless all four buttons are showing, kThemeTopOutsideArrowPressed is the correct constant for
// the up scrollbar button.
aTdi.trackInfo.scrollbar.pressState = ConvertToPressState(buttonStates[0], kThemeTopOutsideArrowPressed) |
ConvertToPressState(buttonStates[1], kThemeBottomOutsideArrowPressed) |
ConvertToPressState(buttonStates[2], kThemeTopOutsideArrowPressed) |
ConvertToPressState(buttonStates[3], kThemeBottomOutsideArrowPressed);
}