Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disabled Qt-Buttons are not shown as disabled in Plasma 5.2 (KDE 5)

In KDE 5 (Kubuntu 15.04 / Plasma 5.2) disabled Qt-Buttons (Qt4) are indistinguishable from non-disabled buttons. This problem does not exist in KDE 4.14 as the following screen-shot shows:

Disabled buttons: KDE 4 versus KDE 5

The program source for this dialog is written in Python with PyQt4:

from PyQt4 import QtGui
import sys


if __name__ == "__main__":
    # main function

    app = QtGui.QApplication(sys.argv)

    qw = QtGui.QWidget()
    qw.resize(150, 120)
    qw.setWindowTitle("KDE 4")
    #qw.setWindowTitle("KDE 5")

    b1, b2 = QtGui.QPushButton(qw), QtGui.QPushButton(qw)
    for b, y, e in zip([b1, b2], [30, 60], [False, True]):
        b.move(30, y)
        b.setEnabled(e)
        b.setText("Enabled" if e else "Disabled")

    qw.show()
    sys.exit(app.exec_())

How can I make disabled Buttons in KDE 5 recognizable?

Update 2015-07-17:

It seems to be a problem of themes: In Debian/sid using the Oxygen-Theme avoids this problem.

Also Bug 343930 addresses this problem.

like image 708
Dietrich Avatar asked May 04 '15 13:05

Dietrich


1 Answers

This was a bug in the Breeze theme used by KDE/Plasma5. It has now been resolved. Below are the screenshots of enabled and disabled buttons using Qt5 and PyQt5.

Using C++/Qt5

Using Python/Qt5

like image 129
Marcus Avatar answered Sep 18 '22 01:09

Marcus