how to get window with semi-transparent blurred background

后端 未结 3 471
北海茫月
北海茫月 2021-02-09 06:30

I\'d like to get a window that has a semi-transparent blurred background, just like what the Terminal can do. See this video, about 30 sec in, to see what I mean: http://www.you

3条回答
  •  太阳男子
    2021-02-09 07:23

    no need for layers and filters, NSWindow can do it itself

    [mywindow setOpaque:NO];
    [mywindow setBackgroundColor: [NSColor colorWithCalibratedHue:0.0 saturation:0.0 brightness:0.2 alpha:0.5]];
    

    please do not use this, as it will alpha your title bar also (post it here just in case others need)

    [mywindow setOpaque:NO];
    [mywindow setBackgroundColor: [NSColor blackColor]];
    [mywindow setAlphaValue:0.5];
    

    enter image description here

提交回复
热议问题