-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Conversation
The max-height value would be better served as a percentage instead of px. Can't believe that slipped passed me. |
I've played with % and so far that doesn't seem to work for some reason. Not sure if it only works when given a fixed value. |
@garethnic Fyi, someone else has started working on this recently too: https://groups.google.com/forum/#!topic/brackets-dev/BjcG9bF98l4 Hardcoded heights are problematic because not everyone's window is going to be the same height as yours. Ideally you could use percentages, but if not you'll need to calculate the max-height dynamically when opening the menu (or after every window resize, but on open seems preferable performance-wise...). |
Thanks for the link. I see Tuur went the JS route first and I'm trying to do it in CSS. Different approaches I guess. If Tuur can solve this then I'd be happy. I fully agree on using percentages, it breaks the menu bar though, so I'm going to have to figure it out somehow. I'm gonna see what I come up with. |
@garethnic Brackets uses native menus on Mac and Windows, and HTML menus on Linux (because native are not yet supported). Since this should only affect HTML menus, then I'm guessing that you are on Linux, right? FYI, as soon as someone implements native menus for Linux, we'll switch to those. Even for HTML, the max height should be set to the Brackets app height. My monitor has a height of 1200px, so I wouldn't want menus cut off at 700px. If you can figure out how to do that with CSS that's great, otherwise it'll have to be done with JS. Have you tried
UPDATE: |
Good News -- UPDATE: math using different units is not supported in LESS |
We can use |
@redmunds Yeah, I'm on Ubuntu. Any idea on when the native menus will happen in Linux? I'll be trying out your ( @redmunds & @TomMalbran ) suggestions. I was hoping someone could explain why |
@TomMalbran Ah, I forgot the Note: to test HTML Menus on Windows or Mac, make this edit to utils/Global.js
@garethnic Maybe you should just change it to |
This is for #7496 which is tagged for Sprint 39 so marked as Medium Priority. |
@redmunds Right I forgot that LESS will always try to do the calculations, so we need to use: We kind of want the |
Ooops. I had x/y mixed up -- that explains it. @garethnic FYI, |
@redmunds Exactly. I am thinking that Chrome might have changed the value of We should have a LESS variable for the height of the menu, and it will hopefully work in the code. |
Also need a variable for height of titlebar, so that can also be subtracted from viewport height. Note that these heights may be different on different OS'es. Maybe just use |
I thought that the viewport sizes didn't added the size of the chrome window, and it was just the size of the actual tab? |
I'm having issues getting |
There is a bug with vw units inside calc in blink, which is fixed in Chrome 34: https://code.google.com/p/chromium/issues/detail?id=168840. But Brackets uses an older version, even after the CEF update, which will bump Brackets to use chromium v33. The solution is to use 90vh, although it fails in really small windows and could work better in larger ones, but is good enough, or use JavaScript to calculate the height. |
@garethnic Try |
@SAplayer Read my comment, is not an issue with LESS but with Chrome. |
We may want to put this in a more specific selector -- in addition to the top menu bar, |
The other option is to actually do something in JS at the time the popup is opened -- calculating a max-size dynamically based on its vertical position. That would make the fix apply to all of these cases instead of just the menu bar, and it would eliminate the fuzziness with 90% only approximating the y offset.
|
@peterflynn But we'd need to recalculate on resize. |
From my testings with using max-height, the menu didn't changed size after resizing the window. So Recalculating on resize might still be required and a good option. Also, the 90vh, or even using calc (if it was possible) will not work for context menus, or menus like the recent projects one which pop from a different position. |
I played around with this and discovered exact window offset to be Since I haven't heard back from @garethnic, I went ahead and submitted pull request #7731 with a more isolated fix that I'd like to get in for this Sprint. |
No one read my Blink comment (#7693 (comment)) and still tried to play with calc? hehe |
@garethnic Thanks for the pull request, but we trying to close out Sprint 39, so I went ahead and made the changes (for html main menus) discussed above in a separate pull request. I am going to keep the original issue open so this also gets fixed for native main menus. @TomMalbran Good find! Yeah, I was too busy yesterday to read it :) Closing. |
This was an issue involving the drop down menus containing too many items that leaves "excess" items going off screen and not being able to see/select them.
My laptop screen resolution is 1366x768.
The code makes the drop down menus scrollable when it reaches the max height.