mirror of
https://github.com/zhuzichu520/FluentUI.git
synced 2025-07-02 08:05:29 +08:00
Merge branch 'test_branch' of https://github.com/parker-int64/FluentUI into test_branch
This commit is contained in:
@ -23,11 +23,9 @@ FluApp *FluApp::getInstance()
|
||||
FluApp::FluApp(QObject *parent)
|
||||
: QObject{parent}
|
||||
{
|
||||
QFontDatabase::addApplicationFont(":/FluentUI/Font/Segoe_Fluent_Icons.ttf");
|
||||
}
|
||||
|
||||
FluApp::~FluApp(){
|
||||
|
||||
}
|
||||
|
||||
void FluApp::init(QQuickWindow *window){
|
||||
|
@ -27,6 +27,7 @@ class FluApp : public QObject
|
||||
*/
|
||||
Q_PROPERTY_AUTO(QJsonObject,routes);
|
||||
|
||||
QML_FOREIGN(FluApp)
|
||||
QML_NAMED_ELEMENT(FluApp)
|
||||
QML_SINGLETON
|
||||
private:
|
||||
|
@ -4,15 +4,13 @@ import QtQuick.Controls
|
||||
import QtQuick.Window
|
||||
import FluentUI
|
||||
|
||||
Popup {
|
||||
FluPopup {
|
||||
id: popup
|
||||
property string title: "Title"
|
||||
property string message: "Message"
|
||||
property string neutralText: "Neutral"
|
||||
property string negativeText: "Negative"
|
||||
property string positiveText: "Positive"
|
||||
property alias blurSource: blur.sourceItem
|
||||
property bool blurBackground: true
|
||||
signal neutralClicked
|
||||
signal negativeClicked
|
||||
signal positiveClicked
|
||||
@ -27,53 +25,14 @@ Popup {
|
||||
return 400
|
||||
return Math.min(Window.window.width,400)
|
||||
}
|
||||
modal:true
|
||||
anchors.centerIn: Overlay.overlay
|
||||
closePolicy: Popup.CloseOnEscape
|
||||
background:Item{}
|
||||
enter: Transition {
|
||||
reversible: true
|
||||
NumberAnimation {
|
||||
properties: "opacity,scale"
|
||||
from:0
|
||||
to:1
|
||||
duration: 167
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: [ 0, 0, 0, 1 ]
|
||||
}
|
||||
}
|
||||
exit:Transition {
|
||||
NumberAnimation {
|
||||
properties: "opacity,scale"
|
||||
from:1
|
||||
to:0
|
||||
duration: 167
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: [ 1, 0, 0, 0 ]
|
||||
}
|
||||
}
|
||||
contentItem:
|
||||
Rectangle {
|
||||
|
||||
Rectangle {
|
||||
id:layout_content
|
||||
anchors.fill: parent
|
||||
implicitWidth:minWidth
|
||||
implicitHeight: text_title.height + text_message.height + layout_actions.height
|
||||
color: 'transparent'
|
||||
radius:5
|
||||
FluAcrylic{
|
||||
id:blur
|
||||
anchors{
|
||||
top:parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: layout_actions.bottom
|
||||
}
|
||||
height: parent.height
|
||||
color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(249/255,249/255,249/255,1)
|
||||
rectX: popup.x
|
||||
rectY: popup.y
|
||||
acrylicOpacity:blurBackground ? 0.8 : 1
|
||||
}
|
||||
FluText{
|
||||
id:text_title
|
||||
font: FluTextStyle.TitleLarge
|
||||
@ -107,7 +66,7 @@ Popup {
|
||||
id:layout_actions
|
||||
height: 68
|
||||
radius: 5
|
||||
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255, blurBackground ? blur.acrylicOpacity - 0.4 : 1) : Qt.rgba(243/255,243/255,243/255,blurBackground ? blur.acrylicOpacity - 0.4 : 1)
|
||||
color: FluTheme.dark ? Qt.rgba(32/255,32/255,32/255, blurBackground ? blurOpacity - 0.4 : 1) : Qt.rgba(243/255,243/255,243/255,blurBackground ? blurOpacity - 0.4 : 1)
|
||||
anchors{
|
||||
top:text_message.bottom
|
||||
left: parent.left
|
||||
|
@ -4,9 +4,4 @@ import FluentUI
|
||||
|
||||
Rectangle {
|
||||
color: FluTheme.dark ? Window.active ? Qt.rgba(55/255,55/255,55/255,1):Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(226/255,230/255,234/255,1)
|
||||
Behavior on color{
|
||||
ColorAnimation {
|
||||
duration: 300
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -13,4 +13,9 @@ Text {
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
color: iconColor
|
||||
text: (String.fromCharCode(iconSource).toString(16))
|
||||
|
||||
FontLoader{
|
||||
source: "../Font/Segoe_Fluent_Icons.ttf"
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -51,17 +51,15 @@ Button {
|
||||
}
|
||||
}
|
||||
contentItem: Item{
|
||||
Text {
|
||||
FluIcon {
|
||||
id:text_icon
|
||||
font.family: "Segoe Fluent Icons"
|
||||
font.pixelSize: iconSize
|
||||
width: iconSize
|
||||
height: iconSize
|
||||
iconSize: control.iconSize
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
anchors.centerIn: parent
|
||||
color:control.iconColor
|
||||
text: (String.fromCharCode(iconSource).toString(16));
|
||||
iconColor: control.iconColor
|
||||
iconSource: control.iconSource;
|
||||
}
|
||||
FluTooltip{
|
||||
id:tool_tip
|
||||
|
46
src/imports/FluentUI/Controls/FluPopup.qml
Normal file
46
src/imports/FluentUI/Controls/FluPopup.qml
Normal file
@ -0,0 +1,46 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Window
|
||||
import FluentUI
|
||||
|
||||
Popup {
|
||||
id: popup
|
||||
padding: 0
|
||||
modal:true
|
||||
anchors.centerIn: Overlay.overlay
|
||||
closePolicy: Popup.CloseOnEscape
|
||||
property alias blurSource: blur.sourceItem
|
||||
property bool blurBackground: true
|
||||
property alias blurOpacity: blur.acrylicOpacity
|
||||
|
||||
enter: Transition {
|
||||
reversible: true
|
||||
NumberAnimation {
|
||||
properties: "opacity,scale"
|
||||
from:0
|
||||
to:1
|
||||
duration: 167
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: [ 0, 0, 0, 1 ]
|
||||
}
|
||||
}
|
||||
exit:Transition {
|
||||
NumberAnimation {
|
||||
properties: "opacity,scale"
|
||||
from:1
|
||||
to:0
|
||||
duration: 167
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: [ 1, 0, 0, 0 ]
|
||||
}
|
||||
}
|
||||
|
||||
background: FluAcrylic{
|
||||
id:blur
|
||||
color: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(249/255,249/255,249/255,1)
|
||||
rectX: popup.x
|
||||
rectY: popup.y
|
||||
acrylicOpacity:blurBackground ? 0.8 : 1
|
||||
}
|
||||
}
|
@ -48,7 +48,7 @@ Rectangle{
|
||||
}
|
||||
Behavior on height{
|
||||
NumberAnimation{
|
||||
duration: 167
|
||||
duration: 83
|
||||
easing.type: Easing.BezierSpline
|
||||
easing.bezierCurve: [ 1, 0, 0, 0 ]
|
||||
}
|
||||
|
Reference in New Issue
Block a user