mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1241008 - Add preference to show or hide selection bars. r=mtseng
This commit is contained in:
parent
ec354714d5
commit
ef59b67162
@ -64,6 +64,8 @@ std::ostream& operator<<(std::ostream& aStream,
|
||||
}
|
||||
#undef AC_PROCESS_ENUM_TO_STREAM
|
||||
|
||||
/*static*/ bool
|
||||
AccessibleCaretManager::sSelectionBarEnabled = false;
|
||||
/*static*/ bool
|
||||
AccessibleCaretManager::sCaretsExtendedVisibility = false;
|
||||
/*static*/ bool
|
||||
@ -83,6 +85,8 @@ AccessibleCaretManager::AccessibleCaretManager(nsIPresShell* aPresShell)
|
||||
|
||||
static bool addedPrefs = false;
|
||||
if (!addedPrefs) {
|
||||
Preferences::AddBoolVarCache(&sSelectionBarEnabled,
|
||||
"layout.accessiblecaret.bar.enabled");
|
||||
Preferences::AddBoolVarCache(&sCaretsExtendedVisibility,
|
||||
"layout.accessiblecaret.extendedvisibility");
|
||||
Preferences::AddBoolVarCache(&sHapticFeedback,
|
||||
@ -319,7 +323,7 @@ AccessibleCaretManager::UpdateCaretsForSelectionMode()
|
||||
int32_t aOffset) -> PositionChangedResult
|
||||
{
|
||||
PositionChangedResult result = aCaret->SetPosition(aFrame, aOffset);
|
||||
aCaret->SetSelectionBarEnabled(true);
|
||||
aCaret->SetSelectionBarEnabled(sSelectionBarEnabled);
|
||||
|
||||
switch (result) {
|
||||
case PositionChangedResult::NotChanged:
|
||||
|
@ -247,6 +247,10 @@ protected:
|
||||
// AppUnit.h.
|
||||
static const int32_t kBoundaryAppUnits = 61;
|
||||
|
||||
// Preference to show selection bars at the two ends in selection mode. The
|
||||
// selection bar is always disabled in cursor mode.
|
||||
static bool sSelectionBarEnabled;
|
||||
|
||||
// AccessibleCaret visibility preference. Used to avoid hiding caret during
|
||||
// (NO_REASON) selection change notifications generated by keyboard IME, and to
|
||||
// maintain a visible ActionBar while carets NotShown during scroll and while
|
||||
|
@ -4918,6 +4918,9 @@ pref("layout.accessiblecaret.height", "36.0");
|
||||
pref("layout.accessiblecaret.margin-left", "-18.5");
|
||||
pref("layout.accessiblecaret.bar.width", "2.0");
|
||||
|
||||
// Show the selection bars at the two ends of the selection highlight.
|
||||
pref("layout.accessiblecaret.bar.enabled", true);
|
||||
|
||||
// Timeout in milliseconds to hide the accessiblecaret under cursor mode while
|
||||
// no one touches it. Set the value to 0 to disable this feature.
|
||||
pref("layout.accessiblecaret.timeout_ms", 3000);
|
||||
|
Loading…
Reference in New Issue
Block a user