Compare commits
3 Commits
3f7555d4e6
...
a184e6b7df
Author | SHA1 | Date |
---|---|---|
|
a184e6b7df | |
|
7c4bedb907 | |
|
2d2f991128 |
|
@ -34,6 +34,26 @@ static inline bool isCompositionEnabled(){
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void showShadow(HWND hwnd){
|
||||||
|
if(isCompositionEnabled()){
|
||||||
|
const MARGINS shadow = { 0, 0, 1, 0 };
|
||||||
|
typedef HRESULT (WINAPI* DwmExtendFrameIntoClientAreaPtr)(HWND hWnd, const MARGINS *pMarInset);
|
||||||
|
HMODULE module = LoadLibraryW(L"dwmapi.dll");
|
||||||
|
if (module)
|
||||||
|
{
|
||||||
|
DwmExtendFrameIntoClientAreaPtr dwm_extendframe_into_client_area_;
|
||||||
|
dwm_extendframe_into_client_area_= reinterpret_cast<DwmExtendFrameIntoClientAreaPtr>(GetProcAddress(module, "DwmExtendFrameIntoClientArea"));
|
||||||
|
if (dwm_extendframe_into_client_area_)
|
||||||
|
{
|
||||||
|
dwm_extendframe_into_client_area_(hwnd, &shadow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
ULONG_PTR cNewStyle = GetClassLongPtr(hwnd, GCL_STYLE) | CS_DROPSHADOW;
|
||||||
|
SetClassLongPtr(hwnd, GCL_STYLE, cNewStyle);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FramelessEventFilter::FramelessEventFilter(FluFramelessHelper* helper){
|
FramelessEventFilter::FramelessEventFilter(FluFramelessHelper* helper){
|
||||||
|
@ -322,6 +342,11 @@ void FluFramelessHelper::componentComplete(){
|
||||||
_appBar.value<QObject*>()->setProperty("systemMoveEnable",false);
|
_appBar.value<QObject*>()->setProperty("systemMoveEnable",false);
|
||||||
}
|
}
|
||||||
window->setFlags((window->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint | Qt::FramelessWindowHint);
|
window->setFlags((window->flags()) | Qt::CustomizeWindowHint | Qt::WindowMinimizeButtonHint | Qt::WindowCloseButtonHint | Qt::FramelessWindowHint);
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(6,0,0)
|
||||||
|
if(FluTools::getInstance()->isSoftware()){
|
||||||
|
window->setFlag(Qt::FramelessWindowHint,false);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
if(resizeable()){
|
if(resizeable()){
|
||||||
window->setFlag(Qt::WindowMaximizeButtonHint);
|
window->setFlag(Qt::WindowMaximizeButtonHint);
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,7 @@ Item {
|
||||||
d.flag = false
|
d.flag = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
clip: true
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:layout_header
|
id:layout_header
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
@ -79,10 +80,10 @@ Item {
|
||||||
topMargin: -1
|
topMargin: -1
|
||||||
left: layout_header.left
|
left: layout_header.left
|
||||||
}
|
}
|
||||||
clip: true
|
|
||||||
visible: contentHeight+container.anchors.topMargin !== 0
|
visible: contentHeight+container.anchors.topMargin !== 0
|
||||||
height: contentHeight+container.anchors.topMargin
|
height: contentHeight+container.anchors.topMargin
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
z:-999
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:container
|
id:container
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
@ -9,11 +9,19 @@ FluWindow {
|
||||||
property Component contentDelegate
|
property Component contentDelegate
|
||||||
autoVisible: false
|
autoVisible: false
|
||||||
autoCenter: false
|
autoCenter: false
|
||||||
autoDestory: false
|
autoDestory: true
|
||||||
fixSize: true
|
fixSize: true
|
||||||
Loader{
|
Loader{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
sourceComponent: control.visible ? control.contentDelegate : undefined
|
sourceComponent: {
|
||||||
|
if(control.autoDestory){
|
||||||
|
return control.visible ? control.contentDelegate : undefined
|
||||||
|
}
|
||||||
|
return control.contentDelegate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closeListener: function(event){
|
||||||
|
event.accepted = true
|
||||||
}
|
}
|
||||||
function showDialog(){
|
function showDialog(){
|
||||||
var x = transientParent.x + (transientParent.width - width)/2
|
var x = transientParent.x + (transientParent.width - width)/2
|
||||||
|
|
|
@ -20,6 +20,7 @@ Item {
|
||||||
d.flag = false
|
d.flag = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
clip: true
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:layout_header
|
id:layout_header
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
@ -79,10 +80,10 @@ Item {
|
||||||
topMargin: -1
|
topMargin: -1
|
||||||
left: layout_header.left
|
left: layout_header.left
|
||||||
}
|
}
|
||||||
clip: true
|
|
||||||
visible: contentHeight+container.anchors.topMargin !== 0
|
visible: contentHeight+container.anchors.topMargin !== 0
|
||||||
height: contentHeight+container.anchors.topMargin
|
height: contentHeight+container.anchors.topMargin
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
z:-999
|
||||||
Rectangle{
|
Rectangle{
|
||||||
id:container
|
id:container
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
|
@ -9,11 +9,19 @@ FluWindow {
|
||||||
property Component contentDelegate
|
property Component contentDelegate
|
||||||
autoVisible: false
|
autoVisible: false
|
||||||
autoCenter: false
|
autoCenter: false
|
||||||
autoDestory: false
|
autoDestory: true
|
||||||
fixSize: true
|
fixSize: true
|
||||||
Loader{
|
Loader{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
sourceComponent: control.visible ? control.contentDelegate : undefined
|
sourceComponent: {
|
||||||
|
if(control.autoDestory){
|
||||||
|
return control.visible ? control.contentDelegate : undefined
|
||||||
|
}
|
||||||
|
return control.contentDelegate
|
||||||
|
}
|
||||||
|
}
|
||||||
|
closeListener: function(event){
|
||||||
|
event.accepted = true
|
||||||
}
|
}
|
||||||
function showDialog(){
|
function showDialog(){
|
||||||
var x = transientParent.x + (transientParent.width - width)/2
|
var x = transientParent.x + (transientParent.width - width)/2
|
||||||
|
|
Loading…
Reference in New Issue