Skip to content

Commit 98de858

Browse files
committed
qtvcp -qt_actions: add window effects
1 parent fde74d1 commit 98de858

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

lib/python/qtvcp/qt_action.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
import subprocess
33

44
from PyQt5.QtWidgets import (QApplication, QTabWidget, QStackedWidget,
5-
QWidget, QGridLayout)
5+
QWidget, QGridLayout,QGraphicsBlurEffect, QGraphicsDropShadowEffect,
6+
QGraphicsColorizeEffect)
67
from PyQt5.QtCore import Qt, QProcess
78

89
import linuxcnc
@@ -754,6 +755,38 @@ def ADD_WIDGET_TO_TAB(self, widgetTo, widget,name):
754755

755756
return True
756757

758+
def SET_BLUR(self, widget, state, radius = 15):
759+
if state:
760+
blur = QGraphicsBlurEffect()
761+
blur.setBlurRadius(radius)
762+
widget.setGraphicsEffect(blur)
763+
widget.hide()
764+
widget.show()
765+
else:
766+
widget.setGraphicsEffect(None)
767+
768+
def SET_TINT(self, widget, state, color):
769+
if state:
770+
c = QGraphicsColorizeEffect()
771+
c.setColor(color)
772+
c.setStrength(1)
773+
widget.setGraphicsEffect(c)
774+
widget.hide()
775+
widget.show()
776+
else:
777+
widget.setGraphicsEffect(None)
778+
779+
def SET_SHADOW(self, widget,state,color):
780+
if state:
781+
shadow = QGraphicsDropShadowEffect()
782+
shadow.setBlurRadius(30)
783+
shadow.setColor(color)
784+
shadow.setOffset(10, 10)
785+
widget.setGraphicsEffect(shadow)
786+
widget.hide()
787+
widget.show()
788+
else:
789+
widget.setGraphicsEffect(None)
757790

758791
######################################
759792
# Action Helper functions

0 commit comments

Comments
 (0)