/Frameworks/Debug/AppKit/browser.platform/_CPBorderlessBridgeWindowView.j

http://github.com/jfahrenkrug/MapKit-HelloWorld · Unknown · 42 lines · 41 code · 1 blank · 0 comment · 0 complexity · 7b97634c52c42898be7138cf3ee70fe3 MD5 · raw file

  1. i;15;_CPWindowView.jc;2460;
  2. var _CPToolbarViewBackgroundColor = nil;
  3. {var the_class = objj_allocateClassPair(_CPWindowView, "_CPBorderlessBridgeWindowView"),
  4. meta_class = the_class.isa;class_addIvars(the_class, [new objj_ivar("_toolbarBackgroundView")]);
  5. objj_registerClassPair(the_class);
  6. objj_addClassForBundle(the_class, objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  7. class_addMethods(the_class, [new objj_method(sel_getUid("tile"), function $_CPBorderlessBridgeWindowView__tile(self, _cmd)
  8. { with(self)
  9. {
  10. objj_msgSendSuper({ receiver:self, super_class:objj_getClass("_CPWindowView") }, "tile");
  11. var theWindow = objj_msgSend(self, "window"),
  12. bounds = objj_msgSend(self, "bounds");
  13. objj_msgSend(objj_msgSend(theWindow, "contentView"), "setFrame:", CGRectMake(0.0, objj_msgSend(self, "toolbarMaxY"), CGRectGetWidth(bounds), CGRectGetHeight(bounds) - objj_msgSend(self, "toolbarMaxY")));
  14. if (!objj_msgSend(objj_msgSend(theWindow, "toolbar"), "isVisible"))
  15. {
  16. objj_msgSend(_toolbarBackgroundView, "removeFromSuperview");
  17. _toolbarBackgroundView = nil;
  18. return;
  19. }
  20. if (!_toolbarBackgroundView)
  21. {
  22. _toolbarBackgroundView = objj_msgSend(objj_msgSend(CPView, "alloc"), "initWithFrame:", CGRectMakeZero());
  23. objj_msgSend(_toolbarBackgroundView, "setBackgroundColor:", objj_msgSend(objj_msgSend(self, "class"), "toolbarBackgroundColor"));
  24. objj_msgSend(_toolbarBackgroundView, "setAutoresizingMask:", CPViewWidthSizable);
  25. objj_msgSend(self, "addSubview:positioned:relativeTo:", _toolbarBackgroundView, CPWindowBelow, nil);
  26. }
  27. var frame = CGRectMakeZero();
  28. frame.origin = CGPointMakeCopy(objj_msgSend(self, "toolbarOffset"));
  29. frame.size = objj_msgSend(_toolbarView, "frame").size;
  30. objj_msgSend(_toolbarBackgroundView, "setFrame:", frame);
  31. }
  32. })]);
  33. class_addMethods(meta_class, [new objj_method(sel_getUid("toolbarBackgroundColor"), function $_CPBorderlessBridgeWindowView__toolbarBackgroundColor(self, _cmd)
  34. { with(self)
  35. {
  36. if (!_CPToolbarViewBackgroundColor)
  37. _CPToolbarViewBackgroundColor = objj_msgSend(CPColor, "colorWithPatternImage:", objj_msgSend(objj_msgSend(CPImage, "alloc"), "initWithContentsOfFile:size:", objj_msgSend(objj_msgSend(CPBundle, "bundleForClass:", objj_msgSend(_CPBorderlessBridgeWindowView, "class")), "pathForResource:", "_CPToolbarView/_CPToolbarViewBackground.png"), CGSizeMake(1.0, 59.0)));
  38. return _CPToolbarViewBackgroundColor;
  39. }
  40. })]);
  41. }