New Document dialog: orientation toggle, size presets, and a guard against 0-size documents
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
研究方向
Start in editor/src/messages/dialog/new_document_dialog/ and read how the dialog stores W/H, handles Infinite Canvas, and submits dimensions. The request specifies orientation toggling, screen and paper presets, and a 1 px minimum; keep changes within the dialog as described. Done means the controls behave as specified and submission creates a nonzero artboard when Infinite Canvas is off.
由索引模型根據 Issue 內容生成。
描述
The New Document dialog (editor/src/messages/dialog/new_document_dialog/) currently has a name field, an Infinite Canvas checkbox, and W/H inputs. I'd like to propose a few small quality-of-life improvements that live entirely inside the dialog. PortfolioMessage::NewDocumentWithName, GraphOperationMessage::NewArtboard and the rest of Submit would stay as they are.
1. Portrait / Landscape toggle
An "Orientation" row with a two-option Portrait / Landscape radio, replacing the need to swap W and H by hand. The active option follows the dimensions (landscape when W > H). Clicking the inactive one swaps W and H, so one click toggles. A small swap button between W and H does the same toggle, for people who think in terms of swapping the two numbers. All of these are disabled while Infinite Canvas is checked, and the radio is also disabled for square sizes.
A plain swap-dimensions button was already attempted in #4138, which was closed in the backlog cleanup (#4647) rather than for a problem with the idea. Bot review feedback there was only that it should be disabled in infinite-canvas mode. I think a labeled toggle that shows the current orientation is clearer than an unlabeled swap icon, but I'm happy to go with only an icon button if you prefer.
2. Size presets
A dropdown above Dimensions with common sizes:
- Screen: 1920x1080, 1280x720, 3840x2160, 1080x1080
- Paper: A3, A4, A5, Letter
Picking one fills W/H in the current orientation. A preset stays selected when the orientation is toggled, and editing W/H by hand switches the dropdown to "Custom". Presets are plain dialog state and never reach the document code. Paper sizes are pixel values at an assumed 96 DPI (CSS px), which is open to discussion.
3. Guard against 0-size documents
W and H currently have a minimum of 0. If either is 0 with Infinite Canvas off, Submit skips creating the artboard (self.dimensions.x > 0 && self.dimensions.y > 0), so the user silently gets an empty document with no artboard. I'd raise the minimum to 1, so a typed 0 clamps to 1 px. Open to disabling OK instead if you prefer.
Related
- Enter doesn't confirm the dialog after editing values (#3601). I'd be glad to include a fix for this in the same PR, since it's the same dialog.
- Footer button mnemonics (#3605), which touches the same dialog.
Willingness to implement
I'd like to implement this myself if you approve. I already have a working prototype (about 80 lines, all inside new_document_dialog/), so the screenshot is the real dialog. I know the backlog is tight for 1.0, so I'd keep the PR small and dialog-only, with before/after screenshots. If you'd like it split (for example the guard and orientation toggle first, presets after), I'm happy to do that.
The mockup screenshots are generated with the help of AI.
- 主要語言
- Rust
- 星號
- 27.8k
- 分支
- 1.3k
- 平均合併
- 17 小時 32 分鐘
- 30 天內合併 PR
- 171
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 沒有貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
GraphiteEditor/Graphite 的其他 Issue
-
`third-party-licenses` fails on Windows when the parent process is PowerShell可能已有人在做 @sahilshingate01 於 8 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
GraphiteEditor/Graphite#4745 · 1 則留言 ·
維護者通常 1 天內回覆
-
Resizing a text box by one edge handle incorrectly locks both Max Width and Max Height, silently clipping text可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 78/100
GraphiteEditor/Graphite#4396 · 2 則留言 ·
維護者通常 1 天內回覆
-
Type hint is selected in node graph view可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
GraphiteEditor/Graphite#4311 ·
維護者通常 1 天內回覆
-
`cargo run` fails on WebAssembly target due to `CARGO_BUILD_TARGET` leaking into `rustc_codegen_spirv` build可能重新可做 關聯的 PR 已關閉且未合併。 未關閉
難度 2/5 1-3 小時 新手友好度 68/100
GraphiteEditor/Graphite#3939 · 2 則留言 · 1 個 reaction ·
維護者通常 1 天內回覆
-
難度 3/5 1-2 天 新手友好度 45/100
GraphiteEditor/Graphite#4853 ·
維護者通常 1 天內回覆
查看 GraphiteEditor/Graphite 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 76/100
Y-ASLant/ElegantClipboard#178 ·
-
難度 2/5 1-3 小時 新手友好度 82/100
linxiv-dev/linXiv#384 · 1 則留言 ·
維護者通常 1 天內回覆
-
bug drawings ui
難度 2/5 1-3 小時 新手友好度 82/100
userFRM/egui-charts#1595 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 72/100
smoltcp-rs/smoltcp#1235 ·
維護者通常 1 天內回覆
-
scope:core type:security
難度 2/5 1-3 小時 新手友好度 75/100
維護者通常 1 天內回覆