mirror of
https://github.com/ralsina/xrandroll.git
synced 2024-11-24 12:02:23 +00:00
Make monitors translucid
This commit is contained in:
parent
99c30ce7b9
commit
871d3a12c6
@ -1,6 +1,6 @@
|
|||||||
from PySide2.QtCore import Qt, QObject
|
from PySide2.QtCore import Qt, QObject
|
||||||
from PySide2.QtWidgets import QGraphicsRectItem, QGraphicsTextItem
|
from PySide2.QtWidgets import QGraphicsRectItem, QGraphicsTextItem
|
||||||
from PySide2.QtGui import QBrush
|
from PySide2.QtGui import QBrush, QColor
|
||||||
|
|
||||||
|
|
||||||
class MonitorItem(QGraphicsRectItem, QObject):
|
class MonitorItem(QGraphicsRectItem, QObject):
|
||||||
@ -40,14 +40,20 @@ class MonitorItem(QGraphicsRectItem, QObject):
|
|||||||
self.label.setScale(label_scale)
|
self.label.setScale(label_scale)
|
||||||
if data["enabled"]:
|
if data["enabled"]:
|
||||||
if data["primary"]:
|
if data["primary"]:
|
||||||
self.setBrush(QBrush("#eee8d5", Qt.SolidPattern))
|
color = QColor("#eee8d5")
|
||||||
|
color.setAlpha(200)
|
||||||
|
self.setBrush(QBrush(color, Qt.SolidPattern))
|
||||||
self.setZValue(1000)
|
self.setZValue(1000)
|
||||||
else:
|
else:
|
||||||
self.setBrush(QBrush("#ffffff", Qt.SolidPattern))
|
color = QColor("#ffffff")
|
||||||
|
color.setAlpha(200)
|
||||||
|
self.setBrush(QBrush(color, Qt.SolidPattern))
|
||||||
self.setZValue(self.z)
|
self.setZValue(self.z)
|
||||||
self.z -= 1
|
self.z -= 1
|
||||||
else:
|
else:
|
||||||
self.setBrush(QBrush("#f1f1f1", Qt.SolidPattern))
|
color = QColor("#f1f1f1")
|
||||||
|
color.setAlpha(200)
|
||||||
|
self.setBrush(QBrush(color, Qt.SolidPattern))
|
||||||
self.setZValue(-1000)
|
self.setZValue(-1000)
|
||||||
|
|
||||||
if not data["current_mode"]: # Disconnected or disabled
|
if not data["current_mode"]: # Disconnected or disabled
|
||||||
|
Loading…
Reference in New Issue
Block a user