Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Window] Add APIs for configuring the window title pane #23

Closed
TheDome0 opened this issue Apr 11, 2022 · 6 comments
Closed

[Window] Add APIs for configuring the window title pane #23

TheDome0 opened this issue Apr 11, 2022 · 6 comments
Assignees
Labels
1.3 - December Release 1.3 - 2022.H2 Breaking change Marking changes that break backwards compatibility

Comments

@TheDome0
Copy link

undecorated = true disables os decoration but adds an Aurora specific frame and title bar to the window.

Aside from pure design aspects regarding the border or button icons (minimize, maximize, close), sometimes not all buttons are desired or even new, custom components are needed. The menu bar isn't always sufficient for this.

Opera GX might be a good example of what could be possible
image

@TheDome0 TheDome0 changed the title [Window] Option for blank window without Aurora decorations [Window] Option for undecorated window without Aurora decorations Apr 11, 2022
@kirill-grouchnikov kirill-grouchnikov self-assigned this Apr 11, 2022
@kirill-grouchnikov kirill-grouchnikov added the 1.2 - Cryo Release 1.2 - 2022.H1 label Apr 11, 2022
@kirill-grouchnikov
Copy link
Owner

So I want to take a bit of time to make the right APIs for this area. From my current experience with Radiance, there are 2/3 layers to this:

  1. Marking a window to be decorated or undecorated.
    2a. Marking the content of a window to extend into a custom decorated title pane area.
    2b. Providing APIs to contribute decorated title pane area content that is styled consistently.

Addressing the first one would require a breaking change in AuroraWindow, replacing the Boolean decorated flag with a enum: System (default, title pane is provided by the operating system), Themed (name to be finalized, title pane is provided by Aurora), None (no title pane).

The second part is to enable the so-called "unified" title pane appearance (different UI toolkits call it a different name):

visor1

visor2

The last part is to allow app code to add one or more title pane control buttons (in addition to minimize, maximize and close) and have those be styled consistently by Aurora.

Ideally, all of these would be done in a single pass for a more coherent and cohesive API surface, so it might take a bit.

@kirill-grouchnikov
Copy link
Owner

I'm going to move this (and an additional Window-level API to allow the app to "participate" in the user decision to close the window) to version 1.3.

@kirill-grouchnikov kirill-grouchnikov added 1.3 - December Release 1.3 - 2022.H2 and removed 1.2 - Cryo Release 1.2 - 2022.H1 labels May 8, 2022
kirill-grouchnikov added a commit that referenced this issue Oct 28, 2022
Unify the two separate `AuroraWindow` composables into a single one, and update all the sample usages that allow changing skin at runtime to use the proper tracking of mutable state.

The overall window API evolution planned for 1.3 is tracked by #23
@kirill-grouchnikov kirill-grouchnikov added the Breaking change Marking changes that break backwards compatibility label Oct 28, 2022
kirill-grouchnikov added a commit that referenced this issue Nov 14, 2022
* Replace `undecorated` in `AuroraWindow` with the new `AuroraWindowConfiguration`
* Supports three title pane kinds - system, Aurora and none
* Supports configuring horizontal gravity of the app icon, the app title and the app control buttons under Aurora pane kind
* Supports configuring title pane height and vertical gravity of the control buttons

For #23
kirill-grouchnikov added a commit that referenced this issue Nov 14, 2022
After the changes that just went in for #23
@kirill-grouchnikov
Copy link
Owner

chat-frame

kirill-grouchnikov added a commit that referenced this issue Nov 15, 2022
Instead of a single configuration data class that provides all options, even as some of them are not relevant to a particular configuration, use a sealed hierarchy of classes for:

* OS-provided title pane
* No title pane
* Plain Aurora title pane with configurable horizontal gravity for the app icon, app title and control buttons
* Integrated Aurora title pane with configurable horizontal and vertical gravity for the control buttons, and the title pane height

For #23
@kirill-grouchnikov
Copy link
Owner

This is now available in 1.3-SNAPSHOT.

https://github.com/kirill-grouchnikov/aurora/blob/icicle/demo/src/desktopMain/kotlin/org/pushingpixels/aurora/demo/AuroraTitlePaneDemo.kt has some sample code for configuring the positioning of app icon, title and control buttons for windows decorated by Aurora.

https://github.com/kirill-grouchnikov/aurora/blob/icicle/demo/src/desktopMain/kotlin/org/pushingpixels/aurora/demo/titlepane/ChatFrame.kt is a simple example of an integrated title pane where the app content extends into the window title pane (screenshot from a couple comments above).

I will add another demo in the next few days, and add documentation on using these APIs.

@kirill-grouchnikov
Copy link
Owner

mail-frame

From this demo

kirill-grouchnikov added a commit that referenced this issue Nov 17, 2022
For #23 (window title pane) and #52 (highlight painters)
@kirill-grouchnikov kirill-grouchnikov changed the title [Window] Option for undecorated window without Aurora decorations [Window] Add APIs for configuring the window title pane Nov 17, 2022
kirill-grouchnikov added a commit that referenced this issue Nov 17, 2022
@kirill-grouchnikov
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.3 - December Release 1.3 - 2022.H2 Breaking change Marking changes that break backwards compatibility
Projects
None yet
Development

No branches or pull requests

2 participants