update
parent
11206c1d18
commit
154670f744
|
@ -1,73 +0,0 @@
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import Qt.labs.platform
|
|
||||||
import FluentUI
|
|
||||||
import "qrc:///example/qml/global/"
|
|
||||||
|
|
||||||
FluWindow {
|
|
||||||
|
|
||||||
id:window
|
|
||||||
title: "FluentUI"
|
|
||||||
width: 1000
|
|
||||||
height: 640
|
|
||||||
closeDestory:false
|
|
||||||
minimumWidth: 520
|
|
||||||
minimumHeight: 460
|
|
||||||
launchMode: FluWindow.SingleTask
|
|
||||||
visible: true
|
|
||||||
|
|
||||||
Component.onCompleted: {
|
|
||||||
// FluApp.init(window)
|
|
||||||
}
|
|
||||||
|
|
||||||
FluNavigationView2{
|
|
||||||
id:nav_view
|
|
||||||
anchors.fill: parent
|
|
||||||
items: ItemsOriginal
|
|
||||||
footerItems:ItemsFooter
|
|
||||||
z:11
|
|
||||||
displayMode:MainEvent.displayMode
|
|
||||||
logo: "qrc:/example/res/image/favicon.ico"
|
|
||||||
title:"FluentUI"
|
|
||||||
autoSuggestBox:FluAutoSuggestBox{
|
|
||||||
width: 280
|
|
||||||
anchors.centerIn: parent
|
|
||||||
iconSource: FluentIcons.Search
|
|
||||||
items: ItemsOriginal.getSearchData()
|
|
||||||
placeholderText: lang.search
|
|
||||||
onItemClicked:
|
|
||||||
(data)=>{
|
|
||||||
ItemsOriginal.startPageByItem(data)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
actionItem:Item{
|
|
||||||
height: 40
|
|
||||||
width: 148
|
|
||||||
RowLayout{
|
|
||||||
anchors.centerIn: parent
|
|
||||||
spacing: 5
|
|
||||||
FluText{
|
|
||||||
text:lang.dark_mode
|
|
||||||
}
|
|
||||||
FluToggleSwitch{
|
|
||||||
checked: FluTheme.dark
|
|
||||||
onClicked: {
|
|
||||||
if(FluTheme.dark){
|
|
||||||
FluTheme.darkMode = FluDarkMode.Light
|
|
||||||
}else{
|
|
||||||
FluTheme.darkMode = FluDarkMode.Dark
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
|
||||||
ItemsOriginal.navigationView = nav_view
|
|
||||||
ItemsFooter.navigationView = nav_view
|
|
||||||
// nav_view.setCurrentIndex(0)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -6,19 +6,20 @@ import FluentUI
|
||||||
|
|
||||||
FluExpander{
|
FluExpander{
|
||||||
|
|
||||||
|
id:control
|
||||||
property string code: ""
|
property string code: ""
|
||||||
|
|
||||||
headerText: "Source"
|
headerText: "Source"
|
||||||
contentHeight:content.height
|
contentHeight:content.height
|
||||||
|
focus: false
|
||||||
|
|
||||||
FluMultilineTextBox{
|
FluMultilineTextBox{
|
||||||
id:content
|
id:content
|
||||||
width:parent.width
|
width:parent.width
|
||||||
readOnly:true
|
|
||||||
text:highlightQmlCode(code)
|
text:highlightQmlCode(code)
|
||||||
focus:false
|
|
||||||
textFormat: FluMultilineTextBox.RichText
|
textFormat: FluMultilineTextBox.RichText
|
||||||
KeyNavigation.priority: KeyNavigation.BeforeItem
|
KeyNavigation.priority: KeyNavigation.BeforeItem
|
||||||
|
enabled: false
|
||||||
background:Rectangle{
|
background:Rectangle{
|
||||||
radius: 4
|
radius: 4
|
||||||
color:FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
color:FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(247/255,247/255,247/255,1)
|
||||||
|
@ -40,6 +41,11 @@ FluExpander{
|
||||||
rightMargin: 5
|
rightMargin: 5
|
||||||
topMargin: 5
|
topMargin: 5
|
||||||
}
|
}
|
||||||
|
onActiveFocusChanged: {
|
||||||
|
if(activeFocus){
|
||||||
|
control.expand = true
|
||||||
|
}
|
||||||
|
}
|
||||||
onClicked:{
|
onClicked:{
|
||||||
FluTools.clipText(content.text)
|
FluTools.clipText(content.text)
|
||||||
showSuccess("复制成功")
|
showSuccess("复制成功")
|
||||||
|
|
|
@ -39,7 +39,6 @@ int main(int argc, char *argv[])
|
||||||
FramelessHelper::Quick::registerTypes(&engine);
|
FramelessHelper::Quick::registerTypes(&engine);
|
||||||
appInfo->init(&engine);
|
appInfo->init(&engine);
|
||||||
const QUrl url(QStringLiteral("qrc:/example/qml/App.qml"));
|
const QUrl url(QStringLiteral("qrc:/example/qml/App.qml"));
|
||||||
// const QUrl url(QStringLiteral("qrc:/example/qml/TestWindow.qml"));
|
|
||||||
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,
|
||||||
&app, [url](QObject *obj, const QUrl &objUrl) {
|
&app, [url](QObject *obj, const QUrl &objUrl) {
|
||||||
if (!obj && url == objUrl)
|
if (!obj && url == objUrl)
|
||||||
|
|
|
@ -5,6 +5,7 @@ import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
|
property string contentDescription: ""
|
||||||
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||||
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
|
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
|
||||||
property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
|
property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
|
||||||
|
@ -27,11 +28,13 @@ Button {
|
||||||
return Qt.rgba(0,0,0,1)
|
return Qt.rgba(0,0,0,1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Accessible.role: Accessible.Button
|
||||||
|
Accessible.name: control.text
|
||||||
|
Accessible.description: contentDescription
|
||||||
|
Accessible.onPressAction: control.clicked()
|
||||||
id: control
|
id: control
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
focusPolicy:Qt.TabFocus
|
|
||||||
horizontalPadding:12
|
horizontalPadding:12
|
||||||
Keys.onSpacePressed: control.visualFocus&&clicked()
|
|
||||||
font:FluTextStyle.Body
|
font:FluTextStyle.Body
|
||||||
background: Rectangle{
|
background: Rectangle{
|
||||||
implicitWidth: 28
|
implicitWidth: 28
|
||||||
|
@ -40,14 +43,8 @@ Button {
|
||||||
border.width: 1
|
border.width: 1
|
||||||
radius: 4
|
radius: 4
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.visualFocus
|
visible: control.activeFocus
|
||||||
radius:8
|
radius:4
|
||||||
}
|
|
||||||
color:{
|
|
||||||
if(disabled){
|
|
||||||
return disableColor
|
|
||||||
}
|
|
||||||
return hovered ? hoverColor :normalColor
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
contentItem: FluText {
|
contentItem: FluText {
|
||||||
|
|
|
@ -23,13 +23,11 @@ Button {
|
||||||
}
|
}
|
||||||
id:control
|
id:control
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
focusPolicy:Qt.TabFocus
|
|
||||||
Keys.onSpacePressed: control.visualFocus&&clicked()
|
|
||||||
padding:0
|
padding:0
|
||||||
onClicked: clickListener()
|
onClicked: clickListener()
|
||||||
background: Item{
|
background: Item{
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.visualFocus
|
visible: control.activeFocus
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
contentItem: RowLayout{
|
contentItem: RowLayout{
|
||||||
|
|
|
@ -74,7 +74,7 @@ ComboBox {
|
||||||
visible: !control.flat || control.down
|
visible: !control.flat || control.down
|
||||||
radius: 4
|
radius: 4
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.visualFocus
|
visible: control.activeFocus
|
||||||
radius:8
|
radius:8
|
||||||
}
|
}
|
||||||
color:{
|
color:{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
import QtQuick.Controls
|
import QtQuick.Controls
|
||||||
import QtQuick.Window
|
import QtQuick.Window
|
||||||
|
@ -25,7 +25,7 @@ FluPopup {
|
||||||
return 400
|
return 400
|
||||||
return Math.min(Window.window.width,400)
|
return Math.min(Window.window.width,400)
|
||||||
}
|
}
|
||||||
|
focus: true
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id:layout_content
|
id:layout_content
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls.impl
|
||||||
|
import FluentUI
|
||||||
|
import QtQuick.Templates as T
|
||||||
|
|
||||||
|
T.Button {
|
||||||
|
id: control
|
||||||
|
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||||
|
implicitContentWidth + leftPadding + rightPadding)
|
||||||
|
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||||
|
implicitContentHeight + topPadding + bottomPadding)
|
||||||
|
padding: 0
|
||||||
|
horizontalPadding: 0
|
||||||
|
spacing: 0
|
||||||
|
contentItem: Item{}
|
||||||
|
background: Item{
|
||||||
|
FluFocusRectangle{
|
||||||
|
visible: control.activeFocus
|
||||||
|
radius:8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,6 +6,7 @@ import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
|
property string contentDescription: ""
|
||||||
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
property color normalColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1)
|
||||||
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
|
property color hoverColor: FluTheme.dark ? Qt.rgba(68/255,68/255,68/255,1) : Qt.rgba(251/255,251/255,251/255,1)
|
||||||
property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
|
property color disableColor: FluTheme.dark ? Qt.rgba(59/255,59/255,59/255,1) : Qt.rgba(252/255,252/255,252/255,1)
|
||||||
|
@ -30,12 +31,14 @@ Button {
|
||||||
}
|
}
|
||||||
property var window : Window.window
|
property var window : Window.window
|
||||||
property alias items: menu.content
|
property alias items: menu.content
|
||||||
|
Accessible.role: Accessible.Button
|
||||||
|
Accessible.name: control.text
|
||||||
|
Accessible.description: contentDescription
|
||||||
|
Accessible.onPressAction: control.clicked()
|
||||||
id: control
|
id: control
|
||||||
rightPadding:35
|
rightPadding:35
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
focusPolicy:Qt.TabFocus
|
|
||||||
horizontalPadding:12
|
horizontalPadding:12
|
||||||
Keys.onSpacePressed: control.visualFocus&&clicked()
|
|
||||||
background: Rectangle{
|
background: Rectangle{
|
||||||
implicitWidth: 28
|
implicitWidth: 28
|
||||||
implicitHeight: 28
|
implicitHeight: 28
|
||||||
|
@ -43,7 +46,7 @@ Button {
|
||||||
border.width: 1
|
border.width: 1
|
||||||
radius: 4
|
radius: 4
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.visualFocus
|
visible: control.activeFocus
|
||||||
radius:8
|
radius:8
|
||||||
}
|
}
|
||||||
color:{
|
color:{
|
||||||
|
|
|
@ -5,6 +5,7 @@ import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
|
property string contentDescription: ""
|
||||||
property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.1) : Qt.lighter(normalColor,1.1)
|
property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.1) : Qt.lighter(normalColor,1.1)
|
||||||
property color disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
property color disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1)
|
||||||
|
@ -19,10 +20,13 @@ Button {
|
||||||
return Qt.rgba(1,1,1,1)
|
return Qt.rgba(1,1,1,1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Accessible.role: Accessible.Button
|
||||||
|
Accessible.name: control.text
|
||||||
|
Accessible.description: contentDescription
|
||||||
|
Accessible.onPressAction: control.clicked()
|
||||||
id: control
|
id: control
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
Keys.onSpacePressed: control.visualFocus&&clicked()
|
Keys.onSpacePressed: control.visualFocus&&clicked()
|
||||||
focusPolicy:Qt.TabFocus
|
|
||||||
font:FluTextStyle.Body
|
font:FluTextStyle.Body
|
||||||
horizontalPadding:12
|
horizontalPadding:12
|
||||||
background: Rectangle{
|
background: Rectangle{
|
||||||
|
@ -31,7 +35,7 @@ Button {
|
||||||
radius: 4
|
radius: 4
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.visualFocus
|
visible: control.visualFocus
|
||||||
radius:8
|
radius:4
|
||||||
}
|
}
|
||||||
color:{
|
color:{
|
||||||
if(disabled){
|
if(disabled){
|
||||||
|
|
|
@ -4,16 +4,15 @@ import FluentUI
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
property int radius: 4
|
property int radius: 4
|
||||||
id:root
|
id:control
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: -3
|
|
||||||
Rectangle{
|
Rectangle{
|
||||||
width: root.width
|
width: control.width
|
||||||
height: root.height
|
height: control.height
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
border.width: 3
|
border.width: 2
|
||||||
radius: root.radius
|
radius: control.radius
|
||||||
border.color: FluTheme.dark ? Qt.rgba(1,1,1,1) : Qt.rgba(0,0,0,1)
|
border.color: FluTheme.dark ? Qt.rgba(1,1,1,1) : Qt.rgba(0,0,0,1)
|
||||||
z: 65535
|
z: 65535
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ Button {
|
||||||
property int iconSource
|
property int iconSource
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
property int radius:4
|
property int radius:4
|
||||||
|
property string contentDescription: ""
|
||||||
property color hoverColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(0,0,0,0.03)
|
property color hoverColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(0,0,0,0.03)
|
||||||
property color pressedColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(0,0,0,0.06)
|
property color pressedColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(0,0,0,0.06)
|
||||||
property color normalColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0)
|
property color normalColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0)
|
||||||
|
@ -34,6 +35,10 @@ Button {
|
||||||
return Qt.rgba(0,0,0,1)
|
return Qt.rgba(0,0,0,1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Accessible.role: Accessible.Button
|
||||||
|
Accessible.name: control.text
|
||||||
|
Accessible.description: contentDescription
|
||||||
|
Accessible.onPressAction: control.clicked()
|
||||||
id:control
|
id:control
|
||||||
width: 30
|
width: 30
|
||||||
height: 30
|
height: 30
|
||||||
|
@ -41,13 +46,11 @@ Button {
|
||||||
implicitHeight: height
|
implicitHeight: height
|
||||||
padding: 0
|
padding: 0
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
focusPolicy:Qt.TabFocus
|
|
||||||
Keys.onSpacePressed: control.visualFocus&&clicked()
|
|
||||||
background: Rectangle{
|
background: Rectangle{
|
||||||
radius: control.radius
|
radius: control.radius
|
||||||
color:control.color
|
color:control.color
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.visualFocus
|
visible: control.activeFocus
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
contentItem: Item{
|
contentItem: Item{
|
||||||
|
|
|
@ -155,8 +155,8 @@ Item {
|
||||||
Item{
|
Item{
|
||||||
height: 38
|
height: 38
|
||||||
width: layout_list.width
|
width: layout_list.width
|
||||||
Rectangle{
|
FluControl{
|
||||||
radius: 4
|
id:item_control
|
||||||
anchors{
|
anchors{
|
||||||
top: parent.top
|
top: parent.top
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
|
@ -167,6 +167,16 @@ Item {
|
||||||
leftMargin: 6
|
leftMargin: 6
|
||||||
rightMargin: 6
|
rightMargin: 6
|
||||||
}
|
}
|
||||||
|
onClicked: {
|
||||||
|
if(d.isCompactAndNotPanel){
|
||||||
|
control_popup.showPopup(Qt.point(50,mapToItem(control,0,0).y),model.children)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
model.isExpand = !model.isExpand
|
||||||
|
}
|
||||||
|
Rectangle{
|
||||||
|
radius: 4
|
||||||
|
anchors.fill: parent
|
||||||
Rectangle{
|
Rectangle{
|
||||||
width: 3
|
width: 3
|
||||||
height: 18
|
height: 18
|
||||||
|
@ -212,24 +222,12 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MouseArea{
|
|
||||||
id:item_mouse
|
|
||||||
hoverEnabled: true
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {
|
|
||||||
if(d.isCompactAndNotPanel){
|
|
||||||
control_popup.showPopup(Qt.point(50,mapToItem(control,0,0).y),model.children)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
model.isExpand = !model.isExpand
|
|
||||||
}
|
|
||||||
}
|
|
||||||
color: {
|
color: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
if((nav_list.currentIndex === idx)&&type===0){
|
if((nav_list.currentIndex === idx)&&type===0){
|
||||||
return Qt.rgba(1,1,1,0.06)
|
return Qt.rgba(1,1,1,0.06)
|
||||||
}
|
}
|
||||||
if(item_mouse.containsMouse){
|
if(item_control.hovered){
|
||||||
return Qt.rgba(1,1,1,0.03)
|
return Qt.rgba(1,1,1,0.03)
|
||||||
}
|
}
|
||||||
return Qt.rgba(0,0,0,0)
|
return Qt.rgba(0,0,0,0)
|
||||||
|
@ -237,7 +235,7 @@ Item {
|
||||||
if(nav_list.currentIndex === idx&&type===0){
|
if(nav_list.currentIndex === idx&&type===0){
|
||||||
return Qt.rgba(0,0,0,0.06)
|
return Qt.rgba(0,0,0,0.06)
|
||||||
}
|
}
|
||||||
if(item_mouse.containsMouse){
|
if(item_control.hovered){
|
||||||
return Qt.rgba(0,0,0,0.03)
|
return Qt.rgba(0,0,0,0.03)
|
||||||
}
|
}
|
||||||
return Qt.rgba(0,0,0,0)
|
return Qt.rgba(0,0,0,0)
|
||||||
|
@ -294,7 +292,7 @@ Item {
|
||||||
left:item_icon.right
|
left:item_icon.right
|
||||||
}
|
}
|
||||||
color:{
|
color:{
|
||||||
if(item_mouse.pressed){
|
if(item_control.pressed){
|
||||||
return FluTheme.dark ? FluColors.Grey80 : FluColors.Grey120
|
return FluTheme.dark ? FluColors.Grey80 : FluColors.Grey120
|
||||||
}
|
}
|
||||||
return FluTheme.dark ? FluColors.White : FluColors.Grey220
|
return FluTheme.dark ? FluColors.White : FluColors.Grey220
|
||||||
|
@ -303,6 +301,8 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Component{
|
Component{
|
||||||
id:com_panel_item
|
id:com_panel_item
|
||||||
Item{
|
Item{
|
||||||
|
@ -314,15 +314,16 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
clip: true
|
clip: true
|
||||||
height: {
|
height: visible ? 38 : 0
|
||||||
|
visible: {
|
||||||
if(model.parent){
|
if(model.parent){
|
||||||
return model.parent.isExpand ? 38 : 0
|
return model.parent.isExpand ? true : false
|
||||||
}
|
}
|
||||||
return 38
|
return true
|
||||||
}
|
}
|
||||||
width: layout_list.width
|
width: layout_list.width
|
||||||
Rectangle{
|
FluControl{
|
||||||
radius: 4
|
id:item_control
|
||||||
anchors{
|
anchors{
|
||||||
top: parent.top
|
top: parent.top
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
|
@ -333,10 +334,6 @@ Item {
|
||||||
leftMargin: 6
|
leftMargin: 6
|
||||||
rightMargin: 6
|
rightMargin: 6
|
||||||
}
|
}
|
||||||
MouseArea{
|
|
||||||
id:item_mouse
|
|
||||||
hoverEnabled: true
|
|
||||||
anchors.fill: parent
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if(type === 0){
|
if(type === 0){
|
||||||
if(model.tapFunc){
|
if(model.tapFunc){
|
||||||
|
@ -360,7 +357,9 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
Rectangle{
|
||||||
|
radius: 4
|
||||||
|
anchors.fill: parent
|
||||||
color: {
|
color: {
|
||||||
if(FluTheme.dark){
|
if(FluTheme.dark){
|
||||||
if(type===0){
|
if(type===0){
|
||||||
|
@ -372,7 +371,7 @@ Item {
|
||||||
return Qt.rgba(1,1,1,0.06)
|
return Qt.rgba(1,1,1,0.06)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(item_mouse.containsMouse){
|
if(item_control.hovered){
|
||||||
return Qt.rgba(1,1,1,0.03)
|
return Qt.rgba(1,1,1,0.03)
|
||||||
}
|
}
|
||||||
return Qt.rgba(0,0,0,0)
|
return Qt.rgba(0,0,0,0)
|
||||||
|
@ -386,7 +385,7 @@ Item {
|
||||||
return Qt.rgba(0,0,0,0.06)
|
return Qt.rgba(0,0,0,0.06)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(item_mouse.containsMouse){
|
if(item_control.hovered){
|
||||||
return Qt.rgba(0,0,0,0.03)
|
return Qt.rgba(0,0,0,0.03)
|
||||||
}
|
}
|
||||||
return Qt.rgba(0,0,0,0)
|
return Qt.rgba(0,0,0,0)
|
||||||
|
@ -439,7 +438,7 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
color:{
|
color:{
|
||||||
if(item_mouse.pressed){
|
if(item_control.pressed){
|
||||||
return FluTheme.dark ? FluColors.Grey80 : FluColors.Grey120
|
return FluTheme.dark ? FluColors.Grey80 : FluColors.Grey120
|
||||||
}
|
}
|
||||||
return FluTheme.dark ? FluColors.White : FluColors.Grey220
|
return FluTheme.dark ? FluColors.White : FluColors.Grey220
|
||||||
|
@ -452,6 +451,7 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Item {
|
Item {
|
||||||
id:nav_app_bar
|
id:nav_app_bar
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
@ -624,11 +624,11 @@ Item {
|
||||||
}
|
}
|
||||||
return "transparent"
|
return "transparent"
|
||||||
}
|
}
|
||||||
|
x: visible ? 0 : -width
|
||||||
x: {
|
visible: {
|
||||||
if(d.displayMode !== FluNavigationView.Minimal)
|
if(d.displayMode !== FluNavigationView.Minimal)
|
||||||
return 0
|
return true
|
||||||
return d.isMinimalAndPanel ? 0 : -width
|
return d.isMinimalAndPanel ? true : false
|
||||||
}
|
}
|
||||||
FluAcrylic {
|
FluAcrylic {
|
||||||
sourceItem:nav_swipe
|
sourceItem:nav_swipe
|
||||||
|
@ -820,14 +820,9 @@ Item {
|
||||||
duration: 83
|
duration: 83
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
background: FluRectangle{
|
padding: 0
|
||||||
width: 160
|
focus: true
|
||||||
radius: [4,4,4,4]
|
contentItem: Item{
|
||||||
FluShadow{
|
|
||||||
radius: 4
|
|
||||||
}
|
|
||||||
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
|
|
||||||
height: 38*Math.min(Math.max(list_view.count,1),8)
|
|
||||||
ListView{
|
ListView{
|
||||||
id:list_view
|
id:list_view
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -836,6 +831,7 @@ Item {
|
||||||
model: control_popup.childModel
|
model: control_popup.childModel
|
||||||
ScrollBar.vertical: FluScrollBar {}
|
ScrollBar.vertical: FluScrollBar {}
|
||||||
delegate:Button{
|
delegate:Button{
|
||||||
|
id:item_button
|
||||||
width: 160
|
width: 160
|
||||||
padding:10
|
padding:10
|
||||||
background: Rectangle{
|
background: Rectangle{
|
||||||
|
@ -845,6 +841,10 @@ Item {
|
||||||
}
|
}
|
||||||
return FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(0,0,0,0)
|
return FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(0,0,0,0)
|
||||||
}
|
}
|
||||||
|
FluFocusRectangle{
|
||||||
|
visible: item_button.activeFocus
|
||||||
|
radius:4
|
||||||
|
}
|
||||||
}
|
}
|
||||||
contentItem: FluText{
|
contentItem: FluText{
|
||||||
text:modelData.title
|
text:modelData.title
|
||||||
|
@ -867,6 +867,16 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
background: FluRectangle{
|
||||||
|
implicitWidth: 160
|
||||||
|
implicitHeight: 38*Math.min(Math.max(list_view.count,1),8)
|
||||||
|
radius: [4,4,4,4]
|
||||||
|
FluShadow{
|
||||||
|
radius: 4
|
||||||
|
}
|
||||||
|
color: FluTheme.dark ? Qt.rgba(51/255,48/255,48/255,1) : Qt.rgba(248/255,250/255,253/255,1)
|
||||||
|
|
||||||
|
}
|
||||||
function showPopup(pos,model){
|
function showPopup(pos,model){
|
||||||
control_popup.x = pos.x
|
control_popup.x = pos.x
|
||||||
control_popup.y = pos.y
|
control_popup.y = pos.y
|
||||||
|
|
|
@ -1,57 +0,0 @@
|
||||||
import QtQuick
|
|
||||||
import QtQuick.Window
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Controls.Basic
|
|
||||||
import QtQuick.Layouts
|
|
||||||
import FluentUI
|
|
||||||
|
|
||||||
Item {
|
|
||||||
|
|
||||||
property url logo
|
|
||||||
property string title: ""
|
|
||||||
property FluObject items
|
|
||||||
property FluObject footerItems
|
|
||||||
property int displayMode: FluNavigationView.Auto
|
|
||||||
property Component autoSuggestBox
|
|
||||||
property Component actionItem
|
|
||||||
id:control
|
|
||||||
Item {
|
|
||||||
id:nav_app_bar
|
|
||||||
width: parent.width
|
|
||||||
height: 40
|
|
||||||
RowLayout{
|
|
||||||
height:parent.height
|
|
||||||
spacing: 0
|
|
||||||
FluIconButton{
|
|
||||||
iconSource: FluentIcons.ChromeBack
|
|
||||||
Layout.leftMargin: 5
|
|
||||||
Layout.preferredWidth: 30
|
|
||||||
Layout.preferredHeight: 30
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
iconSize: 15
|
|
||||||
}
|
|
||||||
FluIconButton{
|
|
||||||
id:btn_nav
|
|
||||||
iconSource: FluentIcons.GlobalNavButton
|
|
||||||
iconSize: 15
|
|
||||||
Layout.preferredWidth: 30
|
|
||||||
Layout.preferredHeight: 30
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
}
|
|
||||||
Image{
|
|
||||||
Layout.preferredHeight: 20
|
|
||||||
Layout.preferredWidth: 20
|
|
||||||
source: control.logo
|
|
||||||
Layout.leftMargin: 12
|
|
||||||
sourceSize: Qt.size(40,40)
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
}
|
|
||||||
FluText{
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
text:control.title
|
|
||||||
Layout.leftMargin: 12
|
|
||||||
font: FluTextStyle.Body
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,6 +5,7 @@ import QtQuick.Layouts
|
||||||
import FluentUI
|
import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
|
property string contentDescription: ""
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
property color borderNormalColor: checked ? FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark : FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
property color borderNormalColor: checked ? FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark : FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1)
|
||||||
property color borderDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(198/255,198/255,198/255,1)
|
property color borderDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(198/255,198/255,198/255,1)
|
||||||
|
@ -15,17 +16,19 @@ Button {
|
||||||
property var clickListener : function(){
|
property var clickListener : function(){
|
||||||
checked = !checked
|
checked = !checked
|
||||||
}
|
}
|
||||||
|
Accessible.role: Accessible.Button
|
||||||
|
Accessible.name: control.text
|
||||||
|
Accessible.description: contentDescription
|
||||||
|
Accessible.onPressAction: control.clicked()
|
||||||
id:control
|
id:control
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
focusPolicy:Qt.TabFocus
|
|
||||||
padding:0
|
padding:0
|
||||||
background: Item{
|
background: Item{
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.visualFocus
|
visible: control.activeFocus
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
font:FluTextStyle.Body
|
font:FluTextStyle.Body
|
||||||
Keys.onSpacePressed: control.visualFocus&&clicked()
|
|
||||||
onClicked: clickListener()
|
onClicked: clickListener()
|
||||||
contentItem: RowLayout{
|
contentItem: RowLayout{
|
||||||
Rectangle{
|
Rectangle{
|
||||||
|
|
|
@ -5,6 +5,7 @@ import FluentUI
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
|
property string contentDescription: ""
|
||||||
property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.15) : Qt.lighter(normalColor,1.15)
|
property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.15) : Qt.lighter(normalColor,1.15)
|
||||||
property color pressedColor: FluTheme.dark ? Qt.darker(normalColor,1.3) : Qt.lighter(normalColor,1.3)
|
property color pressedColor: FluTheme.dark ? Qt.darker(normalColor,1.3) : Qt.lighter(normalColor,1.3)
|
||||||
|
@ -20,19 +21,21 @@ Button {
|
||||||
return hovered ? hoverColor :normalColor
|
return hovered ? hoverColor :normalColor
|
||||||
}
|
}
|
||||||
id: control
|
id: control
|
||||||
topPadding:0
|
horizontalPadding:12
|
||||||
bottomPadding:0
|
|
||||||
leftPadding:0
|
|
||||||
rightPadding:0
|
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
focusPolicy:Qt.TabFocus
|
|
||||||
Keys.onSpacePressed: control.visualFocus&&clicked()
|
Keys.onSpacePressed: control.visualFocus&&clicked()
|
||||||
background: Item{
|
background: Item{
|
||||||
|
implicitWidth: 28
|
||||||
|
implicitHeight: 28
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.visualFocus
|
visible: control.visualFocus
|
||||||
radius:8
|
radius:8
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Accessible.role: Accessible.Button
|
||||||
|
Accessible.name: control.text
|
||||||
|
Accessible.description: contentDescription
|
||||||
|
Accessible.onPressAction: control.clicked()
|
||||||
contentItem: FluText {
|
contentItem: FluText {
|
||||||
id:btn_text
|
id:btn_text
|
||||||
text: control.text
|
text: control.text
|
||||||
|
|
|
@ -6,6 +6,7 @@ import FluentUI
|
||||||
Button {
|
Button {
|
||||||
|
|
||||||
property bool disabled: false
|
property bool disabled: false
|
||||||
|
property string contentDescription: ""
|
||||||
property color normalColor: {
|
property color normalColor: {
|
||||||
if(checked){
|
if(checked){
|
||||||
return FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
return FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark
|
||||||
|
@ -31,10 +32,12 @@ Button {
|
||||||
checked = !checked
|
checked = !checked
|
||||||
}
|
}
|
||||||
property color pressedColor: FluTheme.dark ? Qt.darker(normalColor,1.2) : Qt.lighter(normalColor,1.2)
|
property color pressedColor: FluTheme.dark ? Qt.darker(normalColor,1.2) : Qt.lighter(normalColor,1.2)
|
||||||
|
Accessible.role: Accessible.Button
|
||||||
|
Accessible.name: control.text
|
||||||
|
Accessible.description: contentDescription
|
||||||
|
Accessible.onPressAction: control.clicked()
|
||||||
id: control
|
id: control
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
Keys.onSpacePressed: control.visualFocus&&clicked()
|
|
||||||
focusPolicy:Qt.TabFocus
|
|
||||||
horizontalPadding:12
|
horizontalPadding:12
|
||||||
onClicked: clickListener()
|
onClicked: clickListener()
|
||||||
background: Rectangle{
|
background: Rectangle{
|
||||||
|
@ -44,7 +47,7 @@ Button {
|
||||||
border.color: FluTheme.dark ? "#505050" : "#DFDFDF"
|
border.color: FluTheme.dark ? "#505050" : "#DFDFDF"
|
||||||
border.width: checked ? 0 : 1
|
border.width: checked ? 0 : 1
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.visualFocus
|
visible: control.activeFocus
|
||||||
radius:8
|
radius:8
|
||||||
}
|
}
|
||||||
color:{
|
color:{
|
||||||
|
|
|
@ -22,8 +22,6 @@ Button {
|
||||||
height: 20
|
height: 20
|
||||||
enabled: !disabled
|
enabled: !disabled
|
||||||
implicitHeight: height
|
implicitHeight: height
|
||||||
focusPolicy:Qt.TabFocus
|
|
||||||
Keys.onSpacePressed: control.visualFocus&&clicked()
|
|
||||||
onClicked: clickListener()
|
onClicked: clickListener()
|
||||||
contentItem: Item{}
|
contentItem: Item{}
|
||||||
background : RowLayout{
|
background : RowLayout{
|
||||||
|
@ -34,7 +32,7 @@ Button {
|
||||||
height: control.height
|
height: control.height
|
||||||
radius: height / 2
|
radius: height / 2
|
||||||
FluFocusRectangle{
|
FluFocusRectangle{
|
||||||
visible: control.visualFocus
|
visible: control.activeFocus
|
||||||
radius: 20
|
radius: 20
|
||||||
}
|
}
|
||||||
color: {
|
color: {
|
||||||
|
|
Loading…
Reference in New Issue