LVRS Storyboard Frame
components/control/AbstractButton.svx
Path: components/control/AbstractButton.svx
AbstractButton
위치: qml/components/control/buttons/AbstractButton.qml
AbstractButton는 LVRS 버튼 패밀리의 기본 제어 장치입니다.
목적
- 공유된 톤 열거 및 색상 정책을 제공하십시오.
- 활성화/비활성화된 상호작용 게이팅을 통합합니다.
- 파생된 버튼에 대한 패딩/지름/암시적 크기 기준선을 중앙 집중화합니다.
톤 열거
AbstractButton.ButtonTone
PrimaryDefaultBorderlessDestructiveDisabled
코어 API
toneeffectiveEnabled(enabled && tone !== Disabled)textColor,textColorDisabledbackgroundColor,backgroundColorHover,backgroundColorPressed,backgroundColorDisabledhorizontalPadding,verticalPadding,cornerRadius
상호작용 계약
effectiveEnabled == false시 호버/포커스가 비활성화됩니다.- 비활성화된 상태는 우발적인 이벤트 전파를 방지하기 위해 차단
MouseArea를 설치합니다. Default와Borderless가 눌린 상태는Theme.accentBlueMuted를 사용합니다.Default톤 베이스 채우기는Theme.panelBackground12이며, 비활성화된 채우기는Theme.panelBackground04입니다.
사용법
import LVRS 1.0 as LV
LV.AbstractButton {
text: "Action"
tone: LV.AbstractButton.Default
}
동작 원리
- 톤별 텍스트/배경 색상은 읽기 전용으로 계산된 속성에 의해 파생됩니다.
- 파생된 버튼 구성 요소는 크기/레이아웃을 재정의하고 상호작용 및 톤 정책을 상속합니다.
contentItem는 기본값으로LV.Label(body스타일)이며, 두 축을 중앙에 배치합니다.
고급 예시: 사용자 지정 색상으로 톤 오버라이드
import LVRS 1.0 as LV
LV.AbstractButton {
text: "Dangerous"
tone: LV.AbstractButton.Destructive
backgroundColorPressed: "#B83333"
}
디버그 팁
버튼이 비대화형으로 표시될 경우, effectiveEnabled만 검사하고 enabled만 검사하십시오.