File: cocoaconfigfocusring.inc

package info (click to toggle)
lazarus 4.0%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 275,760 kB
  • sloc: pascal: 2,341,904; xml: 509,420; makefile: 348,726; cpp: 93,608; sh: 3,387; java: 609; perl: 297; sql: 222; ansic: 137
file content (33 lines) | stat: -rw-r--r-- 1,437 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{%MainUnit cocoaconfig.pas}

{
  default config of Cocoa FocusRing.
  we can modify the default config in the APP.

  on macOS, the FocusRing takes up extra space, which may cause strange
  display in some cases. it may block other controls, or be partially cut off.

  for example, in the Lazarus IDE - About dialog, the FocusRing of the
  Tab of TPageControl is partially cut off.

  by providing a configurable infrastructure, FocusRing can be controlled
  for different control types.

  there are four Strategy:
  1. default      by macOS Default
  2. none         no FoucsRing
  3. required     have FocusRing
  4. border       by LCL Control Border
}

// no need to set TCocoaConfigFocusRing.Strategy.default control
// the controls not in StrategySetting are TCocoaConfigFocusRing.Strategy.default
setStrategy( TCocoaConfigFocusRing.Strategy.none, NSSTR('TCocoaTabControl') );
setStrategy( TCocoaConfigFocusRing.Strategy.none, NSSTR('TCocoaButton') );
setStrategy( TCocoaConfigFocusRing.Strategy.none, NSSTR('TCocoaTextField') );
setStrategy( TCocoaConfigFocusRing.Strategy.none, NSSTR('TCocoaSpinEdit') );
setStrategy( TCocoaConfigFocusRing.Strategy.none, NSSTR('TCocoaComboBox') );
setStrategy( TCocoaConfigFocusRing.Strategy.none, NSSTR('TCocoaTableListView') );
setStrategy( TCocoaConfigFocusRing.Strategy.none, NSSTR('TCocoaCollectionView') );

setStrategy( TCocoaConfigFocusRing.Strategy.border, NSSTR('TCocoaTextView') );