Releases: kas-gui/kas
0.15.0
Most significant is the addition of the Collection
trait representing a list or tuple of widgets.
Uncategorized
- Bump MSRV to 1.80 (#457)
- Add struct
kas::config::Config
to house event/theme/font config (#449) - Make
PRIMARY
backend default and fix transparency (#452) - Add
kas::decorations
module (#452) - Rename
Application
→Runner
andkas::app
→kas::runner
(#456)
Event handling
- Add
fn EventState::send
andsend_erased
to allow sending a message to any widget (#429) - Assume
Action::UPDATE
from some handlers instead of requiring this explicitly (#432) - Remove event stealing and revise handling of disabled events (#453)
Layout
- Add trait
Collection
and macrokas::collection!
(#431) - Add trait
CellCollection
and macrokas::cell_collection!
(#443) - Replace trait
AutoLayout
withLayoutVisitor
using RPITIT (#434) - Replace
align!(spec DSL, child)
,pack!(spec DSL, child)
andmargins!(spec DSL, child)
with.align(hints)
,.pack(hints)
,.margins(dirs, style)
widget/layout adapters; more uniform support for adapters within and without layout macros (#438) - Pass
AlignHints
tofn set_rect
notsize_rules
(#447)
Widgets
- Make
kas::widgets::ImageError
public (#428) - Make
AdaptEvents
a thin wrapper withoutId
(#430) - Use RPITIT in traits
ListData
,MatrixData
(#433) - Remove widget aliases
StrLabel
,StringLabel
,StrText
,StringText
(#438)
Full Changelog: 0.14.2...0.15.0
0.14.2
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
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
andFlatTheme
to kas-core (#374) - Move
ShadedTheme
to kas-wgpu (#374) - Move
Shell
to kas-core. AddWindowSurface
,GraphicalShell
,ShellAssoc
traits for better abstraction of shell implementation. Addkas::shell::DefaultShell
. (#375) - Rename
ToolkitProxy
→Proxy
,TkAction
→Action
(#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
withPress::grab
builder pattern (#383)
Fixes
- Translate pop-up menus inside scroll regions (#373)
0.12.1
0.12.0
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'slayout
(#356) - Rename
{Text,}Button::on_push
toon_press
(#356) - Adjust
Driver::set
method; addDriver::set_mo
(#357) impl_singleton!
macro: remove impliedWidget
bound on fields usingimpl Trait
syntax, allow usage of_
andimpl Trait
within types (#359)- Rename
impl_singleton!
tosingleton!
, moving impl toimpl-tools-lib
(#360) - Re-export macros from
kas{,_core}
root instead ofmacros
module (#364) - Bump dependencies:
tiny-skia
v0.8.2,resvg
andusvg
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
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
; renameHandler::handle
→handle_event
(#309) - Merge
Handler
andWidgetConfig
traits intoWidget
(#312) - Replace
#[widget_core] core: CoreData
field withcore: widget_core!()
(#314) - Remove bound
Widget: Any
(and thus'static
) (#316) Window
trait simplified; newRootWidget
struct handles pop-ups (#318)- Add
Widget::steal_event
(#319) andWidget::pre_handle_event
(#324) - Trait
Scrollable: Widget
is now a core trait; new traitHasScrollBars
(#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)]
becomeswidget!
(#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!
intoimpl_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 byImage
andSvg
(#303, #321) - Add
float
layout (#322) - Revise
FrameRules
; addMarginStyle
(#348) - Add alignment hints to
AxisInfo
, removing fromset_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 WidgetId
s.
- 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
Manager
→EventMgr
,ManagerState
→EventState
(#266) - Disabled status is now a property of
EventState
, not of the widget (#292, #323) Response
enum loses most variants; newScroll
enum (#264, #309)- Add
Event::activate_on_press
, replacing `EventMgr::handle_generic (#311) - Replace
kas::event::Event::Activate
withkas::event::Command::Activate
(#323) - Replace
Manager::handle_generic
withWidget::pre_handle_event
(#324) - Add
Event::MouseHover
,Event::LostMouseHover
,Event::LostNavFocus
(#324) - New
ConfigMgr
type (introduced asSetRectMgr
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
DrawHandle
→ThemeDraw
,SizeHandle
→ThemeSize
(#327) - Merge most methods of
SizeMgr
into newfeature
,align_feature
methods over akas::theme::Feature
enum (#327) - Add
SimpleTheme
as base theme (#332) SizeMgr
: add methodsdpem
,min_scroll_size
; removepixels_from_*
(#334)- Clip text to widget rect (#336, #337)
- Auto-detect dark theme via
dark-light
crate (#337) - Rename
SizeMgr::text_bound
withtext_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
methodsborrow
,try_borrow
,update_mut
(#334) - Add
SharedData
trait as common base of all data model traits (#334) - Rename
DefaultView
→View
,DefaultNav
→NavView
(#335) - New
kas_view
crate for view widgets (#335)
Widgets
- New widgets
Mark
(#305, #316) andMarkButton
(#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
andRadioButton
infer layout direction from text direction (#332)- New
kas::widgets::edit
public module (#334) - Rename
DragHandle
→GripPart
(#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 onkas::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
intogallery
(#323) - Remove
stack_dst
dependency, which wasunsafe
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 askas::cast
) to 0.5.0, addingcast_approx
functionality (easy-cast#21)