Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Optimize titlebar space on Windows #3854

Merged
merged 17 commits into from
Sep 21, 2016
Merged

Optimize titlebar space on Windows #3854

merged 17 commits into from
Sep 21, 2016

Commits on Sep 20, 2016

  1. Custom window action bar to address #3126 #3036

    Radoslav Vitanov authored and bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    63914e2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    86f2f53 View commit details
    Browse the repository at this point in the history
  3. Optimize titlebar space on Windows (initial implementation)

    Reworked styles for caption buttons.
    - Windows 10 styles are implemented
    - Windows 7 styles are implemented
    - Styles have minor issues, but are really close. The close button on both needs work.
    - Removed the now unused SVG files
    
    New Menubar control and styles.
    Fixes #3036
    
    This includes:
    - AppStore has value for menubarTemplate
    - WindowStore has value for menubarVisible
    - Updates to `states.md`
    - Toggle now works via ALT; menubar can be shown/hidden.
    - `main.js` will now show only the caption buttons (min/max/close) OR the menu and caption buttons.
    - Clicking MenubarItem control will pop up a contextMenu control
    - Wired up ContextMenu (popped up by menubar) to call new `clickMenubarItem` action
    
    Also included:
    - Removed unused getParentMenuDetails method from `siteUtils.js`
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    a20ab35 View commit details
    Browse the repository at this point in the history
  4. Fixing known issues:

    - Moved windowCaptionButtons control to new preferred location
    - Added title element to min/max/restore/close caption buttons
    - Menu font is now fixed 12pt; It's probably a good idea to set a face (currently it defaults to using system font)
    - Menu now lines up properly with caption buttons. It also has proper padding on top/bottom per Brad's mockup
    - Set a height for the menubar control (same height as the win10 caption
      buttons. This allows the draggable CSS properties to properly work,
      making the window easy to move.
    - Menubar now respects the AUTO_HIDE_MENU setting
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    8fcf66a View commit details
    Browse the repository at this point in the history
  5. Navigation bar now is properly contained separate of the caption butt…

    …ons.
    
    This works exactly like we want. However, the modals that can be popped up
    are showing up inside the container. Looking at a fix for that...
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    f2426f1 View commit details
    Browse the repository at this point in the history
  6. Fixing known issues:

    - Fixes to properly position the modals and URL suggestions
    - Toggle method for menu can now include bool; default is that it'll toggle.
    - Remove unused style
    - Menubar items now auto-popup context menu when moused over (if one was
      initially clicked). This selection is not cleared yet but otherwise works
      great
    - Menus now close (and autohide themselves) after selection is cancelled
      - new selectedLabel state w/ action
      - created new resetMenu action which closes context menus, popup menus,
        and this new menubar control (if needed).
      - updated main.js to call resetMenu
    - Menu hides after selection made (when auto-hide is true)
    - Fix issue where pressing alt (even when auto-hide menu is disabled) hides context menus.
    - Keyboard accelerators now show on context menus. Mac version may not look
      right, needs to be tested.
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    3199f4b View commit details
    Browse the repository at this point in the history
  7. Fixing known issues:

    - Small fixes after testing context menu accelerators on Mac. Also includes lint cleanup and docs generation.
    - Fix navigation button spacing; original commit by @Sh1d0w bumped it from 4px to 14px.
      Besides fixing spacing, this also fixes the stretched out when hover issue.
    - Windows now has a 5px margin to the left of navigator buttons
    - Broke out accelerator formatting to a new file and added unit tests to
      ensure the logic is correct (glad I did- there were missing use-cases).
    - Updated accelerator style in context menu to be the same size as the item itself
    - Removed max-width of 300 for context menu (to prevent overflow)
    - Updated font style/size for context menu (windows only)
    - Fix the resize border problem
    - Fix menu font face (windows)
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    05e8b85 View commit details
    Browse the repository at this point in the history
  8. Fixing known issues:

    - Added border around window (only affects Windows when frameless).
    - Fix font size on context menus (for accelerators)
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    05b8a21 View commit details
    Browse the repository at this point in the history
  9. Fixing known issues:

    - Removed border on top since that now works; starting to finalize the X with Brad
    - Windows 7 fixes
      - fix button size
      - new svg for close
      - fix margin
      - color updates
    - updated naming in main.js; menubar text no longer selectable
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    2e0c1ec View commit details
    Browse the repository at this point in the history
  10. Fixing known issues:

    - Caption buttons and border are now hidden when a window goes fullscreen
    - Fix context menu accelerator size (windows only)
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    c30a607 View commit details
    Browse the repository at this point in the history
  11. rev1 of keyboard shortcuts for menus

    - selection can be made left and right
    - menu can be popped up with up/down
    
    known issues (what's left)
    - storing the context menu's selected index in windowStore
    - properly handling up/down (changing selection)
    - handling submenus
    
    also includes:
    - small cleanup for custom titlebar in main.js
    - lint cleanup
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    beeab7e View commit details
    Browse the repository at this point in the history
  12. Rev2 on the keyboard controlled menus

    Menu fixes
    - You can now hit enter to pick a selected menu item
    - Fixed bug where menu opened by keyboard was not clickable
    
    Cleanup
    - Added reducer property which retuns a menu minus the separator items
    - Moved wrappingClamp method into formatUtils
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    39fe326 View commit details
    Browse the repository at this point in the history
  13. Fixing known issues:

    - Menu now sets default selection when you press ALT to show it
    - Menu now behaves properly when always displayed (auto-hide=false)
    - ALT and ESC now are properly handled; providing windows-like behavior
      (deselect and/or closing menu, etc)
    - Fix click problem with extension button (it was tagged as draggable)
    - Windows specific fixes for drag. Tested each area that was changed,
      comparing this build to 0.12.1 to make sure it's consistent.
    - menu now returns focus properly to active web frame
    - the pseudo click now sends over webContents (required for cut/copy)
    - Bumped up minimum viewport width to 640px for Windows only.
      Media query strips margin left of the brave button unless you're at 720px
      or more (again- windows only)
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    1daef9a View commit details
    Browse the repository at this point in the history
  14. Fixes:

    - Properly handle all accelerator modifiers (was missing CommandOrControl
      and some replacement cases)
    - Updated code to skip rendering / processing for hidden context menu items
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    02564f1 View commit details
    Browse the repository at this point in the history
  15. Fix issue w/ last commit, added cleanup after evaluating moving menu …

    …from
    
    appState to windowState (not going to move it after talking w/ @bridiver).
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    c0240a5 View commit details
    Browse the repository at this point in the history
  16. Window can be as skinny as 480px wide on Windows now without issues.

    Works well with URL bar always showing and also with title mode.
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    75365f0 View commit details
    Browse the repository at this point in the history
  17. Fixes focus issues by:

    - capturing the browser's selection changes
    - converting the activeElement object to a selector
    - returning focus after menu is interacted with by:
      - using document.querySelectAll() to return focus to original element
      - executing window action which actually handles the menu action
    
    This commit also cleans up `main.js` by properly encapsulating the
    handlers required into a new method, `registerCustomTitlebarHandlers`
    
    cc: @bbondy
    bsclifton committed Sep 20, 2016
    Configuration menu
    Copy the full SHA
    39d2b0c View commit details
    Browse the repository at this point in the history