mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-01 13:47:21 -06:00
Merge pull request #4695 from storytold/fix/screen-modes-full-screen
Full Screen and Presentation Mode fill the screen (#4365)
This commit is contained in:
@@ -103,6 +103,7 @@ impl VectorcraftApp {
|
||||
hover_doc: None,
|
||||
custom_titlebar: false,
|
||||
last_window_title: String::new(),
|
||||
fullscreen_for_mode: false,
|
||||
graphics_adapter: None,
|
||||
place: Default::default(),
|
||||
system_paste: false,
|
||||
@@ -337,6 +338,7 @@ impl VectorcraftApp {
|
||||
// The OS title bar (and the taskbar / Alt-Tab entry) follows the active file; with the
|
||||
// system title bar this is where the document name lives, as the in-app mark is hidden.
|
||||
crate::chrome::sync_window_title(self, ctx);
|
||||
crate::chrome::sync_fullscreen(self, ctx);
|
||||
self.drain_control(ctx);
|
||||
// An egui `PasteImage` with a rich system clipboard: run the paste command now, once. It
|
||||
// goes through `run`, whose `edit.paste` branch calls `adopt_system_clipboard` (which clears
|
||||
|
||||
@@ -160,6 +160,23 @@ pub fn sync_window_title(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
}
|
||||
}
|
||||
|
||||
/// Full Screen Mode and Presentation Mode fill the screen (#4365: the taskbar and the window's
|
||||
/// frame stayed): the window goes full screen when one of them starts, and back when a mode with
|
||||
/// the menu bar returns. A window that was full screen already stays so.
|
||||
pub fn sync_fullscreen(app: &mut VectorcraftApp, ctx: &egui::Context) {
|
||||
let want = app.ui.screen_mode >= 2;
|
||||
let is = ctx.input(|i| i.viewport().fullscreen.unwrap_or(false));
|
||||
if want && !is && !app.fullscreen_for_mode {
|
||||
ctx.send_viewport_cmd(egui::ViewportCommand::Fullscreen(true));
|
||||
app.fullscreen_for_mode = true;
|
||||
} else if !want && app.fullscreen_for_mode {
|
||||
if is {
|
||||
ctx.send_viewport_cmd(egui::ViewportCommand::Fullscreen(false));
|
||||
}
|
||||
app.fullscreen_for_mode = false;
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
|
||||
@@ -1603,3 +1603,33 @@ fn artboard_close_active_tab_properties_delete_uses_shown_board() {
|
||||
close_b_tab(&mut app, &ctx, &base);
|
||||
delete_shown_board(&mut app, &ctx, &base);
|
||||
}
|
||||
|
||||
/// #4365: Full Screen and Presentation Mode put the window full screen once, and Normal Screen
|
||||
/// Mode takes it back out; a window already full screen is left as it is.
|
||||
#[test]
|
||||
fn full_screen_modes_fill_the_screen_and_normal_mode_restores_the_window() {
|
||||
let mut app = title_test_app(true);
|
||||
let ctx = egui::Context::default();
|
||||
let sent = |app: &mut crate::VectorcraftApp, fullscreen: bool| -> Vec<bool> {
|
||||
let mut input = egui::RawInput::default();
|
||||
input.viewports.entry(egui::ViewportId::ROOT).or_default().fullscreen = Some(fullscreen);
|
||||
let mut out = ctx.run_ui(input, |ui| super::sync_fullscreen(app, ui.ctx()));
|
||||
out.textures_delta.clear();
|
||||
let cmds = out.viewport_output.remove(&egui::ViewportId::ROOT).map(|v| v.commands).unwrap_or_default();
|
||||
cmds.iter().filter_map(|c| if let egui::ViewportCommand::Fullscreen(f) = c { Some(*f) } else { None }).collect()
|
||||
};
|
||||
assert!(sent(&mut app, false).is_empty(), "Normal Screen Mode");
|
||||
app.ui.screen_mode = 3;
|
||||
assert_eq!(sent(&mut app, false), [true], "Presentation Mode");
|
||||
assert!(sent(&mut app, true).is_empty(), "once");
|
||||
app.ui.screen_mode = 2;
|
||||
assert!(sent(&mut app, true).is_empty(), "Full Screen Mode keeps it");
|
||||
app.ui.screen_mode = 0;
|
||||
assert_eq!(sent(&mut app, true), [false], "back to a window");
|
||||
assert!(sent(&mut app, false).is_empty());
|
||||
// Full screen by the user's own choice: the modes leave it so.
|
||||
app.ui.screen_mode = 3;
|
||||
assert!(sent(&mut app, true).is_empty());
|
||||
app.ui.screen_mode = 0;
|
||||
assert!(sent(&mut app, true).is_empty(), "still full screen, as the user had it");
|
||||
}
|
||||
|
||||
@@ -185,6 +185,9 @@ pub struct VectorcraftApp {
|
||||
/// Last window title sent to the OS (`ViewportCommand::Title`, see `chrome::sync_window_title`):
|
||||
/// sent again only when it changes, so idle frames don't spam the backend.
|
||||
pub(crate) last_window_title: String,
|
||||
/// Whether a screen mode put the window full screen (`chrome::sync_fullscreen`), so Normal
|
||||
/// Screen Mode takes it back out, and leaves a window the user made full screen as it is.
|
||||
pub(crate) fullscreen_for_mode: bool,
|
||||
/// The graphics adapter the window renders with ("name (backend)"), as the host reports it:
|
||||
/// shown in Help › About and `ui.inspect` for GPU bug reports. `None` when unknown.
|
||||
pub graphics_adapter: Option<String>,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Parity with Adobe Illustrator
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (Place: a photo's EXIF orientation turns it upright (#4284); scores unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026)
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-30 · **Change:** minor (Full Screen and Presentation Mode fill the screen (#4365); scores unchanged) · **Target:** Adobe Illustrator 2026 (30.x; public release notes through 30.7, August 2026)
|
||||
|
||||
## Feature submission evidence
|
||||
|
||||
@@ -763,6 +763,7 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- **Rotated views:** with the view rotated, Fit Artboard in Window, Fit All in Window and the status bar's artboard navigator fit the artboard or the art as the view turns it, and a Zoom tool marquee (Animated Zoom or GPU Performance off) zooms to the area dragged across. Ruler guides on no artboard turn with the view. The canvas draws the selection marquee where the tools select, Show Hidden Characters draws the marks of type partly inside the canvas, the Contextual Task Bar stays under the selection, and the Navigator's red box outlines what the window shows.
|
||||
- **Views:** the status bar's artboard navigator (first, previous, next, last; `view.goToArtboard`) goes to an artboard, fits it and synchronizes the Artboard tool selection when that tool is active; ordinary object selection is preserved. Actual Next-button regressions cover keyboard/Properties deletion and Undo in `chrome.rs`. Fit Artboard in Window and Actual Size show the navigator's artboard. The Artboards panel highlights that active artboard: clicking a row makes it active (the Artboard tool's too, while it is chosen) as does clicking an artboard with the Artboard tool, double-clicking its number also fits it in the window and double-clicking its name renames it. Duplicate Artboards, or a row dragged onto New Artboard, copies the artboard with its art (#446). Escape leaves Presentation Mode, `view.screenMode` from it goes back to Normal Screen Mode, and the screen mode isn't saved with the preferences: the app always starts in Normal Screen Mode with its menus and panels (#472). View › Pixel Preview shows the art as the document pixels it rasterizes to, one per point and hard-edged when magnified, turning with a rotated view (it used to draw the smooth vectors, with only the pixel grid over them). In Outline view a template layer keeps drawing in Preview, dimmed, so a picture placed to be traced stays visible under the outlines (#1505, fixes #1486).
|
||||
In Presentation Mode, → and ← go to the next and the previous artboard, and a click anywhere goes to the next one, as the status bar navigator's Next and Previous do (`view.goToArtboard`): on the last artboard → and a click leave the view as it is, and so does ← on the first. The arrow keys do not move the selection there, and the tool does not receive a click, so a click selects and draws nothing (behavior reference: [View artwork](https://helpx.adobe.com/illustrator/using/viewing-artwork.html)).
|
||||
Full Screen Mode and Presentation Mode put the window full screen, covering the taskbar and the window's frame, and Normal Screen Mode or Full Screen Mode with Menu Bar puts it back (#4365); a window the user made full screen stays so.
|
||||
In Presentation Mode no key press other than ←, → and Escape runs a command or reaches the tool (tool keys, Delete, Enter, Tab, F, Shift+F and every command shortcut, the macOS menu bar's key equivalents included), a right click or a long touch opens no context menu, a tap of two or three fingers undoes or redoes nothing, and the pointer over the canvas is the default one instead of the tool's cursor.
|
||||
Align to Artboard uses the active artboard, the one the Artboards panel highlights (`object.align {artboard}`). A press with a selection tool inside an artboard makes that artboard active; with the Selection tool, a Shift-click on an empty spot inside an artboard makes it active and keeps the selection. One selected object is aligned to the active artboard too, whatever Align To says (a lone object is never the key object). When an action plays, its Align to Artboard, All on Active Artboard, Paste in Place, Paste in Front and Paste in Back steps that name no artboard use the artboard that is active then.
|
||||
With the Artboard tool in use, a Shift-click on a row of the Artboards panel selects the artboards from the last row clicked without Shift to the clicked row, and the clicked row's artboard becomes the active one. When the artboard of the last row clicked without Shift is no longer selected, the range starts from the active artboard, and later Shift-clicks start from there too. A Ctrl/Cmd-click still adds or removes one artboard. A Shift-click used to add or remove one artboard as well. The public [Select artboards](https://helpx.adobe.com/illustrator/desktop/create-manage-artboards/add-edit-artboards/select-artboards.html) page lists Shift-click in the Artboards panel for selecting several artboards.
|
||||
@@ -1262,6 +1263,7 @@ undo step, with any adjustment and its params; bad requests refused) and `addons
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-10-30 | minor | Full Screen and Presentation Mode fill the screen (#4365); scores and estimates unchanged |
|
||||
| 2026-10-30 | minor | Place: a photo's EXIF orientation turns it upright (#4284); scores and estimates unchanged |
|
||||
| 2026-10-30 | minor | Contextual task bar: stays up through a click on another object, hides only for a drag (#4681); scores and estimates unchanged |
|
||||
| 2026-10-30 | minor | Draw Inside marks the corners of the object it draws into (#4319); scores and estimates unchanged |
|
||||
|
||||
Reference in New Issue
Block a user