diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2020-03-20 23:54:54 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2020-03-21 10:18:45 +0100 |
commit | 7f45cbace44141e22c159dc2216fefd787e14d1f (patch) | |
tree | 63185483bfe3ce091d07c7b8b7573cf5dddd9aa6 | |
parent | 7efc6269a9f13dbe3d7419dfc9c0caa938b5f0b2 (diff) |
tdf#100706: get blink cursor delay for MacOS
See https://bugs.documentfoundation.org/show_bug.cgi?id=100706#c1
Change-Id: I2e471f093ce18c8716108c4ba793c2124e489295
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90850
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
-rw-r--r-- | vcl/inc/osx/salframe.h | 2 | ||||
-rw-r--r-- | vcl/osx/salframe.cxx | 18 |
2 files changed, 18 insertions, 2 deletions
diff --git a/vcl/inc/osx/salframe.h b/vcl/inc/osx/salframe.h index 4e32f806c33e..60b4e82f2540 100644 --- a/vcl/inc/osx/salframe.h +++ b/vcl/inc/osx/salframe.h @@ -95,6 +95,8 @@ public: bool mbGeometryDidChange; + int mnBlinkCursorDelay; + public: /** Constructor diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx index aafafe7a0c6c..b2990d3ede17 100644 --- a/vcl/osx/salframe.cxx +++ b/vcl/osx/salframe.cxx @@ -83,7 +83,8 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, SalFrameStyleFlags salFrameStyle mePointerStyle( PointerStyle::Arrow ), mnTrackingRectTag( 0 ), mrClippingPath( nullptr ), - mnICOptions( InputContextFlags::NONE ) + mnICOptions( InputContextFlags::NONE ), + mnBlinkCursorDelay ( 500 ) { mpParent = dynamic_cast<AquaSalFrame*>(pParent); @@ -91,6 +92,19 @@ AquaSalFrame::AquaSalFrame( SalFrame* pParent, SalFrameStyleFlags salFrameStyle SalData* pSalData = GetSalData(); pSalData->mpInstance->insertFrame( this ); + NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults]; + if (userDefaults != nil) + { + id setting = [userDefaults objectForKey: @"NSTextInsertionPointBlinkPeriodOn"]; + if (setting) + mnBlinkCursorDelay = [setting intValue]; + else + { + setting = [userDefaults objectForKey: @"NSTextInsertionPointBlinkPeriodOff"]; + if (setting) + mnBlinkCursorDelay = [setting intValue]; + } + } } AquaSalFrame::~AquaSalFrame() @@ -1306,7 +1320,7 @@ SAL_WNODEPRECATED_DECLARATIONS_POP aStyleSettings.SetTabTextColor(aControlTextColor); aStyleSettings.SetTabHighlightTextColor(aSelectedControlTextColor); - aStyleSettings.SetCursorBlinkTime( 500 ); + aStyleSettings.SetCursorBlinkTime( mnBlinkCursorDelay ); // no mnemonics on macOS aStyleSettings.SetOptions( aStyleSettings.GetOptions() | StyleSettingsOptions::NoMnemonics ); |