mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2024-11-26 21:37:04 +08:00
fix #256
This commit is contained in:
parent
73933842cf
commit
6b92372c59
@ -16,12 +16,20 @@ FluScrollablePage{
|
|||||||
Action { text: qsTr("Open...") }
|
Action { text: qsTr("Open...") }
|
||||||
Action { text: qsTr("Save") }
|
Action { text: qsTr("Save") }
|
||||||
FluMenuSeparator { }
|
FluMenuSeparator { }
|
||||||
Action {
|
FluMenuItem{
|
||||||
text: qsTr("Quit")
|
text: qsTr("Quit")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
showError("Quit")
|
showError("Quit")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
FluMenuItem{
|
||||||
|
text: qsTr("Search")
|
||||||
|
iconSource: FluentIcons.Zoom
|
||||||
|
iconSpacing: 3
|
||||||
|
onTriggered: {
|
||||||
|
showError("Search")
|
||||||
|
}
|
||||||
|
}
|
||||||
Action {
|
Action {
|
||||||
text: qsTr("Disable")
|
text: qsTr("Disable")
|
||||||
enabled:false
|
enabled:false
|
||||||
|
@ -105,8 +105,8 @@ Rectangle{
|
|||||||
}
|
}
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
id:btn_minimize
|
id:btn_minimize
|
||||||
width: 40
|
Layout.preferredWidth: 40
|
||||||
height: 30
|
Layout.preferredHeight: 30
|
||||||
iconSource : FluentIcons.ChromeMinimize
|
iconSource : FluentIcons.ChromeMinimize
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
iconSize: 11
|
iconSize: 11
|
||||||
@ -119,8 +119,8 @@ Rectangle{
|
|||||||
}
|
}
|
||||||
FluIconButton{
|
FluIconButton{
|
||||||
id:btn_maximize
|
id:btn_maximize
|
||||||
width: 40
|
Layout.preferredWidth: 40
|
||||||
height: 30
|
Layout.preferredHeight: 30
|
||||||
iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
|
iconSource : d.isRestore ? FluentIcons.ChromeRestore : FluentIcons.ChromeMaximize
|
||||||
color: hovered ? maximizeHoverColor : maximizeNormalColor
|
color: hovered ? maximizeHoverColor : maximizeNormalColor
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
@ -136,8 +136,8 @@ Rectangle{
|
|||||||
iconSource : FluentIcons.ChromeClose
|
iconSource : FluentIcons.ChromeClose
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
text:closeText
|
text:closeText
|
||||||
width: 40
|
Layout.preferredWidth: 40
|
||||||
height: 30
|
Layout.preferredHeight: 30
|
||||||
visible: !isMac && showClose
|
visible: !isMac && showClose
|
||||||
radius: 0
|
radius: 0
|
||||||
iconSize: 10
|
iconSize: 10
|
||||||
|
@ -6,16 +6,14 @@ Text {
|
|||||||
property int iconSource
|
property int iconSource
|
||||||
property int iconSize: 20
|
property int iconSize: 20
|
||||||
property color iconColor: FluTheme.dark ? "#FFFFFF" : "#000000"
|
property color iconColor: FluTheme.dark ? "#FFFFFF" : "#000000"
|
||||||
id:text_icon
|
id:control
|
||||||
font.family: "Segoe Fluent Icons"
|
font.family: "Segoe Fluent Icons"
|
||||||
font.pixelSize: iconSize
|
font.pixelSize: iconSize
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
color: iconColor
|
color: iconColor
|
||||||
text: (String.fromCharCode(iconSource).toString(16))
|
text: (String.fromCharCode(iconSource).toString(16))
|
||||||
|
|
||||||
FontLoader{
|
FontLoader{
|
||||||
source: "../Font/Segoe_Fluent_Icons.ttf"
|
source: "../Font/Segoe_Fluent_Icons.ttf"
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls.impl
|
import QtQuick.Controls.impl
|
||||||
import QtQuick.Templates as T
|
import QtQuick.Templates as T
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
T.MenuItem {
|
T.MenuItem {
|
||||||
|
property Component iconDelegate : com_icon
|
||||||
|
property int iconSpacing: 5
|
||||||
|
property int iconSource
|
||||||
|
property int iconSize: 16
|
||||||
property color textColor: {
|
property color textColor: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
if(!enabled){
|
if(!enabled){
|
||||||
@ -36,15 +41,39 @@ T.MenuItem {
|
|||||||
icon.height: 24
|
icon.height: 24
|
||||||
icon.color: control.palette.windowText
|
icon.color: control.palette.windowText
|
||||||
height: visible ? implicitHeight : 0
|
height: visible ? implicitHeight : 0
|
||||||
contentItem: FluText {
|
Component{
|
||||||
|
id:com_icon
|
||||||
|
FluIcon{
|
||||||
|
id:content_icon
|
||||||
|
iconSize: control.iconSize
|
||||||
|
iconSource:control.iconSource
|
||||||
|
}
|
||||||
|
}
|
||||||
|
contentItem: Item{
|
||||||
|
Row{
|
||||||
|
spacing: control.iconSpacing
|
||||||
readonly property real arrowPadding: control.subMenu && control.arrow ? control.arrow.width + control.spacing : 0
|
readonly property real arrowPadding: control.subMenu && control.arrow ? control.arrow.width + control.spacing : 0
|
||||||
readonly property real indicatorPadding: control.checkable && control.indicator ? control.indicator.width + control.spacing : 0
|
readonly property real indicatorPadding: control.checkable && control.indicator ? control.indicator.width + control.spacing : 0
|
||||||
leftPadding: (!control.mirrored ? indicatorPadding : arrowPadding)+5
|
anchors{
|
||||||
rightPadding: (control.mirrored ? indicatorPadding : arrowPadding)+5
|
verticalCenter: parent.verticalCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
left: parent.left
|
||||||
|
leftMargin: (!control.mirrored ? indicatorPadding : arrowPadding)+5
|
||||||
|
right: parent.right
|
||||||
|
rightMargin: (control.mirrored ? indicatorPadding : arrowPadding)+5
|
||||||
|
}
|
||||||
|
Loader{
|
||||||
|
id:loader_icon
|
||||||
|
sourceComponent: iconDelegate
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
visible: status === Loader.Ready
|
||||||
|
}
|
||||||
|
FluText {
|
||||||
|
id:content_text
|
||||||
text: control.text
|
text: control.text
|
||||||
color: control.textColor
|
color: control.textColor
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
indicator: FluIcon {
|
indicator: FluIcon {
|
||||||
x: control.mirrored ? control.width - width - control.rightPadding : control.leftPadding
|
x: control.mirrored ? control.width - width - control.rightPadding : control.leftPadding
|
||||||
|
@ -68,6 +68,8 @@ TextField{
|
|||||||
iconSize: 10
|
iconSize: 10
|
||||||
width: 20
|
width: 20
|
||||||
height: 20
|
height: 20
|
||||||
|
verticalPadding: 0
|
||||||
|
horizontalPadding: 0
|
||||||
opacity: 0.5
|
opacity: 0.5
|
||||||
visible: control.text !== ""
|
visible: control.text !== ""
|
||||||
anchors{
|
anchors{
|
||||||
|
@ -74,6 +74,8 @@ TextField{
|
|||||||
iconSize: 10
|
iconSize: 10
|
||||||
width: 20
|
width: 20
|
||||||
height: 20
|
height: 20
|
||||||
|
verticalPadding: 0
|
||||||
|
horizontalPadding: 0
|
||||||
visible: {
|
visible: {
|
||||||
if(control.cleanEnabled === false){
|
if(control.cleanEnabled === false){
|
||||||
return false
|
return false
|
||||||
|
@ -171,6 +171,8 @@ Popup{
|
|||||||
}
|
}
|
||||||
width: 26
|
width: 26
|
||||||
height: 26
|
height: 26
|
||||||
|
verticalPadding: 0
|
||||||
|
horizontalPadding: 0
|
||||||
iconSize: 12
|
iconSize: 12
|
||||||
iconSource : FluentIcons.ChromeClose
|
iconSource : FluentIcons.ChromeClose
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
Loading…
Reference in New Issue
Block a user