Releases: 1j01/os-gui
Releases · 1j01/os-gui
v0.7.3 Taskbarless Minimization Fixes
Fixed
- Fixed positioning of windows when minimized without a taskbar. ce0a55d
- Fixed menu bar visibility when window is minimized without a taskbar. (It was typically offscreen, but you could reveal it by dragging the window.) 96e03a8
- Closing a window now frees up its minimize slot at the bottom of the screen (if there's no taskbar). Previously only unminimizing did this. 1f72e6f
I also (mainly) worked on adding lots of tests!
Full Changelog: v0.7.2...v0.7.3
v0.7.2
Full Changelog: v0.7.1...v0.7.2
Fixed
- Marked
options.elementandoptionsas optional inapplyCSSPropertiestype declarations. bcd463c + e84a778 - Added missing
forceparameter to$Window'sclosemethod in type declarations and documentation. 7b6caf8 - Changed
getIconAtSizereturn type toNode | null(fromHTMLElement) in type declarations, and mentioned that it can returnnullin the documentation. 80fea7b - (Also changed type of
private $icontoJQuery<Node>) 80fea7b - (Added
dockmethod requirement to deprecated$componentoption of$Windowconstructor, in type declarations.) 165d2b6 - (Removed weird
$G.off("scroll", onscroll);for non-existentonscrollin$Window.js. This didn't cause an error, sinceonscrollis a global event, but it shouldn't have been there.) 7a99593
v0.7.1
Full Changelog: v0.7.0...v0.7.1
Fixed
- Fixed an assertion error that was thrown when navigating menus with the keyboard, due to an overly broad condition. (I asserted that the type was HTMLElement, but needed to assert that it was either null or an HTMLElement. The assertion was just for type narrowing.)
v0.7.0
Full Changelog: v0.6.0...v0.7.0
Deprecated
- Deprecate
itemin favor oflabelfor menu item labels- This is just a clearer name for the property.
- Deprecate
shortcutin favor ofshortcutLabelandariaKeyShortcutsaria-keyshortcutsneeds "Control" spelled out, and for macOS "Meta" for the command key, unlike the traditional visual representations. Hence the separation of concerns.
Added
AccessKeysAPI for parsing and rendering labels with access keys (syntax:&defines the following character as the access key,&&inserts one literal ampersand)AccessKeys.escape(label)escapes ampersands by doubling themAccessKeys.unescape(label)unescapes ampersands by removing one of each pairAccessKeys.has(label)returns whether the label has an access keyAccessKeys.get(label)returns the access key character, ornullif there isn't oneAccessKeys.remove(label)returns plain text without access key indicator, likeAccessKeys.toText()but with a special case to remove parentheticals such as " (&N)" rather than just the ampersandAccessKeys.toText(label)returns plain text without access key syntaxAccessKeys.toHTML(label)returns HTML with<span class="menu-hotkey">around the access key (usesAccessKeys.toFragmentfor security)AccessKeys.toFragment(label)returns aDocumentFragmentwith<span class="menu-hotkey">wrapping the access key character- private
AccessKeys.indexOf(label)(don't use this) - (In the future, the CSS class "menu-hotkey" may be renamed to "access-key", perhaps with a prefix.)
- Radio menu item support
- TypeScript types for the whole library
- Type declarations are included as part of the
os-guipackage, inos-gui.d.ts - You may need to reference the declarations file explicitly in your
tsconfig.json'sincludeorfilesarray, or use a/// <reference path="node_modules/os-gui/os-gui.d.ts" />directive. I'm not sure how exactly this is supposed to work.
- Type declarations are included as part of the
$Windowmethods:- experimental
onFocus,onBlur, andonClosedAPI for events (looking to remove dependency on jQuery) - private
addChildWindow($window)(don't use this) - private
unminimize()(don't use this)
- experimental
$Windowproperties:closed: Whether the window has been closed.icons: The icons of the window at different sizes, as set byoptions.iconsorsetIcons().$minimize: the minimize button$maximize: the maximize button- private
$title_area(don't use this) - private
$icon(don't use this)
$Windowpropertyelement(already mentioned but now has a section like other properties)- Menu item specification properties:
shortcutLabelfor defining the label of the shortcut key combination separately from theariaKeyShortcutsproperty; this replaces the oldshortcutpropertyariaKeyShortcutsfor defining the access key combination for the menu item. Must follow aria-keyshortcuts syntax.labelfor defining the label of the menu item; this replaces the olditempropertyvalue(only for radio items) for defining a radio option value
- Docs for positioning windows
Changed
- Handle synthetic events, including when pointerId is not given
- This is for jspaint, which triggers pointerup when pressing both mouse buttons to cancel a drawing gesture, and on blur.
- Make menu bars wrap to multiple rows when needed
- Close menus if focus leaves menu popups and menu bar
- If you click on the empty space on the menu bar, it should close menus, not just unhighlight.
- This also seems to fix the case where a window is closed while menus are open (you can test this with the Trigger Station in test.html)
- Improve menu bar code and some behavior
- Prevent some unnecessary DOM updates with highlighting and opening/closing.
- Check for specific menu bar instance when testing focus
- Make menu bar only ever close its own menu popups
- Reduce redundancy in menu closing code
- Fix cycling behavior with Up key: pressing up in a menu opened by clicking (such that the first item isn't automatically highlighted) now goes to the bottom item, instead of the top item (or the second-to-bottom item if you had hovered a menu item within and then moved the mouse out). It still focuses the top item if you open the menu via up/down arrow as this matches the Windows 98 behavior for using the keyboard.
- This commit might actually break closing menu popups in the case that the menu bar is removed from the DOM, because it relies on sending events...
- (I'm not sure if I followed up on this.)
- Use event.key instead of event.keyCode
- Prevent entering disabled submenus [with the keyboard?]
- Don't dispatch update events when hovering menu items
- This only affects the Schrödinger's Checkbox as far as I know, and arguably makes it more thematic, since it only changes when "observing" it.
- (Should it be called Schrödinger's Tick, btw? haha, gross.)
- Make menu popups inherit the theme from the menu bar
- Patch drag handling for Eye Gaze Mode in JS Paint
- Fix menu button border offset on press, and oscillating menu opening when hovering between two menu buttons
- Fix: keep menu button highlighted if clicked to close
- Highlight/open menus when moving mouse at all while over menu button
- Fix: don't trigger menu items if holding Ctrl
- For example, in Paint, with the Help menu open, Ctrl+A shouldn't open About Paint, it should Select All, using the app-global keyboard shortcut.
- SVG icons for checkbox/radio/submenu icons are now defined in CSS using
mask-image - Fix subpixel issues with menu button borders, and margin-bottom (and greatly simplify, by adding a wrapper span)
- Refocus last focused control outside menus on close to support copy/paste
- This generalizes refocusing the last focused control within the window to also work for controls outside the window, I think?
- Fix setting window title to empty string
- Previously, it returned the current window title instead of clearing it, due to incorrect handling of falsy values when differentiating between getter/setter method signatures.
MenuBarmenu item propertydescriptionis now optional.
Fixed
see Changed