MyGit

5.1

mikke89/RmlUi

版本发布时间: 2023-04-07 22:59:39

mikke89/RmlUi最新发布版本:6.0(2024-08-27 04:57:53)

In this part of the world, the snow has almost melted by now and birds have started finding places to nest, some of them just outside our door. I'm sure they are big fans of the library, and I interpret this as the strongest desire for a new release of the library. So here it is, RmlUi 5.1!

This is a smaller release, but there should be some nice bits here for everyone. Scrolling behavior has been significantly enhanced, now with support for both autoscroll mode (scrolling with middle mouse button), and smooth scrolling. Anyone writing desktop applications with RmlUi will be happy to see that the library now supports on-demand rendering, enabling reduced CPU usage while the application is idle. There are also several improvements to form elements, including a new text selection interface. The included backends have been improved, in particular the Vulkan renderer. You will also find stability and build improvements, check out all the details below!

Large parts of this release are based on user contributions. Thanks to all the pull requests and reported issues, we keep seeing new users contributing too, which is very exciting!

As always, the documentation has been updated with all the new changes. Special thanks in particular to everyone who has contributed directly to help improve the documentation, @Thalhammer, @ShawnCZek, @barotto, @ZombieRaccoon, and @xland.

Changelog

New scrolling features

Autoscroll mode

Autoscroll mode, or scrolling with the middle mouse button, is now featured in RmlUi. #422 #423 (thanks @igorsegallafa)

This mode is automatically enabled by the context whenever a middle mouse button press is detected, and there is an element to scroll under the mouse. There is also support for holding the middle mouse button to scroll.

When autoscroll mode is active, a cursor name is submitted to clients which indicates the state of the autoscroll, so that clients can display an appropriate cursor to the user. These cursor names all start with rmlui-scroll-, and take priority over any active cursor property. If desired, autoscroll mode can be disabled entirely by simply not submitting middle mouse button presses, or by using another button index when submitting the button to the context.

See the new documentation section on scrolling for details.

Smooth scrolling

Smooth scrolling is now supported in RmlUi, and enabled by default. This makes certain scroll actions animate smoothly towards its destination. Smooth scrolling may become active in the following situations:

Smooth scrolling can be disabled or tweaked on the context, as described below.

Context interface

Smooth scrolling can be disabled, or tweaked, by calling the following method on a given context:

void Context::SetDefaultScrollBehavior(ScrollBehavior scroll_behavior, float speed_factor);

Here, smooth scrolling can be disabled by submitting the ScrollBehavior::Instant enum value. The scrolling speed can also be tweaked by adjusting the speed factor.

The function signature of Context::ProcessMouseWheel has been replaced with the following, to enable scrolling in both dimensions:

bool Context::ProcessMouseWheel(Vector2f wheel_delta, int key_modifier_state);

The old single axis version is still available for backward compatibility, but considered deprecated and may be removed in the future.

Element interface

Added

void Element::ScrollTo(Vector2f offset, ScrollBehavior behavior = ScrollBehavior::Instant);

which scrolls the element to the given coordinates, with the ability to use smooth scrolling. Similarly, Element::ScrollIntoView has been updated with the ability to perform smooth scrolling (instant by default).

Scroll events

The mousescroll event no longer performs scrolling on an element, and no longer requires a default action. Instead, the responsibility for mouse scrolling has been moved to the context and its scroll controller. However, the mousescroll event is still submitted during a mouse wheel action, with the option to cancel the scroll by stopping its propagation. The event is now also submitted before initiating autoscroll mode, with the possibility to cancel it.

New RCSS features

On-demand rendering (power saving mode)

In games, the update and render loop normally run as fast as possible. However, in some applications it is desirable to reduce CPU usage and power consumption when the application is idle. RmlUi now provides the necessary utilities to achieve this. Implemented in #436 (thanks @Thalhammer), see also #331 #417 #430.

Users of RmlUi control their own update loop, however, this feature requires some support from the library side, because the application needs to know e.g. when animations are happening or when a text cursor should blink. In short, to implement this, users can now query the context for Context::GetNextUpdateDelay(), which returns the time until the next update loop should be run again.

See the on-demand rendering documentation for details and examples.

Text selection interface

Added the ability to set or retrieve the text selection on text fields. #419

In particular, the following methods are now available on ElementFormControlInput (<input> elements) and ElementFormControlTextArea (<textarea> elements):

// Selects all text.
void Select();
// Selects the text in the given character range.
void SetSelectionRange(int selection_start, int selection_end);
// Retrieves the selection range and text.
void GetSelection(int* selection_start, int* selection_end, String* selected_text) const;

See the form controls documentation for details.

RML and form element improvements

Data bindings

Lua plugin

Backends

Stability improvements

Build improvements

Built-in containers

Breaking changes

Path to RmlUi 6.0

This is intended to be the last release in the 5.x series. I'll start merging some larger changes into the master branch soon, expect some larger breaking changes along with that. Users who want stability should prefer to stay on this release.

There are many exciting upcoming features I'm looking forward to merging into the library. In particular, expect support for advanced filters and effects, including blur, gradients, box-shadow, and custom shaders. In addition, a big rewrite of the layout engine will ensure improved CSS conformance, and much better maintainability and future improvements. Stay tuned!

New Contributors

Full Changelog: https://github.com/mikke89/RmlUi/compare/5.0...5.1

相关地址:原始地址 下载(tar) 下载(zip)

1、 RmlUi-vs2017-win32.zip 26.88MB

2、 RmlUi-vs2017-win64.zip 32.02MB

3、 RmlUi-win64-samples-only.zip 3MB

查看:2023-04-07发行的版本