Skip to content

Releases: kas-gui/kas

0.14.2

14 Dec 15:43
66c58eb
Compare
Choose a tag to compare

The focus of this version is input data: widgets now have a Data associated type, passed by reference
to event handlers and to a new update method. The key advantages of this change are:

  • Declarative specification of trees with changeable widgets. For example, before this change a counter must construct a label displaying the initial count and explicitly update this label when the count changes; now the displayed label is effectively a function of the count.
  • As a direct result of the above, it is no longer necessary for parent nodes to refer to children by name, thus it is no longer necessary to use structs with named fields (at least in the common cases).
  • "View widgets" are now much more tightly integrated with other widgets, making the SingleView widget redundant.

For more on input data, read the design document.

For the full list of changes, see the CHANGELOG.

0.13.0

28 Feb 09:08
15dd050
Compare
Choose a tag to compare

Changed behaviour

  • Canvas uses async rendering (#376)
  • Svg uses async rendering (#378)
  • Improved momentum scrolling (#381)
  • Support primary buffer (middle-click clipboard) on Linux (#383)

Additions

  • Add EventMgr::push_async, push_spawn (#376)
  • Support transparent windows (#380)
  • Support borderless windows and basic toolkit-drawn titlebar (#380)
  • New GrabMode::Click (#383)
  • Add PressSource::is_secondary, is_tertiary (#383)
  • Add EventMgr::get_primary, set_primary (#383)

Other changes

  • Move theme traits, SimpleTheme and FlatTheme to kas-core (#374)
  • Move ShadedTheme to kas-wgpu (#374)
  • Move Shell to kas-core. Add WindowSurface, GraphicalShell, ShellAssoc traits for better abstraction of shell implementation. Add kas::shell::DefaultShell. (#375)
  • Rename ToolkitProxyProxy, TkActionAction (#375)
  • Widget::handle_message is now called on the widget submitting a message (#376)
  • Update to Winit 0.28, Wgpu 0.15, dark-light 1.0 (#379)
  • Switch from window_clipboard to arboard + smithay-clipboard (#383)
  • Cancel existing mouse grab when requesting a new one (#383)
  • Change data structure of Event::PressStart, PressMove, PressEnd (#383)
  • Replace EventMgr::grab_press with Press::grab builder pattern (#383)

Fixes

  • Translate pop-up menus inside scroll regions (#373)

0.12.1

22 Dec 15:02
Compare
Choose a tag to compare

Fixes

  • Use PresentMode::Fifo, improving compatibility with older Intel graphics, at the cost of some hangs with multiple windows on X11 (#369)
  • Fix mouse highlighting for Spinner widget (#369)
  • Show mnemonic (AccelLabel) hints with Alt key when edit field has focus (#369)

0.12.0

13 Dec 20:08
3c41cc9
Compare
Choose a tag to compare

Stabilise support for Generic Associated Types (GATs). This requires Rust 1.65.0, removes the gat feature flag, revises the SharedData{,Mut}, ListData and MatrixData traits. #357

Breaking changes

  • Forbid usage of non-#[widget] fields in a widget's layout (#356)
  • Rename {Text,}Button::on_push to on_press (#356)
  • Adjust Driver::set method; add Driver::set_mo (#357)
  • impl_singleton! macro: remove implied Widget bound on fields using impl Trait syntax, allow usage of _ and impl Trait within types (#359)
  • Rename impl_singleton! to singleton!, moving impl to impl-tools-lib (#360)
  • Re-export macros from kas{,_core} root instead of macros module (#364)
  • Bump dependencies: tiny-skia v0.8.2, resvg and usvg v0.28.0 (#362, #366)
  • Bump depencency: wgpu v0.14 (#362)

Other changes

  • Fix tab navigation to loop when first result is None (#356)
  • Fix input state for view widgets with changed data binding by fully resetting the widget (#365)
  • Add SingleDataMut trait (#357)
  • Add DrawMgr::draw_iface (#366)
  • Bump dependency: impl-tools-lib v0.7.0 (#357, #360, #366)
  • Bump dependencies: env_logger v0.10 (#366), kas-text v0.6.0 (#366)
  • New dependency: maybe-owned v0.3.4
  • Move Clippy lint configuration to CI runner (#359)
  • Adjust code formatting (#361)

0.11.0

05 Sep 15:09
d42e3d3
Compare
Choose a tag to compare

With a year since the previous release, KAS v0.11 sees a lot of changes. In the interest of brevity, the list below is incomplete.

Widget trait revision

One of the major nuisances with KAS v0.10 and earlier was the that dyn Widget was not a valid type since the associated Handler::Msg type must be specified. KAS v0.11 removes this associated type (#309), replacing it with a variadic message stack, thus making dyn Widget a valid (unsized) type.

  • Add fn WidgetCore::identify, returning a printable type (example result: TextButton#01) (#266)
  • New trait WidgetExt: Widget (#286)
  • Add Widget::handle_message; rename Handler::handlehandle_event (#309)
  • Merge Handler and WidgetConfig traits into Widget (#312)
  • Replace #[widget_core] core: CoreData field with core: widget_core!() (#314)
  • Remove bound Widget: Any (and thus 'static) (#316)
  • Window trait simplified; new RootWidget struct handles pop-ups (#318)
  • Add Widget::steal_event (#319) and Widget::pre_handle_event (#324)
  • Trait Scrollable: Widget is now a core trait; new trait HasScrollBars (#324)

Macros

This cycle saw the development of the #[autoimpl] and impl_scope! macros which were split out into a new impl-tools crate in #300.

  • #[derive(Widget)] becomes widget! (#258) becomes #[widget] (#300)
  • Auto-detect which traits have manual impls (#258) and merge generated methods into manual impls (#312, #335)
  • impl Self syntax (#258, #300)
  • New #[autoimpl] macro as a more capable version of #[derive] (#258, #272, #293, #294)
  • Revise make_widget! into impl_singleton! (#272, #317)
  • New widget_index! macro (#291)

Layout and margins

Widgets may now have complex internal layout, defined by a domain-specific macro language (#259, #282, #304, #306, #314, #316, #322, #345, #348, #350).

  • Better text, EditBox margins (#283)
  • Menu entries use interior margins (#283)
  • Fix initial window size on Wayland (#298)
  • New struct PixmapScaling used by Image and Svg (#303, #321)
  • Add float layout (#322)
  • Revise FrameRules; add MarginStyle (#348)
  • Add alignment hints to AxisInfo, removing from set_rect (#350)

Configuration, WidgetId

Partial (localised) widget configuration is now possible (#276, #299).

The WidgetId type is now a path (#264, #265). As a result, WidgetId is no longer Copy but persistent identifiers for
view widgets over a specific content are possible (#282). Further, it is possible to determine whether one widget is the ancestor of
another purely by comparing WidgetIds.

  • Breaking: Ord for WidgetId now considers a parent to come before its children
  • Add WidgetChildren::make_child_id (#313, #330)

Event handling

The widget trait revision (#309) introduced a variadic message stack (EventMgr::push_msg and EventMgr::try_pop_msg methods), and allowed the implementation of a generic EventMgr::send routing method replacing the SendEvent trait, as well as removal of VoidMsg.

Momentum (flick) scrolling is now supported (#268).

  • Rename ManagerEventMgr, ManagerStateEventState (#266)
  • Disabled status is now a property of EventState, not of the widget (#292, #323)
  • Response enum loses most variants; new Scroll enum (#264, #309)
  • Add Event::activate_on_press, replacing `EventMgr::handle_generic (#311)
  • Replace kas::event::Event::Activate with kas::event::Command::Activate (#323)
  • Replace Manager::handle_generic with Widget::pre_handle_event (#324)
  • Add Event::MouseHover, Event::LostMouseHover, Event::LostNavFocus (#324)
  • New ConfigMgr type (introduced as SetRectMgr in #266, renamed in #330)
  • Add EventMgr::next_nav_focus_from (#347)

Themes and drawing

Support animations, driven by the theme or the widget (#269, #270, #271, #321).

  • New SizeMgr, DrawMgr types wrapping theme size/draw interface (#266)
  • Rename DrawHandleThemeDraw, SizeHandleThemeSize (#327)
  • Merge most methods of SizeMgr into new feature, align_feature methods over a kas::theme::Feature enum (#327)
  • Add SimpleTheme as base theme (#332)
  • SizeMgr: add methods dpem, min_scroll_size; remove pixels_from_* (#334)
  • Clip text to widget rect (#336, #337)
  • Auto-detect dark theme via dark-light crate (#337)
  • Rename SizeMgr::text_bound with text_rules and revise (#338)

Visual tweaks include a "tick" mark for CheckBox (#298) and removal of "glow shadows" (#327).

Data models

Data changes are now notified via broadcast (#323), using a version number to check whether a view is current (#266, #289).

Driver trait impls are now also responsible for handling messages from view widgets via the new Driver::on_message method (#334).

  • New filters ContainsString, ContainsCaseInsensitive (#248)
  • Add SharedRc methods borrow, try_borrow, update_mut (#334)
  • Add SharedData trait as common base of all data model traits (#334)
  • Rename DefaultViewView, DefaultNavNavView (#335)
  • New kas_view crate for view widgets (#335)

Widgets

  • New widgets Mark (#305, #316) and MarkButton (#319)
  • New widget dialog::TextEdit (#318)
  • New widget Spinner (#319, #334)
  • New widget TabStack (#321)
  • Invisible scroll bars (#324)
  • Renames: CheckBox, CheckButton, RadioBox, RadioButton, RadioGroup (#330)
  • CheckButton and RadioButton infer layout direction from text direction (#332)
  • New kas::widgets::edit public module (#334)
  • Rename DragHandleGripPart (#339)

Features & misc

  • The minimum supported Rust version (MSRV) is now 1.62.0 (#256, #335).
  • Use (some) Clippy lints (#256)
  • #[must_use] annotations were added to methods returning a modification of self (#264, #266)
  • Use easy-cast traits for conversions on kas::geom types (#284)
  • Handle window focus gain/loss (#292)
  • Make &EventState available to (theme) DrawHandle (#292)
  • Do not panic when attempting to draw un-prepared text (#312)
  • Merge example filter-list into gallery (#323)
  • Remove stack_dst dependency, which was unsafe and used only as a premature optimisation (#335)
  • Update to WGPU 0.13 (#340) and winit to 0.27 (#351)
  • Bump easy-cast dep (re-export as kas::cast) to 0.5.0, adding cast_approx functionality (easy-cast#21)