RibbonBackStageView: Add bgColor and menuBgColor properties, fix bg blur opacity bug.
This commit is contained in:
parent
e43b1eaf04
commit
d13416e0d1
|
@ -21,6 +21,8 @@ Popup {
|
||||||
property string backText: qsTr("Back")
|
property string backText: qsTr("Back")
|
||||||
property int radius: 0
|
property int radius: 0
|
||||||
property var pageModel: []
|
property var pageModel: []
|
||||||
|
property string bgColor: RibbonTheme.isDarkMode ? RibbonTheme.modernStyle ? "#0A0A0A" : "#262626" : RibbonTheme.modernStyle ? "#F0F0F0" : "white"
|
||||||
|
property string menuBgColor: RibbonTheme.isDarkMode ? "#363636" : RibbonTheme.modernStyle ? "white" : "#365695"
|
||||||
default property alias data: data_container.data
|
default property alias data: data_container.data
|
||||||
signal backBtnClicked()
|
signal backBtnClicked()
|
||||||
|
|
||||||
|
@ -63,7 +65,7 @@ Popup {
|
||||||
target: blurTarget
|
target: blurTarget
|
||||||
targetRect: Qt.rect(control.x + control.leftMargin, control.y + control.topMargin, control.width, control.height)
|
targetRect: Qt.rect(control.x + control.leftMargin, control.y + control.topMargin, control.width, control.height)
|
||||||
visible: blurEnabled
|
visible: blurEnabled
|
||||||
maskColor: content_bg.color
|
maskColor: control.bgColor
|
||||||
maskOpacity: 0
|
maskOpacity: 0
|
||||||
blurRadius: 0
|
blurRadius: 0
|
||||||
radius: control.radius
|
radius: control.radius
|
||||||
|
@ -101,7 +103,7 @@ Popup {
|
||||||
}
|
}
|
||||||
width: 150
|
width: 150
|
||||||
x: -width
|
x: -width
|
||||||
color: alphaTohex(RibbonTheme.isDarkMode ? "#363636" : RibbonTheme.modernStyle ? "white" : "#365695", blurEnabled ? RibbonTheme.modernStyle ? 0.8 : 0.9 : 1)
|
color: alphaTohex(control.menuBgColor, blurEnabled ? RibbonTheme.modernStyle ? 0.8 : 0.9 : 1)
|
||||||
topLeftRadius: control.topMargin <= 0 ? control.radius : 0
|
topLeftRadius: control.topMargin <= 0 ? control.radius : 0
|
||||||
bottomLeftRadius: topLeftRadius
|
bottomLeftRadius: topLeftRadius
|
||||||
property int currentMenu: 0
|
property int currentMenu: 0
|
||||||
|
@ -464,7 +466,7 @@ Popup {
|
||||||
function show(){
|
function show(){
|
||||||
control.opacity = 1
|
control.opacity = 1
|
||||||
menu_bg.x = 0
|
menu_bg.x = 0
|
||||||
content_bg.color = alphaTohex(RibbonTheme.isDarkMode ? RibbonTheme.modernStyle ? "#0A0A0A" : "#262626" : RibbonTheme.modernStyle ? "#F0F0F0" : "white", blurEnabled ? RibbonTheme.modernStyle ? 0.95 : 0.9 : 1)
|
content_bg.color = alphaTohex(control.bgColor, blurEnabled ? RibbonTheme.modernStyle ? 0.95 : 0.9 : 1)
|
||||||
blur_bg.maskOpacity = blurEnabled ? 0.5 : 1
|
blur_bg.maskOpacity = blurEnabled ? 0.5 : 1
|
||||||
blur_bg.blurRadius = blurEnabled ? 32 : 0
|
blur_bg.blurRadius = blurEnabled ? 32 : 0
|
||||||
blur_bg.opacity = 1
|
blur_bg.opacity = 1
|
||||||
|
@ -472,7 +474,7 @@ Popup {
|
||||||
|
|
||||||
function hide(){
|
function hide(){
|
||||||
menu_bg.x = -menu_bg.width
|
menu_bg.x = -menu_bg.width
|
||||||
content_bg.color = alphaTohex(RibbonTheme.isDarkMode ? RibbonTheme.modernStyle ? "#0A0A0A" : "#262626" : RibbonTheme.modernStyle ? "#F0F0F0" : "white", 0)
|
content_bg.color = alphaTohex(control.bgColor, 0)
|
||||||
blur_bg.maskOpacity = 0
|
blur_bg.maskOpacity = 0
|
||||||
blur_bg.blurRadius = 0
|
blur_bg.blurRadius = 0
|
||||||
blur_bg.opacity = 0
|
blur_bg.opacity = 0
|
||||||
|
@ -480,7 +482,7 @@ Popup {
|
||||||
}
|
}
|
||||||
|
|
||||||
function refresh(){
|
function refresh(){
|
||||||
content_bg.color = alphaTohex(RibbonTheme.isDarkMode ? RibbonTheme.modernStyle ? "#0A0A0A" : "#262626" : RibbonTheme.modernStyle ? "#F0F0F0" : "white", blurEnabled ? RibbonTheme.modernStyle ? 0.95 : 0.9 : 1)
|
content_bg.color = alphaTohex(control.bgColor, blurEnabled ? RibbonTheme.modernStyle ? 0.95 : 0.9 : 1)
|
||||||
blur_bg.maskOpacity = blurEnabled ? 0.5 : 1
|
blur_bg.maskOpacity = blurEnabled ? 0.5 : 1
|
||||||
blur_bg.blurRadius = blurEnabled ? 32 : 0
|
blur_bg.blurRadius = blurEnabled ? 32 : 0
|
||||||
blur_bg.opacity = 1
|
blur_bg.opacity = 1
|
||||||
|
|
|
@ -21,6 +21,8 @@ Popup {
|
||||||
property string backText: qsTr("Back")
|
property string backText: qsTr("Back")
|
||||||
property int radius: 0
|
property int radius: 0
|
||||||
property var pageModel: []
|
property var pageModel: []
|
||||||
|
property string bgColor: RibbonTheme.isDarkMode ? RibbonTheme.modernStyle ? "#0A0A0A" : "#262626" : RibbonTheme.modernStyle ? "#F0F0F0" : "white"
|
||||||
|
property string menuBgColor: RibbonTheme.isDarkMode ? "#363636" : RibbonTheme.modernStyle ? "white" : "#365695"
|
||||||
default property alias data: data_container.data
|
default property alias data: data_container.data
|
||||||
signal backBtnClicked()
|
signal backBtnClicked()
|
||||||
|
|
||||||
|
@ -63,7 +65,7 @@ Popup {
|
||||||
target: blurTarget
|
target: blurTarget
|
||||||
targetRect: Qt.rect(control.x + control.leftMargin, control.y + control.topMargin, control.width, control.height)
|
targetRect: Qt.rect(control.x + control.leftMargin, control.y + control.topMargin, control.width, control.height)
|
||||||
visible: blurEnabled
|
visible: blurEnabled
|
||||||
maskColor: content_bg.color
|
maskColor: control.bgColor
|
||||||
maskOpacity: 0
|
maskOpacity: 0
|
||||||
blurRadius: 0
|
blurRadius: 0
|
||||||
radius: control.radius
|
radius: control.radius
|
||||||
|
@ -101,7 +103,7 @@ Popup {
|
||||||
}
|
}
|
||||||
width: 150
|
width: 150
|
||||||
x: -width
|
x: -width
|
||||||
color: Qt.alpha(RibbonTheme.isDarkMode ? "#363636" : RibbonTheme.modernStyle ? "white" : "#365695", blurEnabled ? RibbonTheme.modernStyle ? 0.8 : 0.9 : 1)
|
color: Qt.alpha(control.menuBgColor, blurEnabled ? RibbonTheme.modernStyle ? 0.8 : 0.9 : 1)
|
||||||
topLeftRadius: control.topMargin <= 0 ? control.radius : 0
|
topLeftRadius: control.topMargin <= 0 ? control.radius : 0
|
||||||
bottomLeftRadius: topLeftRadius
|
bottomLeftRadius: topLeftRadius
|
||||||
property int currentMenu: 0
|
property int currentMenu: 0
|
||||||
|
@ -415,7 +417,7 @@ Popup {
|
||||||
}
|
}
|
||||||
topRightRadius: control.topMargin <= 0 ? control.radius : 0
|
topRightRadius: control.topMargin <= 0 ? control.radius : 0
|
||||||
bottomRightRadius: topRightRadius
|
bottomRightRadius: topRightRadius
|
||||||
color: Qt.alpha(RibbonTheme.isDarkMode ? RibbonTheme.modernStyle ? "#0A0A0A" : "#262626" : RibbonTheme.modernStyle ? "#F0F0F0" : "white", 0)
|
color: Qt.alpha(RibbonTheme.isDarkMode ? RibbonTheme.modernStyle ? "#0A0A0A" : "#262626" : RibbonTheme.modernStyle ? "#F0F0F0" : "white", 1)
|
||||||
|
|
||||||
Behavior on color {
|
Behavior on color {
|
||||||
ColorAnimation {
|
ColorAnimation {
|
||||||
|
@ -464,7 +466,7 @@ Popup {
|
||||||
function show(){
|
function show(){
|
||||||
control.opacity = 1
|
control.opacity = 1
|
||||||
menu_bg.x = 0
|
menu_bg.x = 0
|
||||||
content_bg.color = Qt.alpha(RibbonTheme.isDarkMode ? RibbonTheme.modernStyle ? "#0A0A0A" : "#262626" : RibbonTheme.modernStyle ? "#F0F0F0" : "white", blurEnabled ? RibbonTheme.modernStyle ? 0.95 : 0.9 : 1)
|
content_bg.color = Qt.alpha(control.bgColor, blurEnabled ? RibbonTheme.modernStyle ? 0.95 : 0.9 : 1)
|
||||||
blur_bg.maskOpacity = blurEnabled ? 0.5 : 1
|
blur_bg.maskOpacity = blurEnabled ? 0.5 : 1
|
||||||
blur_bg.blurRadius = blurEnabled ? 32 : 0
|
blur_bg.blurRadius = blurEnabled ? 32 : 0
|
||||||
blur_bg.opacity = 1
|
blur_bg.opacity = 1
|
||||||
|
@ -472,7 +474,7 @@ Popup {
|
||||||
|
|
||||||
function hide(){
|
function hide(){
|
||||||
menu_bg.x = -menu_bg.width
|
menu_bg.x = -menu_bg.width
|
||||||
content_bg.color = Qt.alpha(RibbonTheme.isDarkMode ? RibbonTheme.modernStyle ? "#0A0A0A" : "#262626" : RibbonTheme.modernStyle ? "#F0F0F0" : "white", 0)
|
content_bg.color = Qt.alpha(control.bgColor, 0)
|
||||||
blur_bg.maskOpacity = 0
|
blur_bg.maskOpacity = 0
|
||||||
blur_bg.blurRadius = 0
|
blur_bg.blurRadius = 0
|
||||||
blur_bg.opacity = 0
|
blur_bg.opacity = 0
|
||||||
|
@ -480,7 +482,7 @@ Popup {
|
||||||
}
|
}
|
||||||
|
|
||||||
function refresh(){
|
function refresh(){
|
||||||
content_bg.color = Qt.alpha(RibbonTheme.isDarkMode ? RibbonTheme.modernStyle ? "#0A0A0A" : "#262626" : RibbonTheme.modernStyle ? "#F0F0F0" : "white", blurEnabled ? RibbonTheme.modernStyle ? 0.95 : 0.9 : 1)
|
content_bg.color = Qt.alpha(control.bgColor, blurEnabled ? RibbonTheme.modernStyle ? 0.95 : 0.9 : 1)
|
||||||
blur_bg.maskOpacity = blurEnabled ? 0.5 : 1
|
blur_bg.maskOpacity = blurEnabled ? 0.5 : 1
|
||||||
blur_bg.blurRadius = blurEnabled ? 32 : 0
|
blur_bg.blurRadius = blurEnabled ? 32 : 0
|
||||||
blur_bg.opacity = 1
|
blur_bg.opacity = 1
|
||||||
|
|
Loading…
Reference in New Issue