Skip to content

v0.2.0

Latest
Compare
Choose a tag to compare
@ecton ecton released this 28 Dec 03:32
· 110 commits to main since this release
0e33586

Breaking Changes

  • This crate has been renamed from Gooey to Cushy. Other than the name of
    the library changing, the only type to change name is Gooey -> Cushy. This
    changelog has had all references and links updated.
  • Many bounds required UnwindSafe due to a misunderstanding on how to handle
    this trait in appit. All requirements for UnwindSafe have been removed.
  • Cushy no longer implements default. To gain access to a Cushy instance,
    create a PendingApp or get a reference to the running App.
  • Window::new no longer accepts a Cushy parameter. The window now adopts the
    Cushy from the application it is opened within.
  • MakeWidget::into_window() no longer takes any parameters.

Changed

  • #92: When a Window is resizable and the root widget's layout()
    function returns a size larger than the window's inner size, the window will
    no longer be resized to fit. The content will be forced to render in the given
    space, which may result in clipping.

    Using a Resize widget in the root hierarchy allows setting minimum width and
    heights for the content.

Fixed

  • A memory leak has been fixed that prevented the underlying widget tree of each
    window from being dropped. This was caused by a reference counting cycle, and
    has been fixed by switching MountedWidget to use a weak reference internally
    and having the window hold the strong reference to the tree.
  • #112: Click-selection is handled correctly across graphemes now.
    Previously, code that was handling selecting between "ff" where cosmic_text
    had merged the two ASCII characters into a single glpyh was not honoring
    graphemes, allowing dragging selections inbetween multi-character glyphs.
  • #113: Input now constraints its internal selection to the value's
    length automatically. This fixes an issue where the backspace key no longer
    would work after clearing the text field by setting the Dynamic.
  • Validation callbacks are now associated with the Dynamic<Validation> being
    created rather than being persisted indefinitely on the source dynamic.

Added

  • Validations::validate_result attaches a Dynamic<Result<T,E>> to the
    validations. This was already available on when conditioned validations.

  • Dynamic::[try_]compare_swap allows swapping the contents of a dynamic after
    verifying the current contents.

  • #91: Multi-window support has been implemented. PendingApp allows
    opening one or more windows before starting the program. App is a handle to
    the running application that can be used to open additional windows at
    runtime.

    Open is a new trait that allows various types to open as a window given a
    reference to an application. This trait is implemented for all types that
    implemented Run, which means any type that was previously able to be run as
    a standalone executable can now be opened as a window within a multi-window
    application.

    The multi-window example demonstates using this feature to open multiple
    windows before starting Cushy as well as dynamically opening windows at
    runtime.

  • Window::on_close sets a callback to be invoked when the window has closed.

  • WindowHandle is a handle to a Cushy window. It enables requesting that the
    window closes, refreshing the window, or invalidating a widget contained in
    the window.

  • RunningWindow::handle() returns a WindowHandle for the current window.

  • RunningWindow::request_close() requests that the window should close. This
    ensures WindowBehavior::close_requested is invoked before the window is
    closed.

  • PendingWindow is a new type that can return a WindowHandle for a window
    that hasn't opened yet. This can be used to allow a widget on a window to
    close the window.

  • Style components for customizing default widget colors have been added:

    • DefaultForegroundColor
    • DefaultBackgroundColor
    • DefaultHoveredForegroundColor
    • DefaultHoveredBackgroundColor
    • DefaultActiveForegroundColor
    • DefaultActiveBackgroundColor
    • DefaultDisabledForegroundColor
    • DefaultDisabledBackgroundColor
  • CallbackHandle can now be added with other CallbackHandles to merge
    multiple handles into a single handle.

  • Dynamic::set_source allows attaching a CallbackHandle to a Dynamic,
    ensuring the callback stays alive as long as the dynamic has an instance
    alive.