mirror of
https://github.com/classilla/tenfourfox.git
synced 2024-09-09 04:54:33 +00:00
#417: remove more code from LookAndFeel; tune up a bit
This commit is contained in:
parent
8524974786
commit
0792006231
@ -347,7 +347,7 @@ nsLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult)
|
||||
aResult = 4;
|
||||
break;
|
||||
case eIntID_ScrollArrowStyle:
|
||||
#if(0)
|
||||
#ifdef __LP64__
|
||||
if (nsCocoaFeatures::OnLionOrLater()) {
|
||||
// OS X Lion's scrollbars have no arrows
|
||||
aResult = eScrollArrow_None;
|
||||
@ -374,18 +374,24 @@ nsLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult)
|
||||
aResult = eScrollThumbStyle_Proportional;
|
||||
break;
|
||||
case eIntID_UseOverlayScrollbars:
|
||||
aResult = 0;
|
||||
#ifdef __LP64__
|
||||
if (!mUseOverlayScrollbarsCached) {
|
||||
mUseOverlayScrollbars = SystemWantsOverlayScrollbars() ? 1 : 0;
|
||||
mUseOverlayScrollbarsCached = true;
|
||||
}
|
||||
aResult = mUseOverlayScrollbars;
|
||||
#endif
|
||||
break;
|
||||
case eIntID_AllowOverlayScrollbarsOverlap:
|
||||
aResult = 0;
|
||||
#ifdef __LP64__
|
||||
if (!mAllowOverlayScrollbarsOverlapCached) {
|
||||
mAllowOverlayScrollbarsOverlap = AllowOverlayScrollbarsOverlap() ? 1 : 0;
|
||||
mAllowOverlayScrollbarsOverlapCached = true;
|
||||
}
|
||||
aResult = mAllowOverlayScrollbarsOverlap;
|
||||
#endif
|
||||
break;
|
||||
case eIntID_ScrollbarDisplayOnMouseMove:
|
||||
aResult = 0;
|
||||
@ -474,10 +480,12 @@ nsLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult)
|
||||
break;
|
||||
case eIntID_SwipeAnimationEnabled:
|
||||
aResult = 0;
|
||||
#ifdef __LP64__
|
||||
if ([NSEvent respondsToSelector:@selector(
|
||||
isSwipeTrackingFromScrollEventsEnabled)]) {
|
||||
aResult = [NSEvent isSwipeTrackingFromScrollEventsEnabled] ? 1 : 0;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
case eIntID_ColorPickerAvailable:
|
||||
aResult = 1;
|
||||
|
@ -821,7 +821,7 @@ nsXPLookAndFeel::GetColorImpl(ColorID aID, bool aUseStandinsForNativeColors,
|
||||
nsresult
|
||||
nsXPLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult)
|
||||
{
|
||||
if (!sInitialized)
|
||||
if (MOZ_UNLIKELY(!sInitialized))
|
||||
Init();
|
||||
|
||||
// Set the default values for these prefs. but allow different platforms
|
||||
@ -845,7 +845,7 @@ nsXPLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult)
|
||||
}
|
||||
|
||||
for (unsigned int i = 0; i < ArrayLength(sIntPrefs); ++i) {
|
||||
if (sIntPrefs[i].isSet && (sIntPrefs[i].id == aID)) {
|
||||
if (MOZ_UNLIKELY(sIntPrefs[i].isSet && (sIntPrefs[i].id == aID))) {
|
||||
aResult = sIntPrefs[i].intVar;
|
||||
return NS_OK;
|
||||
}
|
||||
@ -857,11 +857,11 @@ nsXPLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult)
|
||||
nsresult
|
||||
nsXPLookAndFeel::GetFloatImpl(FloatID aID, float &aResult)
|
||||
{
|
||||
if (!sInitialized)
|
||||
if (MOZ_UNLIKELY(!sInitialized))
|
||||
Init();
|
||||
|
||||
for (unsigned int i = 0; i < ArrayLength(sFloatPrefs); ++i) {
|
||||
if (sFloatPrefs[i].isSet && sFloatPrefs[i].id == aID) {
|
||||
if (MOZ_UNLIKELY(sFloatPrefs[i].isSet && sFloatPrefs[i].id == aID)) {
|
||||
aResult = sFloatPrefs[i].floatVar;
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user