Skip to content

Add restore glyph and support for restored window state in title bar#114

Merged
jpobst merged 5 commits intomodern-forms:mainfrom
ProGraMajster:feature/titlebar-restore
Apr 4, 2026
Merged

Add restore glyph and support for restored window state in title bar#114
jpobst merged 5 commits intomodern-forms:mainfrom
ProGraMajster:feature/titlebar-restore

Conversation

@ProGraMajster
Copy link
Copy Markdown
Contributor

This PR adds support for a restore glyph in the title bar.

The title bar buttons now correctly reflect the window state:

  • Maximize icon when the window is in normal state
  • Restore icon when the window is maximized

@jpobst
Copy link
Copy Markdown
Collaborator

jpobst commented Apr 1, 2026

Nice change! I think the icon isn't quite correct, the "front" window should "hide" the one behind it:

image

Right now it's two interlocking rectangles:

image

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a “Restore” glyph and updates the title bar’s maximize/restore button to reflect the current FormWindowState, improving visual correctness when toggling between Normal and Maximized.

Changes:

  • Introduces a Restore glyph option for title bar buttons and updates painting logic to render it.
  • Adds ControlPaint.DrawRestoreGlyph and a small SKCanvas.DrawPath helper for stroking SKPaths.
  • Updates FormTitleBar to switch maximize button glyph based on the current window state.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
src/Modern.Forms/FormTitleBar.cs Adds restore glyph support, a mutable glyph property, and logic to update the maximize/restore icon based on window state.
src/Modern.Forms/Extensions/SkiaExtensions.cs Adds a convenience DrawPath extension for stroking paths with a color/thickness.
src/Modern.Forms/ControlPaint.cs Implements the restore glyph drawing routine using overlapping “window” outlines.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@jpobst jpobst merged commit e4a96cb into modern-forms:main Apr 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants