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

Remove Application menu when needed #104

Open
hampton8 opened this issue Dec 23, 2020 · 26 comments
Open

Remove Application menu when needed #104

hampton8 opened this issue Dec 23, 2020 · 26 comments

Comments

@hampton8
Copy link

When there are a lot of icons in the menu bar, some of the leftmost ones can end up being hidden by the current application's left menu. The implementation of a feature such as Bartender 4's 'Remove Application menu when needed' would solve this.

Here is Bartender's description of the aforementioned function:

If any revealed items would be hidden by the current application's left menu (when they are being shown), Bartender will remove the application's menu. Due to a limitation in macOS, Bartender's dock icon will be visible while the left menu is removed.

Can this functionality be added to Hidden Bar so that icons don't end up being out of view?

@viettrungphan
Copy link
Contributor

viettrungphan commented Dec 24, 2020 via email

@hampton8
Copy link
Author

No problem @viettrungphan

I understand the solution you have explained, but as I'm sure you'll agree it's far from ideal and is rather inconvenient, so an integrated solution for this limitation would be really useful, especially since Big Sur increased the spacing between menu bar icons so it's even easier to fill up the very limited space up there.

Please do let me know if you need a screen recording of how Bartender 4 handles this (or if you want to experience it yourself, they currently have an indefinite public beta free trial).

All the best and Happy Holidays!

@jjljservices
Copy link

I have the same issue on laptop screen. Example is Microsoft Edge - a lot of menu items. I had already figured out the work-around but it is cumbersome. Thank you!

@CaptainVincent
Copy link

I saw some guy use accessmenubarapps and hidden at the same time achieve this feature. (Setup two applications with the same hotkey). But this combination not always work perfectly.

@pySilver
Copy link

This is really good missing feature for small screens!

@gingerbeardman
Copy link

Dozer has this feature (disclaimer: I programmed the feature)

@pySilver
Copy link

@gingerbeardman I'm heading to downloads section then! :)

@hampton8
Copy link
Author

Dozer has this feature (disclaimer: I programmed the feature)

Just downloaded Dozer to try it and the feature isn't working for me; icons that overlap the application menu are hidden just as is the case with Hidden Bar. Am I missing something?

@viettrungphan
Copy link
Contributor

this easy to implement using the accessibility framework (to read and interact with everything on the screen), however at the beginning of this project we don't want to do it since it violated AppStore policy. That is the reason why you see Bartender guide you to enable accessibility and screen record.
We have Vimmotion app you can have a quick look to see what we can do with that framework seriously.
https://github.com/dwarvesf/VimMotionApp

@gingerbeardman
Copy link

Hi the last comment makes no sense to me.

I implemented the feature in Dozer without using the accessibility framework.

@gingerbeardman
Copy link

Just downloaded Dozer to try it and the feature isn't working for me; icons that overlap the application menu are hidden just as is the case with Hidden Bar.

Am I missing something?

Surely you are missing something, as the feature works has been working for many months. I use a portrait display so I use this every day. Did you switch the feature on? It's not on by default.

Anyway, this isn't the best place for Dozer support. I'll be happy to help you further over at Dozer repo.

@viettrungphan
Copy link
Contributor

viettrungphan commented May 25, 2021

@gingerbeardman I just try Dozen and dont see it work.
My understanding:

  1. The Left menus is something on the Left hand (🍏 AppName File Edit View History...)
  2. Those menu change by app, change focus between app changing them.
  3. Depending on app, the size of Left Menu count by sum of number of items and length of Text.
  4. Left menu have higher priority than Right Status menu.
  5. When don't have enough space Right menu should hide icon(s) on the left to let Left Menu show all of they menus.
  6. The featured user request above is: Depending on Left menus length we need detect it and hide - show "Hiden bar" menu bar icons automatically (to save a bit space).
    I don't know how to get the "Left menu size" and "Right menu size" to compare without accessibility. I guest we can listen to active window change event to recheck it somehow.

@gingerbeardman
Copy link

It's in Dozer 4.2.0 https://github.com/Mortennn/Dozer/releases

@pySilver
Copy link

@viettrungphan so, this feature is not going to be implemented any time soon in hidden app?

@viettrungphan
Copy link
Contributor

thanks, the version from brew is 4.0

@viettrungphan
Copy link
Contributor

@viettrungphan so, this feature is not going to be implemented any time soon in hidden app?

If possible I going to add it for the next release.

@pySilver
Copy link

@viettrungphan Thank You :)

@viettrungphan
Copy link
Contributor

Sorry for the misunderstanding, thought Hiddenbar should hide both of the app icons (|>) automatically to save a little bit of space when needed, don't think you guys need to clean all the left-hand side by active the Hidden app using the shortcut.

@viettrungphan viettrungphan reopened this May 25, 2021
@gingerbeardman
Copy link

gingerbeardman commented May 25, 2021

Some screenshots of my menubar (I use a "narrow" portrait display) and details of the feature in this old Dozer issue Mortennn/Dozer#111

@viettrungphan
Copy link
Contributor

Thanks, I know how to do this, just simple change app active policy, remove all existed menu + active ignore other app.

@viettrungphan
Copy link
Contributor

viettrungphan commented May 26, 2021

Guys, I'm done, it simple than I thought. 4 primary lines of code
if Preferences.useFullStatusBarOnExpandEnabled {
NSApp.setActivationPolicy(.regular)
NSApp.activate(ignoringOtherApps: true)
}

if Preferences.useFullStatusBarOnExpandEnabled {
NSApp.setActivationPolicy(.accessory)
NSApp.deactivate()
}
Screen Shot 2021-05-26 at 16 38 41

@viettrungphan
Copy link
Contributor

viettrungphan commented May 26, 2021

Screen Shot 2021-05-26 at 16 42 07

@gingerbeardman
Copy link

I think label should read "menu bar" not "status bar"?

@viettrungphan
Copy link
Contributor

@gingerbeardman not sure which one. I come from iOS, they call StatusBar on iOS. All the buttons when coding prefix NSStatusBar so I use it. Any idea?

@gingerbeardman
Copy link

gingerbeardman commented May 26, 2021

Officially, Apple refer to it in user-facing docs as menu bar and the items are menu bar extras.

Though I do see your point regarding iOS and NS prefix. It's a mess 🤦

https://developer.apple.com/design/human-interface-guidelines/macos/extensions/menu-bar-extras/

Screen shot 2021-05-26 at 13 04 06

@gingerbeardman
Copy link

gingerbeardman commented Jun 4, 2021

Using this feature menu bar takes focus.

Focus should remain with foreground application.

  1. Enable "use full menu bar" feature
  2. Switch to Safari
  3. Click hidden bar marker

Expected

  • Safari should keep focus

Actual

  • hidden menu bar has focus

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

No branches or pull requests

6 participants