/Boxer/BXThemes.m

https://github.com/alunbestor/Boxer · Objective C · 813 lines · 614 code · 191 blank · 8 comment · 5 complexity · 8bc59990f8ec2c58b0347b6994164c71 MD5 · raw file

  1. /*
  2. Copyright (c) 2013 Alun Bestor and contributors. All rights reserved.
  3. This source file is released under the GNU General Public License 2.0. A full copy of this license
  4. can be found in this XCode project at Resources/English.lproj/BoxerHelp/pages/legalese.html, or read
  5. online at [http://www.gnu.org/licenses/gpl-2.0.txt].
  6. */
  7. #import "BXThemes.h"
  8. #import "NSShadow+ADBShadowExtensions.h"
  9. #pragma mark - Control and cell extensions
  10. @implementation NSObject (BXThemableExtensions)
  11. + (NSString *) defaultThemeKey
  12. {
  13. return nil;
  14. }
  15. - (BGTheme *) themeForKey
  16. {
  17. if ([self respondsToSelector: @selector(themeKey)])
  18. return [[BGThemeManager keyedManager] themeForKey: [(id)self themeKey]];
  19. else
  20. return nil;
  21. }
  22. @end
  23. @implementation NSControl (BXThemedControls)
  24. + (NSString *) defaultThemeKey
  25. {
  26. if ([[self cellClass] respondsToSelector: _cmd])
  27. return [[self cellClass] defaultThemeKey];
  28. else
  29. return nil;
  30. }
  31. - (void) setThemeKey: (NSString *)key
  32. {
  33. if ([self.cell respondsToSelector: _cmd])
  34. [(id)self.cell setThemeKey: key];
  35. }
  36. - (NSString *) themeKey
  37. {
  38. if ([self.cell respondsToSelector: _cmd])
  39. return [(id)self.cell themeKey];
  40. else
  41. return nil;
  42. }
  43. @end
  44. #pragma mark - Theme extensions
  45. @implementation BGTheme (BXThemeExtensions)
  46. + (void) registerWithName: (NSString *)name
  47. {
  48. NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
  49. if (!name) name = NSStringFromClass(self);
  50. BGTheme *theme = [[self alloc] init];
  51. [[BGThemeManager keyedManager] setTheme: theme
  52. forKey: name];
  53. [theme release];
  54. [pool drain];
  55. }
  56. - (NSShadow *) sliderTrackInnerShadow
  57. {
  58. return nil;
  59. }
  60. - (NSShadow *) sliderTrackShadow
  61. {
  62. return nil;
  63. }
  64. - (NSShadow *) sliderKnobShadow
  65. {
  66. return self.dropShadow;
  67. }
  68. - (NSColor *) sliderTrackStrokeColor
  69. {
  70. return self.strokeColor;
  71. }
  72. - (NSColor *) disabledSliderTrackStrokeColor
  73. {
  74. return self.disabledStrokeColor;
  75. }
  76. - (NSColor *) sliderKnobStrokeColor
  77. {
  78. return self.strokeColor;
  79. }
  80. - (NSColor *) disabledSliderKnobStrokeColor
  81. {
  82. return self.disabledStrokeColor;
  83. }
  84. - (NSGradient *) imageFill
  85. {
  86. return [[[NSGradient alloc] initWithStartingColor: self.textColor endingColor: self.textColor] autorelease];
  87. }
  88. - (NSShadow *) imageDropShadow { return self.dropShadow; }
  89. - (NSShadow *) imageInnerShadow { return nil; }
  90. - (NSGradient *) selectedImageFill { return self.imageFill; }
  91. - (NSShadow *) selectedImageDropShadow { return self.imageDropShadow; }
  92. - (NSShadow *) selectedImageInnerShadow { return self.imageInnerShadow; }
  93. - (NSGradient *) highlightedImageFill { return self.imageFill; }
  94. - (NSShadow *) highlightedImageDropShadow { return self.imageDropShadow; }
  95. - (NSShadow *) highlightedImageInnerShadow { return self.imageInnerShadow; }
  96. - (NSGradient *) pushedImageFill { return self.highlightedImageFill; }
  97. - (NSShadow *) pushedImageDropShadow { return self.highlightedImageDropShadow; }
  98. - (NSShadow *) pushedImageInnerShadow { return self.highlightedImageInnerShadow; }
  99. - (NSGradient *) disabledImageFill
  100. {
  101. return [[[NSGradient alloc] initWithStartingColor: self.disabledTextColor endingColor: self.disabledTextColor] autorelease];
  102. }
  103. - (NSShadow *) disabledImageDropShadow { return self.imageDropShadow; }
  104. - (NSShadow *) disabledImageInnerShadow { return self.imageInnerShadow; }
  105. @end
  106. #pragma mark - Concrete themes
  107. @implementation BXBaseTheme
  108. @end
  109. @implementation BXBlueprintTheme
  110. + (void) load
  111. {
  112. [self registerWithName: nil];
  113. }
  114. - (NSShadow *) textShadow
  115. {
  116. return [NSShadow shadowWithBlurRadius: 3.0f
  117. offset: NSZeroSize
  118. color: [NSColor colorWithCalibratedWhite: 0 alpha: 0.75f]];
  119. }
  120. - (NSColor *) textColor
  121. {
  122. return [NSColor whiteColor];
  123. }
  124. @end
  125. @implementation BXBlueprintHelpTextTheme
  126. + (void) load
  127. {
  128. [self registerWithName: nil];
  129. }
  130. - (NSColor *) textColor
  131. {
  132. return [NSColor colorWithCalibratedRed: 0.67f green: 0.86f blue: 0.93f alpha: 1.0f];
  133. }
  134. @end
  135. @implementation BXHUDTheme
  136. + (void) load
  137. {
  138. [self registerWithName: nil];
  139. }
  140. - (NSShadow *) dropShadow
  141. {
  142. return [NSShadow shadowWithBlurRadius: 2
  143. offset: NSMakeSize(0, -1)
  144. color: [NSColor colorWithCalibratedWhite: 0 alpha: 0.75f]];
  145. }
  146. - (NSShadow *) textShadow
  147. {
  148. return [NSShadow shadowWithBlurRadius: 2
  149. offset: NSMakeSize(0, -1)
  150. color: [NSColor colorWithCalibratedWhite: 0 alpha: 0.66f]];
  151. }
  152. - (NSColor *) textColor
  153. {
  154. return [NSColor whiteColor];
  155. }
  156. - (NSColor *) disabledTextColor
  157. {
  158. return [NSColor colorWithCalibratedWhite: 1.0f alpha: 0.5f];
  159. }
  160. - (NSGradient *) normalGradient
  161. {
  162. NSColor *baseColor = [NSColor colorWithCalibratedWhite: 0.15f alpha: 0.75f];
  163. NSColor *topColor = [baseColor highlightWithLevel: 0.15f];
  164. NSColor *midColor1 = [baseColor highlightWithLevel: 0.05f];
  165. NSColor *midColor2 = baseColor;
  166. NSColor *bottomColor = [baseColor shadowWithLevel: 0.4f];
  167. NSGradient *gradient = [[NSGradient alloc] initWithColorsAndLocations:
  168. topColor, 0.0f,
  169. midColor1, 0.5f,
  170. midColor2, 0.5f,
  171. bottomColor, 1.0f,
  172. nil];
  173. return [gradient autorelease];
  174. }
  175. - (NSGradient *) highlightGradient
  176. {
  177. NSColor *selectionColor = [[NSColor alternateSelectedControlColor] colorWithAlphaComponent: [self alphaValue]];
  178. NSColor *topColor = [selectionColor highlightWithLevel: 0.25f];
  179. NSColor *midColor1 = [selectionColor highlightWithLevel: 0.1f];
  180. NSColor *midColor2 = selectionColor;
  181. NSColor *bottomColor = [selectionColor shadowWithLevel: 0.4f];
  182. NSGradient *gradient = [[NSGradient alloc] initWithColorsAndLocations:
  183. topColor, 0.0f,
  184. midColor1, 0.5f,
  185. midColor2, 0.5f,
  186. bottomColor, 1.0f,
  187. nil];
  188. return [gradient autorelease];
  189. }
  190. - (NSGradient *) knobColor
  191. {
  192. //Use solid colours to avoid the track showing through
  193. NSColor *baseColor = [NSColor colorWithCalibratedWhite: 0.15f alpha: 1.0f];
  194. NSColor *topColor = [baseColor highlightWithLevel: 0.15f];
  195. NSColor *midColor1 = [baseColor highlightWithLevel: 0.05f];
  196. NSColor *midColor2 = baseColor;
  197. NSColor *bottomColor = [baseColor shadowWithLevel: 0.4f];
  198. NSGradient *gradient = [[NSGradient alloc] initWithColorsAndLocations:
  199. topColor, 0.0f,
  200. midColor1, 0.4f,
  201. midColor2, 0.4f,
  202. bottomColor, 1.0f,
  203. nil];
  204. return [gradient autorelease];
  205. }
  206. - (NSGradient *) highlightKnobColor
  207. {
  208. //Use solid colours to avoid the track showing through
  209. NSColor *selectionColor = [[NSColor alternateSelectedControlColor] shadowWithLevel: 0.25f];
  210. NSColor *topColor = [selectionColor highlightWithLevel: 0.25f];
  211. NSColor *midColor1 = [selectionColor highlightWithLevel: 0.1f];
  212. NSColor *midColor2 = selectionColor;
  213. NSColor *bottomColor = [selectionColor shadowWithLevel: 0.4f];
  214. NSGradient *gradient = [[NSGradient alloc] initWithColorsAndLocations:
  215. topColor, 0.0f,
  216. midColor1, 0.4f,
  217. midColor2, 0.4f,
  218. bottomColor, 1.0f,
  219. nil];
  220. return [gradient autorelease];
  221. }
  222. - (NSColor *) sliderTrackColor
  223. {
  224. return [NSColor colorWithCalibratedWhite: 0 alpha: 0.1f];
  225. }
  226. - (NSGradient *) pushedGradient
  227. {
  228. return [self highlightGradient];
  229. }
  230. - (NSGradient *) highlightComplexGradient
  231. {
  232. return [self highlightGradient];
  233. }
  234. - (NSGradient *) pushedComplexGradient
  235. {
  236. return [self pushedGradient];
  237. }
  238. - (NSShadow *) focusRing
  239. {
  240. return [NSShadow shadowWithBlurRadius: 2.0f
  241. offset: NSZeroSize
  242. color: [NSColor keyboardFocusIndicatorColor]];
  243. }
  244. - (NSColor *) strokeColor
  245. {
  246. return [NSColor colorWithCalibratedRed: 0.8f green: 0.85f blue: 0.9f alpha: 0.33f];
  247. }
  248. @end
  249. @implementation BXIndentedTheme
  250. + (void) load
  251. {
  252. [self registerWithName: nil];
  253. }
  254. - (NSShadow *) textShadow { return self.dropShadow; }
  255. - (NSShadow *) dropShadow
  256. {
  257. return [NSShadow shadowWithBlurRadius: 1.0f
  258. offset: NSMakeSize(0, -1.0f)
  259. color: [NSColor colorWithCalibratedWhite: 1 alpha: 1.0f]];
  260. }
  261. - (NSColor *) textColor
  262. {
  263. return [NSColor colorWithCalibratedWhite: 0.25f alpha: 1];
  264. }
  265. - (NSColor *) disabledTextColor
  266. {
  267. return [NSColor grayColor];
  268. }
  269. - (NSColor *) strokeColor
  270. {
  271. return [NSColor colorWithCalibratedWhite: 0 alpha: 0.25f];
  272. }
  273. - (NSColor *) disabledStrokeColor
  274. {
  275. return [NSColor colorWithCalibratedWhite: 0 alpha: 0.1f];
  276. }
  277. - (NSGradient *) normalGradient
  278. {
  279. NSColor *baseColor = [NSColor lightGrayColor];
  280. NSColor *topColor = [baseColor highlightWithLevel: 0.2f];
  281. NSColor *midColor = baseColor;
  282. NSColor *bottomColor = [baseColor shadowWithLevel: 0.2f];
  283. NSGradient *gradient = [[NSGradient alloc] initWithColorsAndLocations:
  284. topColor, 0.0f,
  285. midColor, 0.5f,
  286. bottomColor, 1.0f,
  287. nil];
  288. return [gradient autorelease];
  289. }
  290. - (NSGradient *) normalComplexGradient
  291. {
  292. return [self normalGradient];
  293. }
  294. - (NSGradient *) highlightGradient
  295. {
  296. NSColor *selectionColor = [[NSColor alternateSelectedControlColor] colorWithAlphaComponent: 1];
  297. NSColor *topColor = [selectionColor highlightWithLevel: 0.3f];
  298. NSColor *midColor1 = [selectionColor highlightWithLevel: 0.05f];
  299. NSColor *midColor2 = selectionColor;
  300. NSColor *bottomColor = [selectionColor shadowWithLevel: 0.1f];
  301. NSGradient *gradient = [[NSGradient alloc] initWithColorsAndLocations:
  302. topColor, 0.0f,
  303. midColor1, 0.5f,
  304. midColor2, 0.5f,
  305. bottomColor, 1.0f,
  306. nil];
  307. return [gradient autorelease];
  308. }
  309. - (NSGradient *) pushedGradient
  310. {
  311. return [self highlightGradient];
  312. }
  313. - (NSGradient *) highlightComplexGradient
  314. {
  315. return [self highlightGradient];
  316. }
  317. - (NSGradient *) pushedComplexGradient
  318. {
  319. return [self pushedGradient];
  320. }
  321. - (NSGradient *) knobColor
  322. {
  323. NSColor *baseColor = [NSColor colorWithCalibratedWhite: 0.75f alpha: 1.0f];
  324. NSColor *topColor = [baseColor highlightWithLevel: 0.3f];
  325. NSColor *midColor = baseColor;
  326. NSColor *bottomColor = [baseColor shadowWithLevel: 0.1f];
  327. NSGradient *gradient = [[NSGradient alloc] initWithColorsAndLocations:
  328. topColor, 0.0f,
  329. midColor, 0.5f,
  330. bottomColor, 1.0f,
  331. nil];
  332. return [gradient autorelease];
  333. }
  334. - (NSGradient *) disabledKnobColor
  335. {
  336. NSColor *baseColor = [NSColor colorWithCalibratedWhite: 0.9f alpha: 1.0f];
  337. NSColor *topColor = [baseColor highlightWithLevel: 0.3f];
  338. NSColor *midColor = baseColor;
  339. NSColor *bottomColor = [baseColor shadowWithLevel: 0.1f];
  340. NSGradient *gradient = [[NSGradient alloc] initWithColorsAndLocations:
  341. topColor, 0.0f,
  342. midColor, 0.5f,
  343. bottomColor, 1.0f,
  344. nil];
  345. return [gradient autorelease];
  346. }
  347. - (NSGradient *) highlightKnobColor
  348. {
  349. return self.highlightGradient;
  350. }
  351. - (NSColor *) sliderTrackColor
  352. {
  353. return [NSColor colorWithCalibratedWhite: 0 alpha: 0.2f];
  354. }
  355. - (NSColor *) disabledSliderTrackColor
  356. {
  357. return [NSColor colorWithCalibratedWhite: 0 alpha: 0.1f];
  358. }
  359. - (NSShadow *) sliderTrackShadow
  360. {
  361. return self.dropShadow;
  362. }
  363. - (NSShadow *) sliderTrackInnerShadow
  364. {
  365. return [NSShadow shadowWithBlurRadius: 3.0f
  366. offset: NSMakeSize(0, -1.0f)
  367. color: [NSColor colorWithCalibratedWhite: 0.0f alpha: 0.5f]];
  368. }
  369. - (NSShadow *) sliderKnobShadow
  370. {
  371. return [NSShadow shadowWithBlurRadius: 2.0f
  372. offset: NSMakeSize(0, -1.0f)
  373. color: [NSColor colorWithCalibratedWhite: 0.0f alpha: 0.5f]];
  374. }
  375. - (NSColor *) sliderKnobStrokeColor
  376. {
  377. return [NSColor colorWithCalibratedWhite: 0.0f alpha: 0.4f];
  378. }
  379. - (NSColor *) disabledSliderKnobStrokeColor
  380. {
  381. return [NSColor colorWithCalibratedWhite: 0.0f alpha: 0.25f];
  382. }
  383. - (NSGradient *) imageFill
  384. {
  385. return [[[NSGradient alloc] initWithStartingColor: [NSColor colorWithCalibratedWhite: 0 alpha: 0.33]
  386. endingColor: [NSColor colorWithCalibratedWhite: 0 alpha: 0.10]] autorelease];
  387. }
  388. - (NSShadow *) imageDropShadow
  389. {
  390. return [NSShadow shadowWithBlurRadius: 1.0
  391. offset: NSMakeSize(0, -1)
  392. color: [NSColor colorWithCalibratedWhite: 1 alpha: 1]];
  393. }
  394. - (NSShadow *) imageInnerShadow
  395. {
  396. return [NSShadow shadowWithBlurRadius: 1.25
  397. offset: NSMakeSize(0, -0.25)
  398. color: [NSColor colorWithCalibratedWhite: 0 alpha: 0.5]];
  399. }
  400. - (NSGradient *) disabledImageFill
  401. {
  402. return [[[NSGradient alloc] initWithStartingColor: [NSColor colorWithCalibratedWhite: 0 alpha: 0.10]
  403. endingColor: [NSColor colorWithCalibratedWhite: 0 alpha: 0.05]] autorelease];
  404. }
  405. - (NSShadow *) disabledImageInnerShadow
  406. {
  407. return [NSShadow shadowWithBlurRadius: 1.25
  408. offset: NSMakeSize(0, -0.25)
  409. color: [NSColor colorWithCalibratedWhite: 0 alpha: 0.25]];
  410. }
  411. - (NSGradient *) highlightedImageFill
  412. {
  413. return [[[NSGradient alloc] initWithStartingColor: [NSColor colorWithCalibratedWhite: 0 alpha: 0.5]
  414. endingColor: [NSColor colorWithCalibratedWhite: 0 alpha: 0.15]] autorelease];
  415. }
  416. - (NSShadow *) highlightedImageInnerShadow
  417. {
  418. return [NSShadow shadowWithBlurRadius: 1.25
  419. offset: NSMakeSize(0, -0.25)
  420. color: [NSColor colorWithCalibratedWhite: 0 alpha: 0.6]];
  421. }
  422. @end
  423. @implementation BXIndentedHelpTextTheme
  424. + (void) load
  425. {
  426. [self registerWithName: nil];
  427. }
  428. - (NSColor *) textColor
  429. {
  430. return [NSColor darkGrayColor];
  431. }
  432. @end
  433. @implementation BXInspectorListControlTheme
  434. + (void) load
  435. {
  436. [self registerWithName: nil];
  437. }
  438. @end
  439. @implementation BXInspectorListControlSelectionTheme
  440. + (void) load
  441. {
  442. [self registerWithName: nil];
  443. }
  444. - (NSGradient *) imageFill
  445. {
  446. return [[[NSGradient alloc] initWithStartingColor: [NSColor colorWithCalibratedWhite: 1.0 alpha: 0.75]
  447. endingColor: [NSColor colorWithCalibratedWhite: 1.0 alpha: 0.50]] autorelease];
  448. }
  449. - (NSShadow *) imageDropShadow
  450. {
  451. return nil;
  452. }
  453. - (NSGradient *) highlightedImageFill
  454. {
  455. return [[[NSGradient alloc] initWithStartingColor: [NSColor colorWithCalibratedWhite: 1.0 alpha: 0.90]
  456. endingColor: [NSColor colorWithCalibratedWhite: 1.0 alpha: 0.80]] autorelease];
  457. }
  458. - (NSShadow *) highlightedImageDropShadow
  459. {
  460. return [NSShadow shadowWithBlurRadius: 1.0
  461. offset: NSMakeSize(0, -1)
  462. color: [NSColor colorWithCalibratedWhite: 0 alpha: 0.5]];
  463. }
  464. - (NSGradient *) pushedImageFill
  465. {
  466. return [[[NSGradient alloc] initWithStartingColor: [NSColor colorWithCalibratedWhite: 1.0 alpha: 1.00]
  467. endingColor: [NSColor colorWithCalibratedWhite: 1.0 alpha: 0.90]] autorelease];
  468. }
  469. @end
  470. @implementation BXInspectorListTheme
  471. + (void) load
  472. {
  473. [self registerWithName: nil];
  474. }
  475. - (NSColor *) textColor
  476. {
  477. return [NSColor blackColor];
  478. }
  479. - (NSShadow *) dropShadow
  480. {
  481. return nil;
  482. }
  483. @end
  484. @implementation BXInspectorListSelectionTheme
  485. + (void) load
  486. {
  487. [self registerWithName: nil];
  488. }
  489. - (NSColor *) textColor
  490. {
  491. return [NSColor whiteColor];
  492. }
  493. - (NSColor *) disabledTextColor
  494. {
  495. return [NSColor colorWithCalibratedWhite: 1 alpha: 0.66];
  496. }
  497. - (NSShadow *) dropShadow
  498. {
  499. return [NSShadow shadowWithBlurRadius: 2.0f
  500. offset: NSMakeSize(0, -1.0f)
  501. color: [NSColor colorWithCalibratedWhite: 0 alpha: 0.75f]];
  502. }
  503. - (NSShadow *) textShadow
  504. {
  505. return [NSShadow shadowWithBlurRadius: 2.0f
  506. offset: NSMakeSize(0, -1.0f)
  507. color: [NSColor colorWithCalibratedWhite: 0 alpha: 0.5f]];
  508. }
  509. - (NSShadow *) disabledImageDropShadow
  510. {
  511. return [NSShadow shadowWithBlurRadius: 2.0f
  512. offset: NSMakeSize(0, -1.0f)
  513. color: [NSColor colorWithCalibratedWhite: 0 alpha: 0.5f]];
  514. }
  515. @end
  516. @implementation BXInspectorListHelpTextTheme
  517. + (void) load
  518. {
  519. [self registerWithName: nil];
  520. }
  521. @end
  522. @implementation BXLauncherTheme
  523. + (void) load
  524. {
  525. [self registerWithName: nil];
  526. }
  527. - (NSColor *) textColor
  528. {
  529. return [NSColor whiteColor];
  530. }
  531. - (NSShadow *) dropShadow
  532. {
  533. return [NSShadow shadowWithBlurRadius: 2.0f
  534. offset: NSMakeSize(0, -1.0f)
  535. color: [NSColor colorWithCalibratedWhite: 0 alpha: 0.5f]];
  536. }
  537. - (NSShadow *) textShadow { return self.dropShadow; }
  538. @end
  539. @implementation BXLauncherHelpTextTheme
  540. + (void) load
  541. {
  542. [self registerWithName: nil];
  543. }
  544. - (NSColor *) textColor
  545. {
  546. return [NSColor colorWithCalibratedWhite: 1.0 alpha: 0.75];
  547. }
  548. @end
  549. @implementation BXLauncherHeadingTheme
  550. + (void) load
  551. {
  552. [self registerWithName: nil];
  553. }
  554. - (NSColor *) textColor
  555. {
  556. return [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.5];
  557. }
  558. - (NSShadow *) dropShadow
  559. {
  560. return [NSShadow shadowWithBlurRadius: 1.0f
  561. offset: NSMakeSize(0, -1.0f)
  562. color: [NSColor colorWithCalibratedWhite: 1.0 alpha: 0.25f]];
  563. }
  564. - (NSGradient *) imageFill
  565. {
  566. return [[[NSGradient alloc] initWithStartingColor: [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.25]
  567. endingColor: [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.33]] autorelease];
  568. }
  569. - (NSShadow *) imageDropShadow
  570. {
  571. return self.dropShadow;
  572. }
  573. - (NSShadow *) imageInnerShadow
  574. {
  575. return [NSShadow shadowWithBlurRadius: 1.0
  576. offset: NSMakeSize(0, -1)
  577. color: [NSColor colorWithCalibratedWhite: 0.0 alpha: 0.5]];
  578. }
  579. @end
  580. @implementation BXAboutTheme
  581. + (void) load
  582. {
  583. [self registerWithName: nil];
  584. }
  585. - (NSShadow *) textShadow { return self.dropShadow; }
  586. - (NSShadow *) dropShadow
  587. {
  588. return [NSShadow shadowWithBlurRadius: 1.0f
  589. offset: NSMakeSize(0, 1.0f)
  590. color: [NSColor colorWithCalibratedWhite: 0 alpha: 1.0f]];
  591. }
  592. - (NSColor *) textColor
  593. {
  594. return [NSColor colorWithCalibratedWhite: 1 alpha: 0.66f];
  595. }
  596. @end
  597. @implementation BXAboutDarkTheme
  598. + (void) load
  599. {
  600. [self registerWithName: nil];
  601. }
  602. - (NSShadow *) dropShadow
  603. {
  604. return [NSShadow shadowWithBlurRadius: 1.0f
  605. offset: NSMakeSize(0, -1.0f)
  606. color: [NSColor colorWithCalibratedWhite: 1 alpha: 0.4f]];
  607. }
  608. - (NSColor *) textColor
  609. {
  610. return [NSColor colorWithCalibratedWhite: 0 alpha: 0.9f];
  611. }
  612. @end
  613. @implementation BXAboutLightTheme
  614. + (void) load
  615. {
  616. [self registerWithName: nil];
  617. }
  618. - (NSColor *) textColor
  619. {
  620. return [NSColor colorWithCalibratedWhite: 1 alpha: 0.8f];
  621. }
  622. @end