diff --git a/example/qml/page/T_Buttons.qml b/example/qml/page/T_Buttons.qml index 0547e8e..7b96280 100644 --- a/example/qml/page/T_Buttons.qml +++ b/example/qml/page/T_Buttons.qml @@ -109,7 +109,7 @@ FluScrollablePage{ disabled:filled_button_switch.selected text:"Filled Button" onClicked: { - showWarning("点击FilledButton") + showWarning("点击FilledButton"+height) } anchors{ verticalCenter: parent.verticalCenter diff --git a/src/imports/FluentUI/Controls/FluButton.qml b/src/imports/FluentUI/Controls/FluButton.qml index 7d17295..b3cad66 100644 --- a/src/imports/FluentUI/Controls/FluButton.qml +++ b/src/imports/FluentUI/Controls/FluButton.qml @@ -11,16 +11,14 @@ Button { property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1) id: control - topPadding:5 - bottomPadding:5 - leftPadding:15 - rightPadding:15 enabled: !disabled focusPolicy:Qt.TabFocus + horizontalPadding:12 Keys.onSpacePressed: control.visualFocus&&clicked() font:FluTextStyle.Body - background: Rectangle{ + implicitWidth: 100 + implicitHeight: 28 border.color: FluTheme.dark ? "#505050" : "#DFDFDF" border.width: 1 radius: 4 diff --git a/src/imports/FluentUI/Controls/FluDropDownButton.qml b/src/imports/FluentUI/Controls/FluDropDownButton.qml index 19f1ecb..0c1f605 100644 --- a/src/imports/FluentUI/Controls/FluDropDownButton.qml +++ b/src/imports/FluentUI/Controls/FluDropDownButton.qml @@ -14,16 +14,14 @@ Button { property alias items: menu.content id: control - topPadding:5 - bottomPadding:5 - leftPadding:15 rightPadding:35 enabled: !disabled focusPolicy:Qt.TabFocus - + horizontalPadding:12 Keys.onSpacePressed: control.visualFocus&&clicked() - background: Rectangle{ + implicitWidth: 100 + implicitHeight: 28 border.color: FluTheme.dark ? "#505050" : "#DFDFDF" border.width: 1 radius: 4 diff --git a/src/imports/FluentUI/Controls/FluFilledButton.qml b/src/imports/FluentUI/Controls/FluFilledButton.qml index 0bb953b..5ea57d6 100644 --- a/src/imports/FluentUI/Controls/FluFilledButton.qml +++ b/src/imports/FluentUI/Controls/FluFilledButton.qml @@ -13,14 +13,13 @@ Button { id: control enabled: !disabled - topPadding:5 - bottomPadding:5 - leftPadding:15 - rightPadding:15 Keys.onSpacePressed: control.visualFocus&&clicked() focusPolicy:Qt.TabFocus font:FluTextStyle.Body + horizontalPadding:12 background: Rectangle{ + implicitWidth: 100 + implicitHeight: 28 radius: 4 FluFocusRectangle{ visible: control.visualFocus diff --git a/src/imports/FluentUI/Controls/FluToggleButton.qml b/src/imports/FluentUI/Controls/FluToggleButton.qml index 962dd13..419ae0e 100644 --- a/src/imports/FluentUI/Controls/FluToggleButton.qml +++ b/src/imports/FluentUI/Controls/FluToggleButton.qml @@ -33,13 +33,12 @@ Button { id: control enabled: !disabled - topPadding:5 - bottomPadding:5 - leftPadding:15 - rightPadding:15 Keys.onSpacePressed: control.visualFocus&&clicked() focusPolicy:Qt.TabFocus + horizontalPadding:12 background: Rectangle{ + implicitWidth: 100 + implicitHeight: 28 radius: 4 border.color: FluTheme.dark ? "#505050" : "#DFDFDF" border.width: selected ? 0 : 1 diff --git a/src/imports/FluentUI/designer/fluentui.metainfo b/src/imports/FluentUI/designer/fluentui.metainfo index 7313d8d..4baa675 100644 --- a/src/imports/FluentUI/designer/fluentui.metainfo +++ b/src/imports/FluentUI/designer/fluentui.metainfo @@ -1,4 +1,35 @@ MetaInfo { + + Type { + name: "FluentUI.Controls.FluWindow" + icon: "images/button-icon16.png" + + ItemLibraryEntry { + name: "FluWindow" + category: "FluentUI - Controls" + libraryIcon: "images/button-icon.png" + version: "1.0" + requiredImport: "FluentUI" + toolTip: qsTr("FluWindow") + } + } + + Type { + name: "FluentUI.Controls.FluTextButton" + icon: "images/button-icon16.png" + + ItemLibraryEntry { + name: "FluTextButton" + category: "FluentUI - Controls" + libraryIcon: "images/button-icon.png" + version: "1.0" + requiredImport: "FluentUI" + toolTip: qsTr("A button with text.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Text Button\")" } + } + } + Type { name: "FluentUI.Controls.FluButton" icon: "images/button-icon16.png" @@ -11,7 +42,100 @@ MetaInfo { requiredImport: "FluentUI" toolTip: qsTr("A button with text.") - Property { name: "text"; type: "binding"; value: "qsTr(\"Button\")" } + Property { name: "text"; type: "binding"; value: "qsTr(\"Standard Button\")" } + } + } + + Type { + name: "FluentUI.Controls.FluFilledButton" + icon: "images/button-icon16.png" + + ItemLibraryEntry { + name: "FluFilledButton" + category: "FluentUI - Controls" + libraryIcon: "images/button-icon.png" + version: "1.0" + requiredImport: "FluentUI" + toolTip: qsTr("A button with text.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Filled Button\")" } + } + } + + Type { + name: "FluentUI.Controls.FluToggleButton" + icon: "images/button-icon16.png" + + ItemLibraryEntry { + name: "FluToggleButton" + category: "FluentUI - Controls" + libraryIcon: "images/button-icon.png" + version: "1.0" + requiredImport: "FluentUI" + toolTip: qsTr("A button with text.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Toggle Button\")" } + } + } + + Type { + name: "FluentUI.Controls.FluIconButton" + icon: "images/button-icon16.png" + + ItemLibraryEntry { + name: "FluIconButton" + category: "FluentUI - Controls" + libraryIcon: "images/button-icon.png" + version: "1.0" + requiredImport: "FluentUI" + } + } + + Type { + name: "FluentUI.Controls.FluDropDownButton" + icon: "images/button-icon16.png" + + ItemLibraryEntry { + name: "FluDropDownButton" + category: "FluentUI - Controls" + libraryIcon: "images/button-icon.png" + version: "1.0" + requiredImport: "FluentUI" + toolTip: qsTr("A button with text.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"DropDownButton\")" } + } + } + + Type { + name: "FluentUI.Controls.FluRadioButton" + icon: "images/button-icon16.png" + + ItemLibraryEntry { + name: "FluRadioButton" + category: "FluentUI - Controls" + libraryIcon: "images/button-icon.png" + version: "1.0" + requiredImport: "FluentUI" + toolTip: qsTr("A button with text.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"Radio Button\")" } + } + } + + Type { + name: "FluentUI.Controls.FluCheckBox" + icon: "images/button-icon16.png" + + ItemLibraryEntry { + name: "FluCheckBox" + category: "FluentUI - Controls" + libraryIcon: "images/button-icon.png" + version: "1.0" + requiredImport: "FluentUI" + toolTip: qsTr("A button with text.") + + Property { name: "text"; type: "binding"; value: "qsTr(\"CheckBox\")" } } }