@@ -35,14 +35,8 @@ def __init__(self, parent):
35
35
self .ui .setupUi (self )
36
36
37
37
# keep predefined classes for each state of the widget
38
- self ._css_decorated = """
39
- #box { border-width: 2px;
40
- border-radius: 4px;
41
- border-color: rgb(48, 167, 227);
42
- border-style: solid;
43
- }
44
- """
45
38
39
+ # style when the widget is selected
46
40
self ._css_selected = """
47
41
#box { border-width: 2px;
48
42
border-radius: 4px;
@@ -52,7 +46,8 @@ def __init__(self, parent):
52
46
}
53
47
"""
54
48
55
- self ._no_style = """
49
+ # style when the widget is passive (not selected)
50
+ self ._css_passive = """
56
51
#box { border-width: 2px;
57
52
border-radius: 4px;
58
53
border-color: rgba(0, 0, 0, 0%);
@@ -68,19 +63,8 @@ def set_selected(self, selected):
68
63
69
64
:param selected: True if selected, false if not
70
65
"""
71
- if selected :
72
- self .ui .box .setStyleSheet (self ._css_selected )
73
-
74
- def set_highlighted (self , highlighted ):
75
- """
76
- Adjust the style sheet to indicate that an object is highlighted
77
-
78
- :param selected: True if selected, false if not
79
- """
80
- if highlighted :
81
- self .ui .box .setStyleSheet (self ._css_decorated )
82
- else :
83
- self .ui .box .setStyleSheet (self ._no_style )
66
+ css = self ._css_selected if selected else self ._css_passive
67
+ self .ui .box .setStyleSheet (css )
84
68
85
69
def set_thumbnail (self , pixmap ):
86
70
"""
0 commit comments