update
This commit is contained in:
parent
9ced60de1e
commit
d9e10efe9c
|
@ -41,6 +41,7 @@ Item{
|
||||||
color: control.lineColor
|
color: control.lineColor
|
||||||
height: parent.height
|
height: parent.height
|
||||||
width: 2
|
width: 2
|
||||||
|
visible: repeater.count!==0
|
||||||
state: d.stateName
|
state: d.stateName
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
|
@ -110,6 +111,7 @@ Item{
|
||||||
id:layout_column
|
id:layout_column
|
||||||
spacing: 30
|
spacing: 30
|
||||||
width: control.width
|
width: control.width
|
||||||
|
height: repeater.count === 0 ? 1 : childrenRect.height
|
||||||
Repeater{
|
Repeater{
|
||||||
id:repeater
|
id:repeater
|
||||||
Item{
|
Item{
|
||||||
|
|
|
@ -12,9 +12,9 @@ Popup{
|
||||||
property int index : 0
|
property int index : 0
|
||||||
id:control
|
id:control
|
||||||
padding: 0
|
padding: 0
|
||||||
anchors.centerIn: Overlay.overlay
|
parent: Overlay.overlay
|
||||||
width: d.windowWidth
|
width: parent.width
|
||||||
height: d.windowHeight
|
height: parent.height
|
||||||
background: Item{}
|
background: Item{}
|
||||||
contentItem: Item{}
|
contentItem: Item{}
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
|
@ -50,16 +50,6 @@ Popup{
|
||||||
Item{
|
Item{
|
||||||
id:d
|
id:d
|
||||||
property var window: Window.window
|
property var window: Window.window
|
||||||
property int windowWidth: {
|
|
||||||
if(d.window)
|
|
||||||
return d.window.width
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
property int windowHeight: {
|
|
||||||
if(d.window)
|
|
||||||
return d.window.height
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
property point pos: Qt.point(0,0)
|
property point pos: Qt.point(0,0)
|
||||||
property var step : steps[index]
|
property var step : steps[index]
|
||||||
property var target : step.target()
|
property var target : step.target()
|
||||||
|
@ -125,10 +115,10 @@ Popup{
|
||||||
return 1
|
return 1
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
x: Math.min(Math.max(0,d.pos.x+d.target.width/2-width/2),d.windowWidth-width)
|
x: Math.min(Math.max(0,d.pos.x+d.target.width/2-width/2),control.width-width)
|
||||||
y:{
|
y:{
|
||||||
var ty=d.pos.y+d.target.height+control.targetMargins + 15
|
var ty=d.pos.y+d.target.height+control.targetMargins + 15
|
||||||
if((ty+height)>d.windowHeight)
|
if((ty+height)>control.height)
|
||||||
return d.pos.y-height-control.targetMargins - 15
|
return d.pos.y-height-control.targetMargins - 15
|
||||||
return ty
|
return ty
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,6 +41,7 @@ Item{
|
||||||
color: control.lineColor
|
color: control.lineColor
|
||||||
height: parent.height
|
height: parent.height
|
||||||
width: 2
|
width: 2
|
||||||
|
visible: repeater.count!==0
|
||||||
state: d.stateName
|
state: d.stateName
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
|
@ -110,6 +111,7 @@ Item{
|
||||||
id:layout_column
|
id:layout_column
|
||||||
spacing: 30
|
spacing: 30
|
||||||
width: control.width
|
width: control.width
|
||||||
|
height: repeater.count === 0 ? 1 : childrenRect.height
|
||||||
Repeater{
|
Repeater{
|
||||||
id:repeater
|
id:repeater
|
||||||
Item{
|
Item{
|
||||||
|
|
|
@ -12,9 +12,9 @@ Popup{
|
||||||
property int index : 0
|
property int index : 0
|
||||||
id:control
|
id:control
|
||||||
padding: 0
|
padding: 0
|
||||||
anchors.centerIn: Overlay.overlay
|
parent: Overlay.overlay
|
||||||
width: d.window?.width
|
width: parent.width
|
||||||
height: d.window?.height
|
height: parent.height
|
||||||
background: Item{}
|
background: Item{}
|
||||||
contentItem: Item{}
|
contentItem: Item{}
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
|
@ -50,7 +50,7 @@ Popup{
|
||||||
Item{
|
Item{
|
||||||
id:d
|
id:d
|
||||||
property var window: Window.window
|
property var window: Window.window
|
||||||
property var pos:Qt.point(0,0)
|
property point pos: Qt.point(0,0)
|
||||||
property var step : steps[index]
|
property var step : steps[index]
|
||||||
property var target : step.target()
|
property var target : step.target()
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,8 @@ Popup{
|
||||||
ctx.fillRect(0, 0, canvasSize.width, canvasSize.height)
|
ctx.fillRect(0, 0, canvasSize.width, canvasSize.height)
|
||||||
ctx.globalCompositeOperation = 'destination-out'
|
ctx.globalCompositeOperation = 'destination-out'
|
||||||
ctx.fillStyle = 'black'
|
ctx.fillStyle = 'black'
|
||||||
drawRoundedRect(Qt.rect(d.pos.x-control.targetMargins,d.pos.y-control.targetMargins, d.target.width+control.targetMargins*2, d.target.height+control.targetMargins*2),2,ctx)
|
var rect = Qt.rect(d.pos.x-control.targetMargins,d.pos.y-control.targetMargins, d.target.width+control.targetMargins*2, d.target.height+control.targetMargins*2)
|
||||||
|
drawRoundedRect(rect,2,ctx)
|
||||||
ctx.restore()
|
ctx.restore()
|
||||||
}
|
}
|
||||||
function drawRoundedRect(rect, r, ctx) {
|
function drawRoundedRect(rect, r, ctx) {
|
||||||
|
@ -109,11 +110,17 @@ Popup{
|
||||||
width: 500
|
width: 500
|
||||||
height: 88 + text_desc.height
|
height: 88 + text_desc.height
|
||||||
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
color: FluTheme.dark ? Qt.rgba(39/255,39/255,39/255,1) : Qt.rgba(251/255,251/255,253/255,1)
|
||||||
property int dir : (y<d.pos.y)?1:0
|
property int dir : {
|
||||||
x: Math.min(Math.max(0,d.pos.x+d.target.width/2-width/2),d.window?.width-width)
|
if(y<d.pos.y)
|
||||||
y: {
|
return 1
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
x: Math.min(Math.max(0,d.pos.x+d.target.width/2-width/2),control.width-width)
|
||||||
|
y:{
|
||||||
var ty=d.pos.y+d.target.height+control.targetMargins + 15
|
var ty=d.pos.y+d.target.height+control.targetMargins + 15
|
||||||
return ((ty+height)>d.window?.height)?(d.pos.y-height-control.targetMargins - 15):ty
|
if((ty+height)>control.height)
|
||||||
|
return d.pos.y-height-control.targetMargins - 15
|
||||||
|
return ty
|
||||||
}
|
}
|
||||||
border.width: 0
|
border.width: 0
|
||||||
FluShadow{
|
FluShadow{
|
||||||
|
|
Loading…
Reference in New Issue