MyGo 0.6.0
Native UI is much faster:
- windows redraw only what changed, on Metal, Direct3D 11, OpenGL and WebGL;
- layout redoes only what changed;
- windows out of sight draw nothing.
There is a new loading plugin, and the terminal plugin gains search, Kitty graphics and mirroring. Menus on Windows 11 look like Windows 11's own.
Upgrading from 0.5
- Windows, browser keys: WebView2's browser shortcuts (F5, Ctrl+R, Ctrl+P, Ctrl+F, Ctrl+Plus/Minus) no longer work in pages unless DevTools is on, as on macOS and Linux. Add
RoleZoomIn,RoleZoomOutandRoleResetZoomto your menu to keep zooming. - Windows, edit keys: WebView2 now performs a page's edit keys itself (Ctrl+C/V/X/Z/Y/A), so pages get real
pasteevents with HTML and images. A key you bound to an edit role yourself still runs your menu item. - Windows, trash:
Shell.TrashItemnever deletes for good. It returns an error when the file can't go to the Recycle Bin. - Tests:
ui.Tester.Click,ClickWithandRightClickreturn an error for an element outside the window. - Linux user agent: a
UserAgentSuffixwithout a version, such as"MyApp", is appended as it is, as on macOS and Windows.
Native UI
- Partial frames: only what changed is redrawn, on every GPU renderer. Metal and Direct3D present frames without blocking the main thread.
- Faster layout and painting: layout redoes only what changed, text is measured once per element, content clipped out of view isn't painted, and draws are batched into fewer calls.
- Windows out of sight draw no frames until they show again or get input.
- Effects no longer let GPU memory grow while their element animates.
- Selection: lists and tables choose blocks of cells and drag-select rows.
- New
ListStatefields:CellSelect,DragSelect,Cells,CellMenuandMenuKeepsSelection. - New
ListStatemethods:CellSelected,SelectColumns,ExtendToandScrollToEnd. - New
TableColumn.RowHeader.
- New
- Scrolling: mouse wheel scrolling glides smoothly.
- Layout: flexbox lays out as Chrome does, and rows and grids can align children by their baselines.
- Window buttons:
WindowOptions.HideWindowButtonslets a view draw the window's buttons.Element.MaximizeButtonbrings up Windows 11's snap layouts. - Paths too large for one mask now draw.
- Elements are keyed by what Go compares, so a pointer keys its object.
- Tester: new
Tester.WheelandTester.DropFiles. - Fixes:
Painter.Visibleis right under a transform;- a select's long list of options stays in the window;
- a field's label lines up with its control when a description follows;
- a list that follows its end no longer pushes its rows down when they fit;
- text typed through accessibility is inserted;
- a rich text leaving with a transition no longer crashes.
Code editor and diff view
- Very long lines and large files stay responsive.
- A diff set to
FitContentno longer leaves room for a scroll bar.
New: the loading plugin
plugins/loading draws loading.dev's 29 indicators in native UI. Run go run ./examples/loading for a tour.
Terminal plugin
- Search: search the scrollback with
Search,SearchNext,SearchPrevious,EndSearchandOnSearch. - Images: shows the images programs send with the Kitty graphics protocol, up to
Options.ImageLimit. - Mirroring:
Terminal.NewMirrormirrors a terminal for windows elsewhere. - Colors:
MinimumContrastkeeps text readable on its background;UseThemesets the theme;- programs learn the window's colors and light/dark mode;
PaddingColorlets the padding take the edge cells' colors.
- Links: the link under Command is underlined, and
HoveredLinktells the app which it is. - The app is told when a program copies to the clipboard (
OnCopy), and the terminal shows the pointer the program asks for. - Dropped files paste their paths, quoted for the shell.
- Clear from the context menu works as ⌘K does.
Windows
- Menus are drawn in Windows 11's style on Windows 11.
- Menu shortcuts work in windows of native UI; this is new on Linux too.
- Tray icons:
TrayOptions.IDkeeps the user's choice to show an icon;- template icons show white on a dark taskbar;
Tray.DarkandTray.OnAppearanceChangetell which bar the icon is on.
- Focus: a relaunched app comes back in front, and
App.Focuskeeps its window in front. - Flyouts can have a material and rounded corners:
FlyoutOptions.VibrancyandCornerRadius. SetProgressBarworks.- Documents: a document keeps its new contents when Windows stops a file replace halfway.
- Installer: non-ASCII app names and paths work in the installer.
macOS
- Notifications can show the sender's avatar:
NotificationOptions.Sender. - Tab reaches buttons and links in pages, as in Chrome. Set
PageOptions.SafariTabFocusfor Safari's behavior. - Tray icons stay where the user put them, and highlight while their popover shows.
- Printing: PDFs printed from pages keep their Chinese text.
- Text no longer wraps its last word at its measured width.
Linux
- Theme:
ThemeLightworks under a dark GTK theme, such as Ubuntu's dark mode. - Crashes fixed: on machines without a GPU, and when the OpenGL check frees its window.
Pages
PageOptions.UserAgentSuffixadds the app's name and version to the web view's user agent.
CLI and distribution
- Signing:
provisioningProfilein mygo.json embeds a macOS provisioning profile before signing;mygo publish -uploadstops when the update signing key is missing.
- Linux packages:
"linux": {"webview": false}packages native-UI apps without a WebKitGTK dependency. - Dev builds: the development app uses its icon's
-devvariant.
Updater
- It checks for updates soon after every launch.
- Its window follows the app's language.
Files and drags
- Documents follow their file when another app renames or replaces it, and tell a new file apart from an old one that had the same inode.
DragResult.EscapedandPointtell a drag let go over no target from one given up, and where it ended.
Contributors
Thank you @ACAne0320, @baranwang, @Bush2021, @dhruv1220, @echoVic, @ericluenglx, @firede, @gvenusleo, @HeroSizy, @mrzzmrzz, @roelfdiedericks, @saanuregh, @sorrycc, @xingkaixin, @xlanstar and @zzstar101.
Full Changelog: v0.5.5...v0.6.0