Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuzichu520 committed Jun 8, 2023
1 parent a37e4e3 commit c25e236
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 4 deletions.
5 changes: 3 additions & 2 deletions example/qml/component/CodeExpander.qml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ FluExpander{

id:control
property string code: ""

headerText: "Source"
contentHeight:content.height
focus: false

FluMultilineTextBox{
id:content
width:parent.width
activeFocusOnTab: false
activeFocusOnPress: false
readOnly: true
text:highlightQmlCode(code)
textFormat: FluMultilineTextBox.RichText
KeyNavigation.priority: KeyNavigation.BeforeItem
enabled: false
background:Rectangle{
radius: 4
color:FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
Expand Down
2 changes: 1 addition & 1 deletion example/qml/window/MainWindow.qml
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ CustomWindow {
negativeText:"最小化"
buttonFlags: FluContentDialog.NeutralButton | FluContentDialog.NegativeButton | FluContentDialog.PositiveButton
onNegativeClicked:{
system_tray.showMessage("友情提示","FluentUI已隐藏至托盘,点击托盘可再次激活窗口");
window.hide()
system_tray.showMessage("友情提示","FluentUI已隐藏至托盘,点击托盘可再次激活窗口");
}
positiveText:"退出"
neutralText:"取消"
Expand Down
5 changes: 5 additions & 0 deletions src/imports/FluentUI/Controls/FluCheckBox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import FluentUI

Button {
property bool disabled: false
property string contentDescription: ""
property color borderNormalColor: FluTheme.dark ? Qt.rgba(160/255,160/255,160/255,1) : Qt.rgba(136/255,136/255,136/255,1)
property color bordercheckedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
property color borderHoverColor: FluTheme.dark ? Qt.rgba(167/255,167/255,167/255,1) : Qt.rgba(135/255,135/255,135/255,1)
Expand All @@ -30,6 +31,10 @@ Button {
visible: control.activeFocus
}
}
Accessible.role: Accessible.Button
Accessible.name: control.text
Accessible.description: contentDescription
Accessible.onPressAction: control.clicked()
focusPolicy:Qt.TabFocus
contentItem: RowLayout{
spacing: 4
Expand Down
5 changes: 5 additions & 0 deletions src/imports/FluentUI/Controls/FluControl.qml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import QtQuick.Templates as T

T.Button {
id: control
property string contentDescription: ""
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
Expand All @@ -20,4 +21,8 @@ T.Button {
radius:8
}
}
Accessible.role: Accessible.Button
Accessible.name: control.text
Accessible.description: contentDescription
Accessible.onPressAction: control.clicked()
}
2 changes: 2 additions & 0 deletions src/imports/FluentUI/Controls/FluCopyableText.qml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ TextField {
id:control
color: textColor
readOnly: true
activeFocusOnTab: false
activeFocusOnPress: false
renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering
padding: 0
leftPadding: 0
Expand Down
1 change: 0 additions & 1 deletion src/imports/FluentUI/Controls/FluToggleButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import QtQuick.Controls.Basic
import FluentUI

Button {

property bool disabled: false
property string contentDescription: ""
property color normalColor: {
Expand Down
5 changes: 5 additions & 0 deletions src/imports/FluentUI/Controls/FluToggleSwitch.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import FluentUI

Button {
property bool disabled: false
property string contentDescription: ""
property color disableColor: checked ? FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(159/255,159/255,159/255,1) :FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(240/255,240/255,240/255,1)
property color checkColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
property color hoverColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(240/255,240/255,240/255,1)
Expand All @@ -19,6 +20,10 @@ Button {
checked = !checked
}
id: control
Accessible.role: Accessible.Button
Accessible.name: control.text
Accessible.description: contentDescription
Accessible.onPressAction: control.clicked()
height: 20
enabled: !disabled
implicitHeight: height
Expand Down

0 comments on commit c25e236

Please sign in to comment.