qtmodern icon indicating copy to clipboard operation
qtmodern copied to clipboard

added ModernDialog and ModernMessageBox

Open razaqq opened this issue 6 years ago • 4 comments

ModernDialog is used just like a QDialog.

d = ModernDialog(hideWindowButtons=True)
d.setWindowTitle('Changelog')

main_layout = QVBoxLayout()
main_layout.setSpacing(10)

text = QTextEdit()
text.setPlainText('This is a text\nto demonstrate\na ModernDialog')
text.setReadOnly(True)
text.setFixedHeight(100)
main_layout.addWidget(text, alignment=Qt.AlignCenter)

button_box = QDialogButtonBox()
button_box.setOrientation(Qt.Horizontal)
button_box.setStandardButtons(QDialogButtonBox.Ok)
button_box.setCenterButtons(True)
button_box.accepted.connect(d.accept)
main_layout.addWidget(button_box, alignment=Qt.AlignCenter)

d.windowContent.setLayout(main_layout)
d.exec()

grafik

ModernMessageBox is used just like a QMessageBox Simple example below

box = ModernMessageBox()
box.setIcon(QMessageBox.Question)
box.setStandardButtons(QMessageBox.Yes | QMessageBox.No)
box.setEscapeButton(QMessageBox.No)
box.setText("There is a new version available.\nWould you like to update now?")

if box.exec_() == QMessageBox.Yes:
    box.hide()
    print('yes')
else:
    print('no')
    box.hide()

grafik

razaqq avatar Feb 06 '20 21:02 razaqq

should be done

however the merging of all the changes from the other pull request of hiding window buttons was detected horribly by git, which made this a mess...

i could redo this pull request if you want

razaqq avatar Feb 17 '20 15:02 razaqq

should be done

however the merging of all the changes from the other pull request of hiding window buttons was detected horribly by git, which made this a mess...

i could redo this pull request if you want

I do Squash and Merge while incorperating "single fixes" that can be understood without all git history. Though in this case the changed files looks a bit odd so please create a new PR with the changes. :)

Jerakin avatar Feb 17 '20 19:02 Jerakin

okay i have redone this starting with the current origin/master. Force pushed over this branch, so we are back to a single commit

razaqq avatar Feb 18 '20 12:02 razaqq

Is this project still active? I'd really love to have these features and would implement them myself, but it would take some work to understand the code as the documentation is somewhat scarce.

iron3oxide avatar Mar 26 '22 14:03 iron3oxide