- Improved logic for generating debug box overlay colors when setting
rtk.debugto true. Previouslymath.random()was used with a fixed seed, which significantly weakened random number generation for other uses. - The
rtk.Window.onclose()event handler is now invoked on all script exit conditions if the window is open - Minor documentation improvements
- Fixed a crash caused by setting
rtk.Window.worrtk.Window.hattributes to nil (which denotes autosizing) within an event handler (#20) - Fixed a crash when calling
rtk.Image:blur()before the image has been loaded - Fixed stack overflow caused by passing a recursive table (i.e. a table which contains either a direct or indirect value of itself) to
table.tostring() - Fixed
halign/valignparameters forrtk.Window:open()sometimes not being respected - Ensured
rtk.Entry.caretreflects the correct position before firingrtk.Entry.onchange(#19)
- Added a new experimental
xmlmodule, which can be used to parse a subset of XML. The API is in preview and is not considered stable. Feedback appreciated. rtk.Slider's API has been promoted to stable (however vertical orientiation is not yet implemented)- Added a new mode
autoforrtk.Viewport.vscrollbarthat will reserve space for the scrollbar if scrolling is required to see all content rtk.Windownow supports relative values (i.e. between 0 and 1.0 inclusive) forminw,minh,maxw, andmaxhattributes- Implemented customizable widget "hot zones" controlled via the
rtk.Widget.hotzoneattribute, which allows adjusting the area around the widget's normal boundary where mouse interactions will register. This can be useful to allow a widget to be clickable even if the user inadvertently clicks within the margin or spacing in a box, for example, which in particular can improve UX on touch screens
- Containers now receive
onkeypressevents when any descendant of the container is focused - When
rtk.Viewport.vscrollbaris set tohover(default) the scrollbar now becomes visible when the mouse enters anywhere within the viewport, rather than only when near the scrollbar gutter - Improved
rtk.Windowautosizing (i.e. when width or height is not set) when the window contains "greedy" widgets that want to fill their parent containers as much as possible rtk.Window:open()now defaults to center alignmentrtk.Widget.onclick,rtk.Widget.ondoubleclick, andrtk.Widget.onlongpressno longer requirertk.Widget.autofocusto be explicitly set or have a customrtk.Widget.onmousedownhandler to fire. They will be invoked on all widgets unlessrtk.Widget.onmousedownexplicitly returns false to disable this behaviorrtk.Widget.autofocusnow defaults to true if anonclickis set on the widget, but it can be explicitly set tofalseto never autofocus- Allow newlines in
rtk.Application.statustext - Expand the number of scenarios in which a full reflow is avoided when setting
rtk.Text.text - Icons created by
rtk.Image.icon()are no longer automatically recolored when the image is found in an image path that was registered without an explicit icon style - Allow passing the file extension to
rtk.Image.icon() - Added
rtk.Popup.onopenandrtk.Popup.oncloseevent handlers - Enhanced
rtk.Popup.autocloseto be able to distinguish between clicks that occur outside the popup but still within the ReaScript window, or outside the window entirely - Allow
rtk.Popup.overlayto be themed - Added support for alpha channels in named colors in the form
colorname#aawherecolornameis the name of the color andaais the hex code of the alpha channel. For example,bg='chartreuse#7f' - Implemented luma-adaptive color for
rtk.Text.colorwhich is now default. Unless the attribute is explicitly set, the text color will usertk.themes.textfrom either the dark theme or the light theme, depending on the luminance of the background the text will be rendered over - Improved luminance detection for adaptive coloring (for example
rtk.Entry.icon) to take into account parent's background when the widget has a translucent background such that it that would blend with the parent's background color - Avoid recalculating layout (full reflow) if
rtk.Widget.bgorrtk.Widget.ghostare set as these do not affect geometry - Added a new field
rtk.tickthat increments with each gfx update cycle, and addrtk.Event.tickto reflect the tick at which the event occurred - Improved handling of the case where a widget defines
minw/minhbut the minimum size would exceed the allowed cell size in a box - Optimized overhead of instantiating new widgets
- Fixed a bug where key press events could be missed/dropped if there were other non-keyboard events (such as mouse move events) that occurred during the same gfx update cycle
- Properly respect the
maxwcell attribute for expanded cells inrtk.HBox - Fixed a bug where the first expanded cell in a box would have a different size than other expanded cells when
rtk.Box.spacingwas non-zero - Fixed 1px tall scrollbar bug when
rtk.Viewport.vscrollbarwas set toalways - Ensure
rtk.ImageBoxborders and background color is drawn even ifrtk.ImageBox.imageis nil - Respect
rtk.ImageBox.bg, if set, when determining which luma-adaptive image variant to use - Fixed animating
rtk.Widget.wandrtk.Widget.hto 0, or tortk.Attribute.NIL(nil was already supported) - Fixed animating
rtk.Widget.bgto nil - Fixed animating
rtk.Window.xandrtk.Window.ywith undocked windows - Apply
rtk.scale.valuetortk.Widget.minw,minh,maxw, andmaxhwhenrtk.Widget.scalabilityallows it - Fixed centered vertical alignment for
rtk.Buttonwhen the button label wraps - Removed allowing passing
rtk.Window.titleas the first positional value during initialization. In principle this is a breaking change however it never actually worked properly, so this just removes a broken feature. - Fixed a bug where
rtk.Window.onclosecould fire multiple times when the window closes - Fixed flickering when resizing an
rtk.Windowwhen the border attribute was set - Fixed autosizing of
rtk.Windowwhen REAPER's native UI scaling was enabled - Fixed a minor visual flicker that could occur when setting certain
rtk.Windowattributes rtk.Windowpadding is now accounted for by the resize grip whenrtk.Window.borderlessis true- Fixed a bug where
rtk.Buttonwould not always respect the parent container's bounding box - Fixed subtle misalignment of button labels on Mac
- Fixed the
rtk.Popup.openedattribute which wasn't being properly updated to reflect current state - Fixed a bug that calculates the popup width when
rtk.Popup.anchoris defined andrtk.scale.valueis > 1 - Fixed a bug where popups with
rtk.Popup.autocloseenabled could inadvertently close whenrtk.touchscrollwas enabled - Fixed a visual flicker that occurred when fading out an
rtk.Popupat the same time as itsrtk.Popup.anchorwidget is hidden - Fixed issue where the blinking cursor of
rtk.Entrycould be drawn outside its box - Still allow scrolling
rtk.Viewporteven whenrtk.Viewport.vscrollbaris set tonever - Fixed scroll offsets when
rtk.Viewporthas non-zero padding - Fixed a bug where
rtk.FlowBoxwould only ever use a single column if it contained any greedy children (e.g. those using relative dimensions, or belonging to a box container withexpandorfillwcell attributes set) - Fixed an edge case where
rtk.FlowBoxcould layout with zero columns - Fixed
rtk.Spacerfailing to take into account padding when calculating its size - Perform a redraw when the mouse cursor leaves the
rtk.Windowto ensure widget draw functions that referencertk.Window.in_windowreflect the proper state visually - Fixed a bug where
rtk.Widget.cursorwas not being respected when long-pressing over a widget withrtk.touchscrollenabled rtk.Widget.onclickno longer fires ifrtk.Widget.onlongpressfires and its handler returns true to mark the event as handled- Fixed incorrect rendering of
rtk.Entrybackground when its parent container's background changes - The
targetidxparameter forrtk.Container:reorder()previously required offseting the index by 1 of the target was after the widget's current cell position, which is now fixed. Technically this is a breaking API change, but the previous semantics were extremely counterintuitive and this API was not widely used by scripts so this is being slipped in as a bug fix. - Fixed millisecond precision in
rtk.logtimestamps - Fixed some janky behavior that could occur during mouse cursor position restoration when
rtk.touchscrollis enabled
rtk.Windownow supports automatic sizing based on its contents whenrtk.Window.wand/orrtk.Window.hare nil at the timertk.Window:open()is called, which is now the default behavior- Introduced a new slider widget
rtk.Slider, which currently in beta and will be promoted in the next minor release - Added a new window attribute
rtk.Window.resizablewhich controls the resizability of undocked windows
- The
updatecallback passed tortk.queue_animation()now receives the animation table as the 4th argument - The
rtk.Entry's value attribute can be be received as the first positional argument - Full reflow is avoided when setting
rtk.Text.texton a fixed-width text widget (optimization) - Removed js_ReaScriptAPI requirement for
rtk.Window:get_normalized_y()
- Fixed center/right/bottom cell alignments for
rtk.Containerwhenrtk.Container.paddingis nonzero - Ensure redraw occurs when
rtk.Entry.valuechanges - Account for
rtk.Entry.placeholderwhen calculating the entry widget's intrinsic size - Respect the
alphaattribute forrtk.Window - Avoid updating attributes' surface values during animations
- Don't fire
rtk.OptionMenu:onchange()when explicitly passing false to the trigger argument ofrtk.OptionMenu:select()even if the selected item changed
- Fixed calculation of
rtk.scale.framebufferwhen docked - Ensure
rtk.Window:onresize()handler fires when dock state changes - Detect display based on current values of
rtk.Window.xandrtk.Window.yattributes
- Fixed a bug with
rtk.Window:open()alignment options when reopening windows on Macs with Retina displays - Fixed a potential hard REAPER crash when updating window attributes after
rtk.Window:close()is called
- Added
rtk.scale.framebuffer, which indicates the ratio of the internal gfx frame buffer to the OS window geometry
- Fixed widgets not properly respecting changes to
rtk.font.multiplieron reflow - Fixed window height clamping on Windows and Linux when
rtk.Window:open()is called with constrain option - When setting the
rtk.Window.worrtk.Window.hattribute, fixed a bug where the other dimension would end up being halved on MacOS systems with Retina displays
Initial release marking API stability.