From 871d3a12c6c2e3a49e1b85b2ebc99369da4f36c8 Mon Sep 17 00:00:00 2001 From: Roberto Alsina Date: Mon, 3 Feb 2020 17:10:40 -0300 Subject: [PATCH] Make monitors translucid --- xrandroll/monitor_item.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/xrandroll/monitor_item.py b/xrandroll/monitor_item.py index 0ccc919..b06102c 100644 --- a/xrandroll/monitor_item.py +++ b/xrandroll/monitor_item.py @@ -1,6 +1,6 @@ from PySide2.QtCore import Qt, QObject from PySide2.QtWidgets import QGraphicsRectItem, QGraphicsTextItem -from PySide2.QtGui import QBrush +from PySide2.QtGui import QBrush, QColor class MonitorItem(QGraphicsRectItem, QObject): @@ -40,14 +40,20 @@ class MonitorItem(QGraphicsRectItem, QObject): self.label.setScale(label_scale) if data["enabled"]: if data["primary"]: - self.setBrush(QBrush("#eee8d5", Qt.SolidPattern)) + color = QColor("#eee8d5") + color.setAlpha(200) + self.setBrush(QBrush(color, Qt.SolidPattern)) self.setZValue(1000) else: - self.setBrush(QBrush("#ffffff", Qt.SolidPattern)) + color = QColor("#ffffff") + color.setAlpha(200) + self.setBrush(QBrush(color, Qt.SolidPattern)) self.setZValue(self.z) self.z -= 1 else: - self.setBrush(QBrush("#f1f1f1", Qt.SolidPattern)) + color = QColor("#f1f1f1") + color.setAlpha(200) + self.setBrush(QBrush(color, Qt.SolidPattern)) self.setZValue(-1000) if not data["current_mode"]: # Disconnected or disabled