Skip to content

Utility Tools (Utils)

Overview

RinUI provides a singleton object Utils, used to manage global resources, fonts, and animation durations. This is an indispensable auxiliary module in RinUI applications. You can modify the values of these properties to customize the appearance and behavior of RinUI.

You can use the utility tools Utils like this:

qml
import RinUI

Component {
    // get Utils property
    property var property: Utils.property;
    
    // modify Utils property
    Component.onCompleted: {
        Utils.property = newValue;
    }
}

Appearance and Theme

PropertyDescription
primaryColorTheme primary color, default reads the backend configuration file default value #605ed2
It is recommended to modify the theme color through Theme.setThemeColor(color: str)
colorsThe color table of the currently selected theme in RinUI, all controls in RinUI will reference these colors
appearanceAppearance settings of the current theme (such as rounded corners, shadows, opacity)
typographyCurrently only stores font size information

Fonts and Icons

PropertyDescription
fontFamilyDefault application font, default is (Qt.application.font.family)
iconFontFamilyFont name for font icons (usually provided by FontIconLoader)
fontIconSourcePath to the .ttf file of the font icon
fontIconIndexSourcePath to the .js file of the font icon index
fontIconIndexIcon index object, can directly access characters through Utils.fontIconIndex['icon-name']

Animation Durations

PropertyDescription
animationSpeedStandard animation speed (250ms)
animationSpeedFasterFast animation speed (120ms)
animationSpeedMiddleModerately slow speed (450ms)
appearanceSpeedInterface switching speed (175ms)
progressBarAnimationSpeedProgress bar animation time (1550ms)

Released under the MIT License.