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

Enhance FluentTitleBar #762

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

immiProgrammer
Copy link
Contributor

for customization

@immiProgrammer
Copy link
Contributor Author

In this way user/programmer can customize titleBar in initLayout function and add widgets normaly in hboxlayout
like this self.hboxLayout.addwidget(tabBar)

@immiProgrammer
Copy link
Contributor Author

after that u can customize titleBar like this:

class CustomTitleBar(MSFluentTitleBar):

    def __init__(self, parent):
        super().__init__(parent)
    
    def initLayout(self):
        super().initLayout()

        # add search line edit and about button
        self.searchLineEdit = SearchLineEdit(self)
        self.searchLineEdit.setPlaceholderText('搜索应用、游戏、电影、设备等')
        self.searchLineEdit.setFixedWidth(400)
        self.searchLineEdit.setClearButtonEnabled(True)

        self.aboutButton = TransparentToolButton(FIF.INFO, self)

        self.hBoxLayout.addWidget(self.searchLineEdit, 1, Qt.AlignHCenter)
        self.hBoxLayout.addWidget(self.aboutButton, 0, Qt.AlignRight)
        self.hBoxLayout.addSpacing(5)

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

Successfully merging this pull request may close these issues.

None yet

1 participant