Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

子窗口通过窗口内按钮打开和通过自定义TitleBar 中的菜单按钮打开弹出的窗口边框状态不一样 #153

Open
q784702787 opened this issue Dec 3, 2024 · 1 comment

Comments

@q784702787
Copy link

Window{
    id:mainWindow
    color: "#ffffff"
    width : 1000
    height : 800
    visible : true
    Component.onCompleted: {
        windowAgent.setup(mainWindow)
        mainWindow.visible = true
        
    }
    
    WindowAgent {
        id: windowAgent
    }
    ColumnLayout{
        anchors.fill: parent
        CustomTitleBar{
            id:titleBar
            Layout.preferredHeight: 48
            Layout.fillWidth: true
            
            title:mainWindow.title
            mainWindow: mainWindow
            windowAgent: windowAgent
            onMenuButtonClicked: {
                appMenu.open()
            }
        }
        Button{
            id:button
            text:"button"
            Layout.fillHeight:  true
            onClicked: {
                child.show()
            }
        }
    }
    
    Window{
        id:child
        width: 300
        height: 400
        
        title: qsTr("About")
        modality: Qt.ApplicationModal;
        // visible: true
        Column{
            anchors.fill: parent
            Text {
                id: appName
                anchors.horizontalCenter: parent.horizontalCenter
                text: "App 123"
                font{
                    family:"Arial"
                    bold:true
                    pixelSize: 15
                }
            }
        }
    }
    AppMenu{
        id:appMenu
        onMenuAction:{
            child.show()
        }
    }
    
}

上面的程序有两个按钮可以打开child 窗口
通过主窗口内的button 窗口打开child 窗口此时窗口边框显示正常是系统默认的边框
通过自定义TitleBar 中的菜单打开窗口会导致打开的子窗口没有边框

@q784702787
Copy link
Author

测试发现只要启用了QWK自定义边框代理,然后通过Menu 中按钮呼出的窗口也会被隐藏系统边框,不管Menu是在哪里打开的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant