|
2 | 2 | import subprocess |
3 | 3 |
|
4 | 4 | from PyQt5.QtWidgets import (QApplication, QTabWidget, QStackedWidget, |
5 | | - QWidget, QGridLayout) |
| 5 | + QWidget, QGridLayout,QGraphicsBlurEffect, QGraphicsDropShadowEffect, |
| 6 | + QGraphicsColorizeEffect) |
6 | 7 | from PyQt5.QtCore import Qt, QProcess |
7 | 8 |
|
8 | 9 | import linuxcnc |
@@ -754,6 +755,38 @@ def ADD_WIDGET_TO_TAB(self, widgetTo, widget,name): |
754 | 755 |
|
755 | 756 | return True |
756 | 757 |
|
| 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) |
757 | 790 |
|
758 | 791 | ###################################### |
759 | 792 | # Action Helper functions |
|
0 commit comments