Commit 8d887edd authored by Dan Pascu's avatar Dan Pascu

Properly paint the ZRTPWidget background when WA_NoSystemBackground is set

parent a17a4361
...@@ -6,7 +6,8 @@ __all__ = ['ZRTPWidget'] ...@@ -6,7 +6,8 @@ __all__ = ['ZRTPWidget']
from PyQt4 import uic from PyQt4 import uic
from PyQt4.QtCore import pyqtSignal from PyQt4.QtCore import Qt, pyqtSignal
from PyQt4.QtGui import QStyle, QStyleOption, QStylePainter
from blink.resources import Resources from blink.resources import Resources
...@@ -68,6 +69,13 @@ class ZRTPWidget(base_class, ui_class): ...@@ -68,6 +69,13 @@ class ZRTPWidget(base_class, ui_class):
self.closed.emit() self.closed.emit()
self._check_name_changes() self._check_name_changes()
def paintEvent(self, event):
option = QStyleOption()
option.initFrom(self)
painter = QStylePainter(self)
painter.setRenderHint(QStylePainter.Antialiasing, True)
painter.drawPrimitive(QStyle.PE_Widget if self.testAttribute(Qt.WA_NoSystemBackground) else QStyle.PE_Frame, option)
def _check_name_changes(self): def _check_name_changes(self):
peer_name = self.peer_name_value.text() peer_name = self.peer_name_value.text()
if peer_name != self.__dict__['peer_name']: if peer_name != self.__dict__['peer_name']:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment