/Frameworks/AppKit/rhino.platform/_CPBorderlessBridgeWindowView.j

http://github.com/polymar/polish · Unknown · 36 lines · 36 code · 0 blank · 0 comment · 0 complexity · 76f1d115f1ae9d83db4bee7ad1bf611f MD5 · raw file

  1. i;15;_CPWindowView.jc;1901;
  2. var _1=nil;
  3. var _2=objj_allocateClassPair(_CPWindowView,"_CPBorderlessBridgeWindowView"),_3=_2.isa;
  4. class_addIvars(_2,[new objj_ivar("_toolbarBackgroundView")]);
  5. objj_registerClassPair(_2);
  6. objj_addClassForBundle(_2,objj_getBundleWithPath(OBJJ_CURRENT_BUNDLE.path));
  7. class_addMethods(_2,[new objj_method(sel_getUid("tile"),function(_4,_5){
  8. with(_4){
  9. objj_msgSendSuper({receiver:_4,super_class:objj_getClass("_CPWindowView")},"tile");
  10. var _6=objj_msgSend(_4,"window"),_7=objj_msgSend(_4,"bounds");
  11. objj_msgSend(objj_msgSend(_6,"contentView"),"setFrame:",CGRectMake(0,objj_msgSend(_4,"toolbarMaxY"),CGRectGetWidth(_7),CGRectGetHeight(_7)-objj_msgSend(_4,"toolbarMaxY")));
  12. if(!objj_msgSend(objj_msgSend(_6,"toolbar"),"isVisible")){
  13. objj_msgSend(_toolbarBackgroundView,"removeFromSuperview");
  14. _toolbarBackgroundView=nil;
  15. return;
  16. }
  17. if(!_toolbarBackgroundView){
  18. _toolbarBackgroundView=objj_msgSend(objj_msgSend(CPView,"alloc"),"initWithFrame:",CGRectMakeZero());
  19. objj_msgSend(_toolbarBackgroundView,"setBackgroundColor:",objj_msgSend(objj_msgSend(_4,"class"),"toolbarBackgroundColor"));
  20. objj_msgSend(_toolbarBackgroundView,"setAutoresizingMask:",CPViewWidthSizable);
  21. objj_msgSend(_4,"addSubview:positioned:relativeTo:",_toolbarBackgroundView,CPWindowBelow,nil);
  22. }
  23. var _8=CGRectMakeZero();
  24. _8.origin=CGPointMakeCopy(objj_msgSend(_4,"toolbarOffset"));
  25. _8.size=objj_msgSend(_toolbarView,"frame").size;
  26. objj_msgSend(_toolbarBackgroundView,"setFrame:",_8);
  27. }
  28. })]);
  29. class_addMethods(_3,[new objj_method(sel_getUid("toolbarBackgroundColor"),function(_9,_a){
  30. with(_9){
  31. if(!_1){
  32. _1=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,59)));
  33. }
  34. return _1;
  35. }
  36. })]);