Bug 159346 part.2 Repeat scroll even if mouse cursor is outside of the pressed scrollbar button on gtk2 and qt r=enndeakin+roc

This commit is contained in:
Masayuki Nakano 2011-11-18 08:41:35 +09:00
Родитель a4acd0cc70
Коммит 274b7ff43c
9 изменённых файлов: 32 добавлений и 2 удалений

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

@ -216,7 +216,9 @@ void nsScrollbarButtonFrame::Notify()
{
// Since this is only going to get called if we're scrolling a page length
// or a line increment, we will always use smooth scrolling.
if (mCursorOnThis) {
if (mCursorOnThis ||
LookAndFeel::GetInt(
LookAndFeel::eIntID_ScrollbarButtonAutoRepeatBehavior, 0)) {
DoButtonAction(true);
}
}

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

@ -370,7 +370,12 @@ public:
/**
* Return the appropriate WindowsThemeIdentifier for the current theme.
*/
eIntID_WindowsThemeIdentifier
eIntID_WindowsThemeIdentifier,
/**
* 0: scrollbar button repeats to scroll only when cursor is on the button.
* 1: scrollbar button repeats to scroll even if cursor is outside of it.
*/
eIntID_ScrollbarButtonAutoRepeatBehavior
};
/**

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

@ -430,6 +430,10 @@ nsLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
break;
case eIntID_ScrollbarButtonAutoRepeatBehavior:
aResult = 0;
break;
default:
aResult = 0;
rv = NS_ERROR_FAILURE;

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

@ -431,6 +431,9 @@ nsLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
case eIntID_SpellCheckerUnderlineStyle:
aResult = NS_STYLE_TEXT_DECORATION_STYLE_DOTTED;
break;
case eIntID_ScrollbarButtonAutoRepeatBehavior:
aResult = 0;
break;
default:
aResult = 0;
res = NS_ERROR_FAILURE;

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

@ -575,6 +575,9 @@ nsLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
case eIntID_MenuBarDrag:
aResult = sMenuSupportsDrag;
break;
case eIntID_ScrollbarButtonAutoRepeatBehavior:
aResult = 1;
break;
default:
aResult = 0;
res = NS_ERROR_FAILURE;

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

@ -349,6 +349,9 @@ nsLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
case eIntID_SpellCheckerUnderlineStyle:
aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
break;
case eIntID_ScrollbarButtonAutoRepeatBehavior:
aResult = 0;
break;
default:
aResult = 0;

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

@ -408,6 +408,10 @@ nsLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
break;
case eIntID_ScrollbarButtonAutoRepeatBehavior:
aResult = 1;
break;
default:
aResult = 0;
res = NS_ERROR_FAILURE;

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

@ -479,6 +479,9 @@ nsLookAndFeel::GetIntImpl(IntID aID, PRInt32 &aResult)
case eIntID_SpellCheckerUnderlineStyle:
aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
break;
case eIntID_ScrollbarButtonAutoRepeatBehavior:
aResult = 0;
break;
default:
aResult = 0;
res = NS_ERROR_FAILURE;

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

@ -125,6 +125,9 @@ nsLookAndFeelIntPref nsXPLookAndFeel::sIntPrefs[] =
{ "ui.SpellCheckerUnderlineStyle",
eIntID_SpellCheckerUnderlineStyle,
false, 0 },
{ "ui.scrollbarButtonAutoRepeatBehavior",
eIntID_ScrollbarButtonAutoRepeatBehavior,
false, 0 },
};
nsLookAndFeelFloatPref nsXPLookAndFeel::sFloatPrefs[] =