Skip to content

Screenshots, hung out to dry. A tiny native macOS app that hangs every screenshot on a line at the top of your screen.

Swift

Bring the line down only from the middle of the menu bar (#93)

Neo_Algo1a271b99a96d
diff --git a/README.md b/README.md
index b89e6a5..6972081 100644
--- a/README.md
+++ b/README.md
@@ -25,7 +25,7 @@
## Out of sight. Within reach.
Every screenshot you take hangs on a line just above your screen.
-Rest the pointer in the menu bar and it glides down. Move away and it's gone.
+Rest the pointer in the middle of the menu bar and it glides down. Move away and it's gone.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="docs/images/demo-dark.gif">
@@ -55,7 +55,7 @@ Rest the pointer in the menu bar and it glides down. Move away and it's gone.
| Drag into a folder | Keep it there. It leaves the line. |
| Drag to the Trash, or click the cross | Let it go. |
| <kbd>⌘</kbd>&thinsp;<kbd>Z</kbd> with the pointer on the line | Hang back what you just let go. |
-| Rest the pointer in the menu bar | Bring the line down on that screen. |
+| Rest the pointer in the middle of the menu bar | Bring the line down on that screen. |
| Click anything in the menu bar | Put it away. |
| <kbd>⌃</kbd>&thinsp;<kbd>⌥</kbd>&thinsp;<kbd>T</kbd> | Show or hide the line. Change it under Shortcut in the menu bar. |
diff --git a/Sources/Tendedero/AppDelegate.swift b/Sources/Tendedero/AppDelegate.swift
index 5fbb5f1..db16c94 100644
--- a/Sources/Tendedero/AppDelegate.swift
+++ b/Sources/Tendedero/AppDelegate.swift
@@ -491,6 +491,14 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
return NSRect(x: screen.frame.minX, y: screen.frame.maxY - h, width: screen.frame.width, height: h)
}
+ /// The part of the menu bar that brings the line down: the middle third,
+ /// so the menus on the left and the icons on the right stay easy to reach.
+ static func revealBand(of screen: NSScreen) -> NSRect {
+ let bar = menuBarBand(of: screen)
+ let width = bar.width / 3
+ return NSRect(x: bar.midX - width / 2, y: bar.minY, width: width, height: bar.height)
+ }
+
/// A click anywhere in the top bar of any screen, a menu or an icon, puts the line away.
private func watchMenuBarClicks() {
let handler: (NSEvent?) -> Void = { [weak self] _ in
@@ -523,17 +531,19 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSMenuDelegate {
let screenUnderPointer = NSScreen.screens.first { NSMouseInRect(mouse, $0.frame, false) }
let inMenuBar = screenUnderPointer.map { NSMouseInRect(mouse, Self.menuBarBand(of: $0), false) } ?? false
if !inMenuBar { menuBarSuppressed = false }
+ let inRevealBand = screenUnderPointer.map { NSMouseInRect(mouse, Self.revealBand(of: $0), false) } ?? false
guard isRevealed else {
holdPutBackKey(false)
line.closeGaps()
- // Resting in the menu bar brings the line down on that screen.
- // Pushing against the top edge is part of it, and it also works
- // when another display sits above and the pointer never stops.
+ // Resting in the middle of the menu bar brings the line down on
+ // that screen. Pushing against the top edge is part of it, and it
+ // also works when another display sits above and the pointer
+ // never stops.
// An empty line stays up there: only the shortcut and the menu
// bring it down on purpose.
if line.liveCount > 0, Self.opensFromMenuBar, let screen = screenUnderPointer,
- inMenuBar, !menuBarSuppressed, !FullScreen.blocksLine(on: screen) {
+ inRevealBand, !menuBarSuppressed, !FullScreen.blocksLine(on: screen) {
let since = hotZoneSince ?? now
hotZoneSince = since
if now.timeIntervalSince(since) >= Self.revealDelay {
diff --git a/docs/i18n/README.az.md b/docs/i18n/README.az.md
index 5723c85..f29a073 100644
--- a/docs/i18n/README.az.md
+++ b/docs/i18n/README.az.md
@@ -27,7 +27,7 @@
## Gözdən uzaq. Əl altında.
Çəkdiyiniz hər ekran şəkli ekranın düz üstündəki ipdən asılır.
-Göstəricini menyu panelində saxlayın, ip aşağı enir. Uzaqlaşdırın, yox olur.
+Göstəricini menyu panelinin ortasında saxlayın, ip aşağı enir. Uzaqlaşdırın, yox olur.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="../images/az/demo-dark.gif">
@@ -57,7 +57,7 @@ Göstəricini menyu panelində saxlayın, ip aşağı enir. Uzaqlaşdırın, yox
| Qovluğa sürükləmək | Orada saxlanır və ipdən çıxır. |
| Zibil qutusuna sürükləmək və ya çarpaza klik | Ondan qurtulursunuz. |
| Göstərici ipin üstündəykən <kbd>⌘</kbd>&thinsp;<kbd>Z</kbd> | Atdığınızı ipə geri asır. |
-| Göstəricini menyu panelində saxlamaq | İpi həmin ekranda endirir. |
+| Göstəricini menyu panelinin ortasında saxlamaq | İpi həmin ekranda endirir. |
| Menyu panelində istənilən yerə klik | İpi yığır. |
| <kbd>⌃</kbd>&thinsp;<kbd>⌥</kbd>&thinsp;<kbd>T</kbd> | İpi göstərir və ya gizlədir. Menyu panelində Qısayol bölməsindən dəyişdirmək olar. |
diff --git a/docs/i18n/README.es.md b/docs/i18n/README.es.md
index c596614..90031b8 100644
--- a/docs/i18n/README.es.md
+++ b/docs/i18n/README.es.md
@@ -27,7 +27,7 @@
## Fuera de la vista. Siempre a mano.
Cada captura que haces queda colgada en una cuerda justo encima de la pantalla.
-Lleva el puntero a la barra de menús y la cuerda baja. Apártalo y desaparece.
+Lleva el puntero al centro de la barra de menús y la cuerda baja. Apártalo y desaparece.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="../images/es/demo-dark.gif">
@@ -57,7 +57,7 @@ Lleva el puntero a la barra de menús y la cuerda baja. Apártalo y desaparece.
| Arrastrar a una carpeta | Se queda ahí y sale de la cuerda. |
| Arrastrar a la Papelera o hacer clic en la cruz | Te deshaces de ella. |
| <kbd>⌘</kbd>&thinsp;<kbd>Z</kbd> con el puntero en la cuerda | Vuelve a colgar lo que acabas de soltar. |
-| Dejar el puntero en la barra de menús | Baja la cuerda en esa pantalla. |
+| Dejar el puntero en el centro de la barra de menús | Baja la cuerda en esa pantalla. |
| Hacer clic en cualquier sitio de la barra de menús | Recoge la cuerda. |
| <kbd>⌃</kbd>&thinsp;<kbd>⌥</kbd>&thinsp;<kbd>T</kbd> | Muestra u oculta la cuerda. Se cambia en Atajo, en la barra de menús. |
diff --git a/docs/i18n/README.fr.md b/docs/i18n/README.fr.md
index 9ae0917..f7a55a7 100644
--- a/docs/i18n/README.fr.md
+++ b/docs/i18n/README.fr.md
@@ -27,7 +27,7 @@
## Hors de vue. À portée de main.
Chaque capture d’écran que vous prenez s’accroche à une corde juste au-dessus de l’écran.
-Posez le pointeur dans la barre des menus et la corde descend. Éloignez-le et elle disparaît.
+Posez le pointeur au milieu de la barre des menus et la corde descend. Éloignez-le et elle disparaît.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="../images/fr/demo-dark.gif">
@@ -57,7 +57,7 @@ Posez le pointeur dans la barre des menus et la corde descend. Éloignez-le et e
| Glisser dans un dossier | Elle y reste. Elle quitte la corde. |
| Glisser dans la corbeille, ou cliquer sur la croix | Laissez-la filer. |
| <kbd>⌘</kbd>&thinsp;<kbd>Z</kbd>, le pointeur sur la corde | Raccroche ce que vous venez de laisser filer. |
-| Poser le pointeur dans la barre des menus | Fait descendre la corde sur cet écran. |
+| Poser le pointeur au milieu de la barre des menus | Fait descendre la corde sur cet écran. |
| Cliquer n’importe où dans la barre des menus | La range. |
| <kbd>⌃</kbd>&thinsp;<kbd>⌥</kbd>&thinsp;<kbd>T</kbd> | Affiche ou masque la corde. Modifiable dans Raccourci, dans la barre des menus. |
diff --git a/docs/i18n/README.gl.md b/docs/i18n/README.gl.md
index d587710..486c660 100644
--- a/docs/i18n/README.gl.md
+++ b/docs/i18n/README.gl.md
@@ -27,7 +27,7 @@
## Fóra da vista. Sempre a man.
Cada captura que fas queda pendurada nunha corda xusto enriba da pantalla.
-Leva o punteiro á barra de menús e a corda baixa. Apártao e desaparece.
+Leva o punteiro ao centro da barra de menús e a corda baixa. Apártao e desaparece.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="../images/gl/demo-dark.gif">
@@ -57,7 +57,7 @@ Leva o punteiro á barra de menús e a corda baixa. Apártao e desaparece.
| Arrastrar a un cartafol | Queda alí e sae da corda. |
| Arrastrar á Papeleira ou facer clic na cruz | Desfaste dela. |
| <kbd>⌘</kbd>&thinsp;<kbd>Z</kbd> co punteiro na corda | Volve colgar o que acabas de soltar. |
-| Deixar o punteiro na barra de menús | Baixa a corda nesa pantalla. |
+| Deixar o punteiro no centro da barra de menús | Baixa a corda nesa pantalla. |
| Facer clic en calquera sitio da barra de menús | Recolle a corda. |
| <kbd>⌃</kbd>&thinsp;<kbd>⌥</kbd>&thinsp;<kbd>T</kbd> | Amosa ou oculta a corda. Cámbiase en Atallo, na barra de menús. |
diff --git a/docs/i18n/README.hi.md b/docs/i18n/README.hi.md
index 26f945b..ec346a4 100644
--- a/docs/i18n/README.hi.md
+++ b/docs/i18n/README.hi.md
@@ -27,7 +27,7 @@
## नज़र से दूर। हमेशा पास।
आप जो भी स्क्रीनशॉट लेते हैं, वह आपकी स्क्रीन के ठीक ऊपर एक रस्सी पर टँग जाता है।
-पॉइंटर को मेनू बार में रोकें और रस्सी धीरे से नीचे आ जाती है। पॉइंटर हटाएँ और वह गायब।
+पॉइंटर को मेनू बार के बीच में रोकें और रस्सी धीरे से नीचे आ जाती है। पॉइंटर हटाएँ और वह गायब।
<picture>
<source media="(prefers-color-scheme: dark)" srcset="../images/hi/demo-dark.gif">
@@ -57,7 +57,7 @@
| किसी फ़ोल्डर में खींचें | उसे वहीं रखें। वह रस्सी से उतर जाती है। |
| ट्रैश में खींचें, या क्रॉस पर क्लिक करें | जाने दें। |
| पॉइंटर रस्सी पर रखकर <kbd>⌘</kbd>&thinsp;<kbd>Z</kbd> | जिसे अभी जाने दिया, उसे वापस टाँगें। |
-| पॉइंटर को मेनू बार में रोकें | उस स्क्रीन पर रस्सी नीचे लाएँ। |
+| पॉइंटर को मेनू बार के बीच में रोकें | उस स्क्रीन पर रस्सी नीचे लाएँ। |
| मेनू बार में कहीं भी क्लिक करें | रस्सी ऊपर कर दें। |
| <kbd>⌃</kbd>&thinsp;<kbd>⌥</kbd>&thinsp;<kbd>T</kbd> | रस्सी दिखाएँ या छिपाएँ। मेनू बार में शॉर्टकट से इसे बदलें। |
diff --git a/docs/i18n/README.ja.md b/docs/i18n/README.ja.md
index 1bfccc2..9784e18 100644
--- a/docs/i18n/README.ja.md
+++ b/docs/i18n/README.ja.md
@@ -27,7 +27,7 @@
## 目には入らず、手は届く。
撮ったスクリーンショットはすべて、画面のすぐ上のロープに吊るされます。
-メニューバーにポインタを置くと、するりと降りてきます。離れると消えます。
+メニューバーの中央にポインタを置くと、するりと降りてきます。離れると消えます。
<picture>
<source media="(prefers-color-scheme: dark)" srcset="../images/ja/demo-dark.gif">
@@ -57,7 +57,7 @@
| フォルダにドラッグ | そこに保存。ロープからは外れます。 |
| ゴミ箱にドラッグ、または×をクリック | 手放す。 |
| ポインタをロープに置いて <kbd>⌘</kbd>&thinsp;<kbd>Z</kbd> | 手放したばかりのものを掛け直す。 |
-| メニューバーにポインタを置く | その画面にロープを降ろす。 |
+| メニューバーの中央にポインタを置く | その画面にロープを降ろす。 |
| メニューバーのどこかをクリック | ロープをしまう。 |
| <kbd>⌃</kbd>&thinsp;<kbd>⌥</kbd>&thinsp;<kbd>T</kbd> | ロープを表示または非表示。メニューバーの「ショートカット」で変更できます。 |
diff --git a/docs/i18n/README.ko.md b/docs/i18n/README.ko.md
index 87f0e4e..b817ebc 100644
--- a/docs/i18n/README.ko.md
+++ b/docs/i18n/README.ko.md
@@ -27,7 +27,7 @@
## 눈에는 안 보이게. 손에는 닿게.
찍는 모든 스크린샷이 화면 바로 위의 빨랫줄에 걸려요.
-포인터를 메뉴 막대에 올려 두면 줄이 스르륵 내려오고, 포인터를 떼면 사라져요.
+포인터를 메뉴 막대 가운데에 올려 두면 줄이 스르륵 내려오고, 포인터를 떼면 사라져요.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="../images/ko/demo-dark.gif">
@@ -57,7 +57,7 @@
| 폴더로 드래그 | 폴더에 보관해요. 빨랫줄에서는 사라져요. |
| 휴지통으로 드래그하거나 X 버튼 클릭 | 미련 없이 버려요. |
| 포인터를 빨랫줄에 두고 <kbd>⌘</kbd>&thinsp;<kbd>Z</kbd> | 방금 버린 걸 다시 걸어요. |
-| 포인터를 메뉴 막대에 올려 두기 | 그 화면에 빨랫줄을 내려요. |
+| 포인터를 메뉴 막대 가운데에 올려 두기 | 그 화면에 빨랫줄을 내려요. |
| 메뉴 막대의 아무 곳이나 클릭 | 빨랫줄을 치워요. |
| <kbd>⌃</kbd>&thinsp;<kbd>⌥</kbd>&thinsp;<kbd>T</kbd> | 빨랫줄을 보거나 가려요. 메뉴 막대의 단축키에서 바꿀 수 있어요. |
diff --git a/docs/i18n/README.pt-BR.md b/docs/i18n/README.pt-BR.md
index 47a4957..a5d8ef8 100644
--- a/docs/i18n/README.pt-BR.md
+++ b/docs/i18n/README.pt-BR.md
@@ -27,7 +27,7 @@
## Longe da vista. Ao alcance da mão.
Cada captura de tela que você faz fica pendurada num varal logo acima da tela.
-Pare o ponteiro na barra de menus e o varal desce. Afaste-o e ele some.
+Pare o ponteiro no meio da barra de menus e o varal desce. Afaste-o e ele some.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="../images/pt-BR/demo-dark.gif">
@@ -57,7 +57,7 @@ Pare o ponteiro na barra de menus e o varal desce. Afaste-o e ele some.
| Arrastar para uma pasta | Guarda a imagem ali. Ela sai do varal. |
| Arrastar para o Lixo, ou clicar no X | Desapegue. |
| <kbd>⌘</kbd>&thinsp;<kbd>Z</kbd> com o ponteiro no varal | Pendura de volta o que você acabou de soltar. |
-| Parar o ponteiro na barra de menus | Baixa o varal naquela tela. |
+| Parar o ponteiro no meio da barra de menus | Baixa o varal naquela tela. |
| Clicar em qualquer lugar da barra de menus | Recolhe o varal. |
| <kbd>⌃</kbd>&thinsp;<kbd>⌥</kbd>&thinsp;<kbd>T</kbd> | Mostra ou oculta o varal. Altere em Atalho, na barra de menus. |
diff --git a/docs/i18n/README.tr.md b/docs/i18n/README.tr.md
index 43dd0ca..8803fa9 100644
--- a/docs/i18n/README.tr.md
+++ b/docs/i18n/README.tr.md
@@ -27,7 +27,7 @@
## Gözden uzak. Her an erişilebilir.
Aldığınız her ekran görüntüsü, ekranınızın hemen üstündeki bir ipe asılır.
-İşaretçiyi menü çubuğuna götürün, ip aşağı süzülür. Uzaklaşın, kaybolur.
+İşaretçiyi menü çubuğunun ortasına götürün, ip aşağı süzülür. Uzaklaşın, kaybolur.
<picture>
<source media="(prefers-color-scheme: dark)" srcset="../images/tr/demo-dark.gif">
@@ -57,7 +57,7 @@ Aldığınız her ekran görüntüsü, ekranınızın hemen üstündeki bir ipe
| Klasöre sürükle | Orada saklar. İpten ayrılır. |
| Çöp Kutusu'na sürükle ya da çarpıya tıkla | Siler. |
| İşaretçi ipin üzerindeyken <kbd>⌘</kbd>&thinsp;<kbd>Z</kbd> | Az önce bıraktığını geri asar. |
-| İşaretçiyi menü çubuğunda bırak | O ekranda ipi aşağı indirir. |
+| İşaretçiyi menü çubuğunun ortasında bırak | O ekranda ipi aşağı indirir. |
| Menü çubuğunda herhangi bir yere tıkla | İpi geri kaldırır. |
| <kbd>⌃</kbd>&thinsp;<kbd>⌥</kbd>&thinsp;<kbd>T</kbd> | İpi gösterir ya da gizler. Menü çubuğundaki Kısayol bölümünden değiştirilebilir. |
diff --git a/docs/i18n/README.zh-Hans.md b/docs/i18n/README.zh-Hans.md
index 5b38a84..cf282e4 100644
--- a/docs/i18n/README.zh-Hans.md
+++ b/docs/i18n/README.zh-Hans.md
@@ -27,7 +27,7 @@
## 看不见,却够得着
你每截一张图,它都会挂到屏幕顶上的一根绳上。
-把指针停在菜单栏,绳子就滑下来;移开,它就收起。
+把指针停在菜单栏中间,绳子就滑下来;移开,它就收起。
<picture>
<source media="(prefers-color-scheme: dark)" srcset="../images/zh-Hans/demo-dark.gif">
@@ -57,7 +57,7 @@
| 拖进文件夹 | 存在那儿。原图从绳上取下。 |
| 拖到废纸篓,或点叉 | 松手丢弃。 |
| 指针在绳子上时按 <kbd>⌘</kbd>&thinsp;<kbd>Z</kbd> | 把刚丢掉的挂回去。 |
-| 指针停在菜单栏 | 在那一块屏幕上放下绳子。 |
+| 指针停在菜单栏中间 | 在那一块屏幕上放下绳子。 |
| 点击菜单栏任意处 | 把绳子收起来。 |
| <kbd>⌃</kbd>&thinsp;<kbd>⌥</kbd>&thinsp;<kbd>T</kbd> | 显示或隐藏绳子。可在菜单栏的「快捷键」中更改。 |