| 1161 | } |
| 1162 | |
| 1163 | void MacWindow::SetCursor(CursorType type) |
| 1164 | { |
| 1165 | CursorType prev = _cursor; |
| 1166 | if (prev == type) |
| 1167 | return; |
| 1168 | WindowBase::SetCursor(type); |
| 1169 | //if (!_isMouseOver) |
| 1170 | // return; |
| 1171 | NSCursor* cursor = nullptr; |
| 1172 | switch (type) |
| 1173 | { |
| 1174 | case CursorType::Cross: |
| 1175 | cursor = [NSCursor crosshairCursor]; |
| 1176 | break; |
| 1177 | case CursorType::Hand: |
| 1178 | cursor = [NSCursor pointingHandCursor]; |
| 1179 | break; |
| 1180 | case CursorType::IBeam: |
| 1181 | cursor = [NSCursor IBeamCursor]; |
| 1182 | break; |
| 1183 | case CursorType::No: |
| 1184 | cursor = [NSCursor operationNotAllowedCursor]; |
| 1185 | break; |
| 1186 | case CursorType::SizeAll: |
| 1187 | case CursorType::SizeNESW: |
| 1188 | case CursorType::SizeNWSE: |
| 1189 | cursor = [NSCursor resizeUpDownCursor]; |
| 1190 | break; |
| 1191 | case CursorType::SizeNS: |
| 1192 | cursor = [NSCursor resizeUpDownCursor]; |
| 1193 | break; |
| 1194 | case CursorType::SizeWE: |
| 1195 | cursor = [NSCursor resizeLeftRightCursor]; |
| 1196 | break; |
| 1197 | case CursorType::Hidden: |
| 1198 | [NSCursor hide]; |
| 1199 | return; |
| 1200 | default: |
| 1201 | cursor = [NSCursor arrowCursor]; |
| 1202 | break; |
| 1203 | } |
| 1204 | if (cursor) |
| 1205 | { |
| 1206 | if (prev == CursorType::Hidden) |
| 1207 | { |
| 1208 | [NSCursor unhide]; |
| 1209 | } |
| 1210 | [cursor set]; |
| 1211 | } |
| 1212 | } |
| 1213 | |
| 1214 | #endif |
nothing calls this directly
no test coverage detected