forked from openlp/openlp
Made highlight colour slightly lighter/darker than background.
This commit is contained in:
parent
8c3370d803
commit
ee6465d8a5
@ -31,8 +31,7 @@ from openlp.core.lib import OpenLPToolbar, translate, Receiver, ServiceType
|
|||||||
label_stylesheet = u"""
|
label_stylesheet = u"""
|
||||||
QTableWidget::item:selected
|
QTableWidget::item:selected
|
||||||
{
|
{
|
||||||
background-color: palette(highlight);
|
background-color: %s;
|
||||||
color: palette(highlighted-text);
|
|
||||||
}
|
}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -45,6 +44,12 @@ class SlideList(QtGui.QTableWidget):
|
|||||||
def __init__(self, parent=None, name=None):
|
def __init__(self, parent=None, name=None):
|
||||||
QtGui.QTableWidget.__init__(self, parent.Controller)
|
QtGui.QTableWidget.__init__(self, parent.Controller)
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
|
text_color = QtGui.QApplication.palette().color(QtGui.QPalette.Base)
|
||||||
|
if text_color.value() > 128:
|
||||||
|
text_color = text_color.darker(120).name()
|
||||||
|
else:
|
||||||
|
text_color = text_color.lighter(120).name()
|
||||||
|
self.setStyleSheet(label_stylesheet % text_color)
|
||||||
|
|
||||||
def keyPressEvent(self, event):
|
def keyPressEvent(self, event):
|
||||||
if type(event) == QtGui.QKeyEvent:
|
if type(event) == QtGui.QKeyEvent:
|
||||||
@ -327,7 +332,6 @@ class SlideController(QtGui.QWidget):
|
|||||||
self.PreviewListWidget.setCellWidget(framenumber, 0, label)
|
self.PreviewListWidget.setCellWidget(framenumber, 0, label)
|
||||||
self.PreviewListWidget.setItem(framenumber, 0, item)
|
self.PreviewListWidget.setItem(framenumber, 0, item)
|
||||||
self.PreviewListWidget.setRowHeight(framenumber, slide_height)
|
self.PreviewListWidget.setRowHeight(framenumber, slide_height)
|
||||||
self.PreviewListWidget.setStyleSheet(label_stylesheet)
|
|
||||||
self.PreviewListWidget.setColumnWidth(
|
self.PreviewListWidget.setColumnWidth(
|
||||||
0, self.PreviewListWidget.viewport().size().width())
|
0, self.PreviewListWidget.viewport().size().width())
|
||||||
if slideno > self.PreviewListWidget.rowCount():
|
if slideno > self.PreviewListWidget.rowCount():
|
||||||
|
Loading…
Reference in New Issue
Block a user