Compare commits
No commits in common. "50f70711727169005a4bd9fb7b1add9855f432c7" and "9ced60de1e5959bfbccb6aac077f211bbb12675d" have entirely different histories.
50f7071172
...
9ced60de1e
|
@ -325,13 +325,13 @@ void FluFramelessHelper::componentComplete(){
|
||||||
exstyle = exstyle | WS_EX_LAYERED;
|
exstyle = exstyle | WS_EX_LAYERED;
|
||||||
SetWindowLongPtr(hwnd, GWL_EXSTYLE, exstyle);
|
SetWindowLongPtr(hwnd, GWL_EXSTYLE, exstyle);
|
||||||
SetLayeredWindowAttributes(hwnd, RGB(251, 255, 242), 0, LWA_COLORKEY);
|
SetLayeredWindowAttributes(hwnd, RGB(251, 255, 242), 0, LWA_COLORKEY);
|
||||||
|
SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
|
||||||
connect(window,&QQuickWindow::activeChanged,this,[this,hwnd]{
|
connect(window,&QQuickWindow::activeChanged,this,[this,hwnd]{
|
||||||
if(this->window->isActive()){
|
if(this->window->isActive()){
|
||||||
LONG exstyle = ::GetWindowLong(hwnd, GWL_EXSTYLE);
|
LONG exstyle = ::GetWindowLong(hwnd, GWL_EXSTYLE);
|
||||||
if(exstyle & WS_EX_LAYERED){
|
if(exstyle & WS_EX_LAYERED){
|
||||||
exstyle = exstyle &~ WS_EX_LAYERED;
|
exstyle = exstyle &~ WS_EX_LAYERED;
|
||||||
SetWindowLongPtr(hwnd, GWL_EXSTYLE, exstyle);
|
SetWindowLongPtr(hwnd, GWL_EXSTYLE, exstyle);
|
||||||
SetWindowPos(hwnd,nullptr,0,0,0,0,SWP_NOZORDER | SWP_NOOWNERZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -41,7 +41,6 @@ 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 {
|
||||||
|
@ -111,7 +110,6 @@ 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
|
||||||
parent: Overlay.overlay
|
anchors.centerIn: Overlay.overlay
|
||||||
width: parent.width
|
width: d.windowWidth
|
||||||
height: parent.height
|
height: d.windowHeight
|
||||||
background: Item{}
|
background: Item{}
|
||||||
contentItem: Item{}
|
contentItem: Item{}
|
||||||
onVisibleChanged: {
|
onVisibleChanged: {
|
||||||
|
@ -50,6 +50,16 @@ 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()
|
||||||
|
@ -115,10 +125,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),control.width-width)
|
x: Math.min(Math.max(0,d.pos.x+d.target.width/2-width/2),d.windowWidth-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)>control.height)
|
if((ty+height)>d.windowHeight)
|
||||||
return d.pos.y-height-control.targetMargins - 15
|
return d.pos.y-height-control.targetMargins - 15
|
||||||
return ty
|
return ty
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,6 @@ 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 {
|
||||||
|
@ -111,7 +110,6 @@ 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
|
||||||
parent: Overlay.overlay
|
anchors.centerIn: Overlay.overlay
|
||||||
width: parent.width
|
width: d.window?.width
|
||||||
height: parent.height
|
height: d.window?.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 point pos: Qt.point(0,0)
|
property var 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,8 +85,7 @@ 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'
|
||||||
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(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)
|
||||||
drawRoundedRect(rect,2,ctx)
|
|
||||||
ctx.restore()
|
ctx.restore()
|
||||||
}
|
}
|
||||||
function drawRoundedRect(rect, r, ctx) {
|
function drawRoundedRect(rect, r, ctx) {
|
||||||
|
@ -110,17 +109,11 @@ 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 : {
|
property int dir : (y<d.pos.y)?1:0
|
||||||
if(y<d.pos.y)
|
x: Math.min(Math.max(0,d.pos.x+d.target.width/2-width/2),d.window?.width-width)
|
||||||
return 1
|
y: {
|
||||||
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
|
||||||
if((ty+height)>control.height)
|
return ((ty+height)>d.window?.height)?(d.pos.y-height-control.targetMargins - 15):ty
|
||||||
return d.pos.y-height-control.targetMargins - 15
|
|
||||||
return ty
|
|
||||||
}
|
}
|
||||||
border.width: 0
|
border.width: 0
|
||||||
FluShadow{
|
FluShadow{
|
||||||
|
|
Loading…
Reference in New Issue