LVRS Document Viewer
components/control/IconButton.svx
Path: components/control/IconButton.svx
IconButton
Location: qml/components/control/buttons/IconButton.qml
IconButton is an icon-first button variant with optional glyph/text.
Purpose
- Provide compact icon action button with project-structure fallback icon.
- Support icon source by URL, icon name token, or glyph text.
API
Icon inputs:
iconSource(alias to internalurl)iconNameiconGlyphiconSize
Computed/icon resolution:
resolvedIconNameresolvedIconSourcerenderedIconSource
Layout:
- fixed height:
Theme.gap20 - compact paddings (
Theme.gap2)
Resolution Order
- explicit
iconSource - explicit
iconName icon.namefrom grouped icon API- default fallback icon (
projectStructure)
Rendered source is normalized through SvgManager.icon(...) and refreshed by SvgManager.revision.
Usage
import LVRS 1.0 as LV
LV.IconButton {
tone: LV.AbstractButton.Borderless
iconName: "add"
}
Advanced Example: Glyph Fallback Icon
import LVRS 1.0 as LV
LV.IconButton {
iconGlyph: "+"
iconSize: 14
text: "Add"
}
Troubleshooting
If icon does not render:
- verify icon name exists in icon set,
- verify resource path from
Theme.iconPath(...), - verify SVG manager revision updates are not blocked.
Recipe: Toolbar Icon Action + Tooltip
import QtQuick
import LVRS 1.0 as LV
LV.IconButton {
id: refreshButton
iconName: "refresh"
tone: LV.AbstractButton.Borderless
ToolTip.visible: hovered
ToolTip.text: "Refresh"
}
Production Notes
- Keep icon names semantically stable and avoid opaque one-off names.
- Prefer design-token icon size values for consistency with neighboring controls.