Skip to content

Commit

Permalink
OWWidget: Customize status bar rendering
Browse files Browse the repository at this point in the history
Workaround QTBUG-60018 and remove style provided frames around
the status bar items.
  • Loading branch information
ales-erjavec committed Nov 30, 2018
1 parent 64e66ae commit 107ac89
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Orange/widgets/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
from AnyQt.QtWidgets import (
QWidget, QDialog, QVBoxLayout, QSizePolicy, QApplication, QStyle,
QShortcut, QSplitter, QSplitterHandle, QPushButton, QStatusBar,
QProgressBar, QAction, QFrame, QWIDGETSIZE_MAX
QProgressBar, QAction, QFrame, QStyleOption, QWIDGETSIZE_MAX
)
from AnyQt.QtCore import (
Qt, QObject, QEvent, QRect, QMargins, QByteArray, QDataStream, QBuffer,
QSettings, QUrl, QThread, pyqtSignal as Signal
)
from AnyQt.QtGui import QIcon, QKeySequence, QDesktopServices
from AnyQt.QtGui import QIcon, QKeySequence, QDesktopServices, QPainter

from Orange.data import FileFormat
from Orange.widgets import settings, gui
Expand Down Expand Up @@ -1195,6 +1195,16 @@ def event(self, event):
self.change.emit()
return super().event(event)

def paintEvent(self, event):
style = self.style()
opt = QStyleOption()
opt.initFrom(self)
painter = QPainter(self)
# Omit the widget instance from the call (QTBUG-60018)
style.drawPrimitive(QStyle.PE_PanelStatusBar, opt, painter, None)
# Do not draw any PE_FrameStatusBarItem frames.
painter.end()


class Message(object):
"""
Expand Down

0 comments on commit 107ac89

Please sign in to comment.