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

Menu bar #929

Merged
merged 42 commits into from
Feb 29, 2024
Merged

Menu bar #929

merged 42 commits into from
Feb 29, 2024

Conversation

fatih-erikli
Copy link
Collaborator

@fatih-erikli fatih-erikli commented Oct 26, 2023

Fixes #1027

@fatih-erikli fatih-erikli marked this pull request as draft October 26, 2023 16:23
@justvanrossum
Copy link
Collaborator

Great start, thanks!

I haven't reviewed the code, but playing with it I notice two things:

  • the font size for the menu titles is too small, and should probably match those tof the menu-panel items
  • hovering the menu title only works once the menu bar has focus, or at least has been clicked once. I think it should always hover.

@justvanrossum
Copy link
Collaborator

Ok, trying again, and comparing with google docs: the behavior is fine, except the menu title should also highlight when hovering over.

@fatih-erikli
Copy link
Collaborator Author

fatih-erikli commented Nov 2, 2023

hovering the menu title only works once the menu bar has focus, or at least has been clicked once. I think it should always hover.

Ok. I copied the behavior of top bar in macos.

@fatih-erikli
Copy link
Collaborator Author

I did force push to rebase.

@justvanrossum
Copy link
Collaborator

This looks good, but I would like the items list to not be static. I think the items field should be a function instead, and be called getItems. It is then also important that this getItems function is only called when the menu is displayed, so that it really gets populated on-demand.

The same goes for sub-menu: a sub menu should be populated only right before it is displayed.

@justvanrossum
Copy link
Collaborator

(Also, please rebase again, also for sub-menu, although I'm a bit confused how that works, since the latter is a PR on menu-bar.)

@fatih-erikli
Copy link
Collaborator Author

Not ready for review yet.

@fatih-erikli fatih-erikli marked this pull request as ready for review January 26, 2024 12:59
@justvanrossum
Copy link
Collaborator

For now, let's do three links under "Help":

@justvanrossum
Copy link
Collaborator

Thanks for the refinements!

Further feedback:

  • The "Edit" menu doesn't work when a glyph is in edit mode
  • Glyph menu: add "Delete source menu...", "Edit local axes..."
  • Select previous/next source and Find glyphs that use ... should go under the Glyph menu
  • All menus that show a dialog (such as "Add source") should have titles that end with "..."
  • The Add source and Delete source menu's need dymanic enable/disable

@justvanrossum
Copy link
Collaborator

Select previous/next source and Find glyphs that use ... should go under the Glyph menu

Or would they be better under "View"?

@fatih-erikli
Copy link
Collaborator Author

I noticed one little bug, Esc key closes the open menu panel, but the panels keeps opening when hovering on other menu items.

@justvanrossum
Copy link
Collaborator

I noticed one little bug, Esc key closes the open menu panel, but the panels keeps opening when hovering on other menu items.

Can you fix it?

@justvanrossum
Copy link
Collaborator

Select previous/next source and Find glyphs that use ... should go under the Glyph menu

Like I commented later, I think they actually should go under "View".

`;

constructor(menuItems, position, positionContainer) {
constructor(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we simplify the constructor? I'm thinking all but the first arguments should go into an options object:

  constructor(menuItems, options) {

Since many of these are optional this should simplify things. Also, it makes it easier to add more if we need.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, you're right.

Copy link
Collaborator

@justvanrossum justvanrossum left a comment

Choose a reason for hiding this comment

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

Let's merge this! Looking good to me.

@justvanrossum justvanrossum merged commit fc9113a into main Feb 29, 2024
3 checks passed
@justvanrossum justvanrossum deleted the menu-bar branch February 29, 2024 07:57
@navv-1 navv-1 mentioned this pull request Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add titlebar / menubar
2 participants