Offer Products Case Studies Expertises About us Contact Blog
FR EN

Theming

Built-in themes

Two themes are included. Set the theme property on the component or via the singleton:

VirtualKeyboard {
    theme: Lnvk.Dark   // default
    // theme: Lnvk.Light
}
// Switch at runtime
Lnvk.theme = Lnvk.Light

Custom colors

Override any visual token on the VirtualKeyboard component. Unset properties inherit the values of the active theme.

VirtualKeyboard {
    panelBackground:      "#1a1a2e"
    keyBackground:        "#16213e"
    keyForeground:        "#e2e2e2"
    keyPressedBackground: "#0f3460"
    specialKeyBackground: "#533483"
    accentColor:          "#e94560"
    popupBackground:      "#16213e"
    keyRadius:  8
    keySpacing: 4
    fontSize:   20
}

Bundled fonts are optional. Register your own font files from C++ before plugin init (see Deployment). QML uses the read-only resolved family: font.family: Lnvk.effectiveFontFamily.

Color properties reference

PropertyTypeDark defaultDescription
panelBackgroundcolor#132538Keyboard panel background
keyBackgroundcolor#1E3550Normal key fill
keyForegroundcolor#F9F8F7Key label color
keyPressedBackgroundcolor#23A4DDPressed key fill
specialKeyBackgroundcolor#454D9BShift, backspace, enter keys
accentColorcolor#00AB97Highlights and candidate bar
popupBackgroundcolor#1E3550Long-press popup background
keyRadiusint12Key corner radius (px)
keySpacingint5Gap between keys (px)
fontSizeint22Base key label font size (px)

Fonts

Call FontPaths::setHostFontFiles before engine.load():

#include <lnvk>

lenewt::FontPaths::setHostFontFiles({
    "/opt/myapp/fonts/Inter-Variable.ttf",
    "/opt/myapp/fonts/NotoSansCJKsc-Regular.otf",
});

When set, the host file list replaces bundled font discovery. Per-script family selection is automatic via Lnvk.effectiveFontFamily when the language changes. See Deployment for optional bundled fonts and search paths.

Sizing

Constrain the keyboard width and height with maxWidth and maxHeight. The keyboard centers itself within the available space.

VirtualKeyboard {
    maxWidth:  600
    maxHeight: 300
}

Set either property to -1 (the default) to leave that dimension unconstrained.