惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
F
Fortinet All Blogs
D
Docker
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
罗磊的独立博客
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
J
Java Code Geeks
T
The Blog of Author Tim Ferriss
U
Unit 42
N
Netflix TechBlog - Medium
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
云风的 BLOG
云风的 BLOG
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
Stack Overflow Blog
Stack Overflow Blog
爱范儿
爱范儿
酷 壳 – CoolShell
酷 壳 – CoolShell
P
Proofpoint News Feed
G
Google Developers Blog
H
Help Net Security

Dosk 技术站

华为荣耀电视盒子刷 Armbian - Dosk 技术站 记录一个没意义的 usb wifi 驱动编译 - Dosk 技术站 我的 2024 - Dosk 技术站 unRAID 7.0.0-beta.1 - Dosk 技术站 关于 unraider 的开心版 - Dosk 技术站 unRAID 6.12.7-rc2 进展 - Dosk 技术站 每年问自己 40 个问题 - Dosk 技术站 Kubernetes 集群导航页 - Dosk 技术站 2023 年度总结 - Dosk 技术站 N100 万兆软路由最终形态 - Dosk 技术站 N100 软路由改造下散热 - Dosk 技术站 N100 万兆软路由测测速 - Dosk 技术站 整活新玩具,半 DIY 一个万兆软路由 - Dosk 技术站 玩玩 WebAuthn:RP2040 One - Dosk 技术站 关于最近以及后续要做什么 - Dosk 技术站 unRAID 6.12.0-rc7/6.12.0-rc6.13 - Dosk 技术站 unRAID 6.12.0-beta18 试用 - Dosk 技术站 unRAID 6.11.4 如何继续开心 - Dosk 技术站 cert-manager 基于 acme.sh 的 webhook - Dosk 技术站 unRAID 虚拟机运行 unRAID 简单步骤 - Dosk 技术站 解决 Chrome 原生谷歌翻译功能的一个思路:3/3 - Dosk 技术站 解决 Chrome 原生谷歌翻译功能的一个思路:1/3 - Dosk 技术站 unraid 命令行包管理器 - Dosk 技术站 继续,unraid 6.11 happy 的方法 - Dosk 技术站 适用于 k8s 的 frpc ingress 实现 - Dosk 技术站 实现了一个简单的通配 DNS 服务 - Dosk 技术站 代码更新,happy unraid 懒人版 - Dosk 技术站 复盘一次群晖的 btrfs + docker:dind 引发的灾难 - Dosk 技术站 unraid 官方版不修改不用 keymaker 可持续 happy 的方法 - Dosk 技术站 unraid 实现完美硬盘启动 - Dosk 技术站
Cocoa 修改 TitleBar 样式 - Dosk 技术站
2019-12-03 · via Dosk 技术站
// Method define
NAN_METHOD(MapTrafficButton) {
  void* buffer = node::Buffer::Data(info[0]->ToObject());
  if (!buffer) {
    ThrowError("MapTrafficButton invalid buffer handle !");
    return;
  }
  unsigned long handle = *reinterpret_cast<unsigned long *>(buffer);
  NSView* view = (NSView *)handle;
  // NSWindow handle
  NSWindow* win = [view window];
  // Traffic button handle
  NSButton* closeButton = [win standardWindowButton:NSWindowCloseButton];
  NSButton* minButton = [win standardWindowButton:NSWindowMiniaturizeButton];
  NSButton* zoomButton = [win standardWindowButton:NSWindowZoomButton];
  // TitleBar handle
  NSView* titlebarView = closeButton.superview;
  // Make NSWindow titlebar hight from 22 to 38
  NSToolbar* toolbar = [[NSToolbar alloc] initWithIdentifier:@"window-titlebar"];
  toolbar.showsBaselineSeparator = NO;
  [win setTitleVisibility:NSWindowTitleHidden];
  [win setToolbar:toolbar];
  // Traffic layout
  closeButton.translatesAutoresizingMaskIntoConstraints = NO;
  [titlebarView addConstraints:@[
    [NSLayoutConstraint constraintWithItem:closeButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:titlebarView attribute:NSLayoutAttributeTop multiplier:1 constant:15],
    [NSLayoutConstraint constraintWithItem:closeButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:titlebarView attribute:NSLayoutAttributeLeft multiplier:1 constant:6]
  ]];
  minButton.translatesAutoresizingMaskIntoConstraints = NO;
  [titlebarView addConstraints:@[
    [NSLayoutConstraint constraintWithItem:minButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:titlebarView attribute:NSLayoutAttributeTop multiplier:1 constant:15],
    [NSLayoutConstraint constraintWithItem:minButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:titlebarView attribute:NSLayoutAttributeLeft multiplier:1 constant:23]
  ]];
  zoomButton.translatesAutoresizingMaskIntoConstraints = NO;
  [titlebarView addConstraints:@[
    [NSLayoutConstraint constraintWithItem:zoomButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:titlebarView attribute:NSLayoutAttributeTop multiplier:1 constant:15],
    [NSLayoutConstraint constraintWithItem:zoomButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:titlebarView attribute:NSLayoutAttributeLeft multiplier:1 constant:40]
  ]];
}

// Export method
Set(target, New<v8::String>("mapTrafficButton").ToLocalChecked(), New<v8::FunctionTemplate>(MapTrafficButton)->GetFunction());