streamdeck-gui-ng 4.1.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. streamdeck_gui_ng-4.1.3.dist-info/METADATA +141 -0
  2. streamdeck_gui_ng-4.1.3.dist-info/RECORD +62 -0
  3. streamdeck_gui_ng-4.1.3.dist-info/WHEEL +4 -0
  4. streamdeck_gui_ng-4.1.3.dist-info/entry_points.txt +4 -0
  5. streamdeck_gui_ng-4.1.3.dist-info/licenses/LICENSE +21 -0
  6. streamdeck_ui/__init__.py +6 -0
  7. streamdeck_ui/api.py +712 -0
  8. streamdeck_ui/button.ui +1214 -0
  9. streamdeck_ui/cli/__init__.py +0 -0
  10. streamdeck_ui/cli/commands.py +191 -0
  11. streamdeck_ui/cli/server.py +292 -0
  12. streamdeck_ui/config.py +244 -0
  13. streamdeck_ui/dimmer.py +93 -0
  14. streamdeck_ui/display/__init__.py +0 -0
  15. streamdeck_ui/display/background_color_filter.py +41 -0
  16. streamdeck_ui/display/display_grid.py +265 -0
  17. streamdeck_ui/display/empty_filter.py +43 -0
  18. streamdeck_ui/display/filter.py +65 -0
  19. streamdeck_ui/display/image_filter.py +144 -0
  20. streamdeck_ui/display/keypress_filter.py +63 -0
  21. streamdeck_ui/display/pipeline.py +74 -0
  22. streamdeck_ui/display/pulse_filter.py +54 -0
  23. streamdeck_ui/display/text_filter.py +142 -0
  24. streamdeck_ui/fonts/roboto/LICENSE.txt +202 -0
  25. streamdeck_ui/fonts/roboto/Roboto-Black.ttf +0 -0
  26. streamdeck_ui/fonts/roboto/Roboto-BlackItalic.ttf +0 -0
  27. streamdeck_ui/fonts/roboto/Roboto-Bold.ttf +0 -0
  28. streamdeck_ui/fonts/roboto/Roboto-BoldItalic.ttf +0 -0
  29. streamdeck_ui/fonts/roboto/Roboto-Italic.ttf +0 -0
  30. streamdeck_ui/fonts/roboto/Roboto-Light.ttf +0 -0
  31. streamdeck_ui/fonts/roboto/Roboto-LightItalic.ttf +0 -0
  32. streamdeck_ui/fonts/roboto/Roboto-Medium.ttf +0 -0
  33. streamdeck_ui/fonts/roboto/Roboto-MediumItalic.ttf +0 -0
  34. streamdeck_ui/fonts/roboto/Roboto-Regular.ttf +0 -0
  35. streamdeck_ui/fonts/roboto/Roboto-Thin.ttf +0 -0
  36. streamdeck_ui/fonts/roboto/Roboto-ThinItalic.ttf +0 -0
  37. streamdeck_ui/gui.py +1423 -0
  38. streamdeck_ui/icons/add_page.png +0 -0
  39. streamdeck_ui/icons/cross.png +0 -0
  40. streamdeck_ui/icons/gear.png +0 -0
  41. streamdeck_ui/icons/horizontal-align.png +0 -0
  42. streamdeck_ui/icons/remove_page.png +0 -0
  43. streamdeck_ui/icons/vertical-align.png +0 -0
  44. streamdeck_ui/icons/warning_icon_button.png +0 -0
  45. streamdeck_ui/logger.py +11 -0
  46. streamdeck_ui/logo.png +0 -0
  47. streamdeck_ui/main.ui +407 -0
  48. streamdeck_ui/mock_streamdeck.py +204 -0
  49. streamdeck_ui/model.py +78 -0
  50. streamdeck_ui/modules/__init__.py +0 -0
  51. streamdeck_ui/modules/fonts.py +150 -0
  52. streamdeck_ui/modules/keyboard.py +447 -0
  53. streamdeck_ui/modules/utils/__init__.py +0 -0
  54. streamdeck_ui/modules/utils/timers.py +35 -0
  55. streamdeck_ui/resources.qrc +10 -0
  56. streamdeck_ui/resources_rc.py +324 -0
  57. streamdeck_ui/semaphore.py +38 -0
  58. streamdeck_ui/settings.ui +155 -0
  59. streamdeck_ui/stream_deck_monitor.py +157 -0
  60. streamdeck_ui/ui_button.py +421 -0
  61. streamdeck_ui/ui_main.py +267 -0
  62. streamdeck_ui/ui_settings.py +119 -0
@@ -0,0 +1,157 @@
1
+ from threading import Event, Lock, Thread
2
+ from time import sleep
3
+ from typing import Callable, Dict, Optional
4
+
5
+ from StreamDeck import DeviceManager
6
+ from StreamDeck.Devices.StreamDeck import StreamDeck
7
+ from StreamDeck.Transport.Transport import TransportError
8
+
9
+
10
+ class StreamDeckMonitor:
11
+ """Periodically checks if Stream Decks are attached or
12
+ removed and raises the corresponding events.
13
+ """
14
+
15
+ streamdecks: Dict[str, StreamDeck]
16
+ "A dictionary with the key as device id and value as StreamDeck"
17
+
18
+ monitor_thread: Optional[Thread]
19
+ "The thread the monitors Stream Decks"
20
+
21
+ showed_open_help: bool = False
22
+ showed_enumeration_help: bool = False
23
+ showed_libusb_help: bool = False
24
+
25
+ def __init__(self, lock: Lock, attached: Callable[[str, StreamDeck], None], detached: Callable[[str], None]):
26
+ """Creates a new StreamDeckMonitor instance
27
+
28
+ :param lock: A lock object that will be used to get exclusive access while enumerating
29
+ Stream Decks. This lock must be shared by any object that will read or write to the
30
+ Stream Deck.
31
+ :type lock: threading.Lock
32
+ :param attached: A callback function that is called when a new StreamDeck is attached. Note
33
+ this runs on a background thread.
34
+ :type attached: Callable[[StreamDeck], None]
35
+ :param detached: A callback function that is called when a previously attached StreamDeck
36
+ is detached. Note this runs on a background thread. The id of the device is passed as
37
+ the only argument.
38
+ :type detached: Callable[[str], None]
39
+ """
40
+ self.quit = Event()
41
+ self.streamdecks = {}
42
+ self.monitor_thread = None
43
+ self.attached = attached
44
+ self.detached = detached
45
+ self.lock = lock
46
+
47
+ def start(self):
48
+ """Starts the monitor thread. If it is already running, nothing
49
+ happens.
50
+ """
51
+ if not self.quit.is_set:
52
+ return
53
+
54
+ self.monitor_thread = Thread(target=self._run)
55
+ # Won't prevent application from exiting, although we will always
56
+ # attempt to gracefully shut down thread anyways
57
+ self.monitor_thread.isDaemon = True
58
+ self.quit.clear()
59
+ self.monitor_thread.start()
60
+
61
+ def stop(self):
62
+ """Stops the monitor thread. If it is not running, nothing happens.
63
+ Stopping will wait for the run thread to complete before returning.
64
+ """
65
+ if self.quit.is_set():
66
+ return
67
+
68
+ self.quit.set()
69
+ try:
70
+ self.monitor_thread.join()
71
+ except RuntimeError:
72
+ pass
73
+ self.monitor_thread = None
74
+
75
+ for streamdeck_id in self.streamdecks:
76
+ self.detached(streamdeck_id)
77
+
78
+ self.streamdecks = {}
79
+
80
+ def _run(self):
81
+ """Runs the internal monitor thread until completion"""
82
+ showed_open_help = False
83
+ showed_enumeration_help = False
84
+ showed_libusb_help = False
85
+ while not self.quit.is_set():
86
+ with self.lock:
87
+ attached_streamdecks = []
88
+ try:
89
+ attached_streamdecks = DeviceManager.DeviceManager().enumerate()
90
+ showed_libusb_help = False
91
+ except DeviceManager.ProbeError:
92
+ if not showed_libusb_help:
93
+ print("\n------------------------")
94
+ print("*** Problem detected ***")
95
+ print("------------------------")
96
+ print("A suitable LibUSB installation could not be found.")
97
+ print("Check installation instructions:")
98
+ print("https://millaguie.github.io/streamdeck-gui-ng/")
99
+ showed_libusb_help = True
100
+
101
+ # No point showing the next help if we can't even enumerate
102
+ showed_enumeration_help = True
103
+ continue
104
+
105
+ if len(attached_streamdecks) == 0:
106
+ if not showed_enumeration_help:
107
+ print("No Stream Deck(s) detected. Attach a Stream Deck.")
108
+ showed_enumeration_help = True
109
+ else:
110
+ showed_enumeration_help = False
111
+
112
+ # Look for new StreamDecks
113
+ for streamdeck in attached_streamdecks:
114
+ streamdeck_id = streamdeck.id()
115
+ if streamdeck_id not in self.streamdecks:
116
+ try:
117
+ self.attached(streamdeck_id, streamdeck)
118
+ self.streamdecks[streamdeck_id] = streamdeck
119
+ showed_open_help = False
120
+ except TransportError:
121
+ if not showed_open_help:
122
+ print("\n------------------------")
123
+ print("*** Problem detected ***")
124
+ print("------------------------")
125
+ print("A Stream Deck is attached, but it could not be opened.")
126
+ print("Check installation instructions and ensure a udev rule has been added and loaded.")
127
+ print("https://millaguie.github.io/streamdeck-gui-ng/")
128
+ showed_open_help = True
129
+ pass
130
+
131
+ # Look for suspended/resumed StreamDecks
132
+ for streamdeck in list(self.streamdecks.values()):
133
+ # Note that streamdeck.connected() will enumerate the devices attached.
134
+ # Enumeration must not be done while other device operations on other
135
+ # threads are running. Protect with the lock.
136
+ # Note that it will only enumerate when is_open() returns false (short circuit),
137
+ # so it won't do it uncessarily anyways.
138
+
139
+ # Use a flag so we don't hold the lock while executing callback
140
+ failed_but_attached = False
141
+ with self.lock:
142
+ if not streamdeck.is_open() and streamdeck.connected():
143
+ failed_but_attached = True
144
+
145
+ # The recovery strategy is to treat this as a detach and let the
146
+ # next enumeration pick up the device and reinitialize.
147
+ if failed_but_attached:
148
+ del self.streamdecks[streamdeck.id()]
149
+ self.detached(streamdeck.id())
150
+
151
+ # Remove unplugged StreamDecks
152
+ for streamdeck_id in list(self.streamdecks.keys()):
153
+ if streamdeck_id not in [deck.id() for deck in attached_streamdecks]:
154
+ streamdeck = self.streamdecks[streamdeck_id]
155
+ del self.streamdecks[streamdeck_id]
156
+ self.detached(streamdeck_id)
157
+ sleep(1)
@@ -0,0 +1,421 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+ ################################################################################
4
+ ## Form generated from reading UI file 'button.ui'
5
+ ##
6
+ ## Created by: Qt User Interface Compiler version 6.6.2
7
+ ##
8
+ ## WARNING! All changes made in this file will be lost when recompiling UI file!
9
+ ################################################################################
10
+
11
+ from PySide6.QtCore import (QCoreApplication, QDate, QDateTime, QLocale,
12
+ QMetaObject, QObject, QPoint, QRect,
13
+ QSize, QTime, QUrl, Qt)
14
+ from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor,
15
+ QFont, QFontDatabase, QGradient, QIcon,
16
+ QImage, QKeySequence, QLinearGradient, QPainter,
17
+ QPalette, QPixmap, QRadialGradient, QTransform)
18
+ from PySide6.QtWidgets import (QApplication, QCheckBox, QComboBox, QFormLayout,
19
+ QHBoxLayout, QLabel, QLineEdit, QPlainTextEdit,
20
+ QPushButton, QSizePolicy, QSpinBox, QTextEdit,
21
+ QVBoxLayout, QWidget)
22
+ from . import resources_rc
23
+
24
+ class Ui_ButtonForm(object):
25
+ def setupUi(self, ButtonForm):
26
+ if not ButtonForm.objectName():
27
+ ButtonForm.setObjectName(u"ButtonForm")
28
+ ButtonForm.resize(568, 778)
29
+ self.formLayout = QFormLayout(ButtonForm)
30
+ self.formLayout.setObjectName(u"formLayout")
31
+ self.label = QLabel(ButtonForm)
32
+ self.label.setObjectName(u"label")
33
+
34
+ self.formLayout.setWidget(0, QFormLayout.LabelRole, self.label)
35
+
36
+ self.horizontalLayout_2 = QHBoxLayout()
37
+ self.horizontalLayout_2.setSpacing(6)
38
+ self.horizontalLayout_2.setObjectName(u"horizontalLayout_2")
39
+ self.add_image = QPushButton(ButtonForm)
40
+ self.add_image.setObjectName(u"add_image")
41
+
42
+ self.horizontalLayout_2.addWidget(self.add_image)
43
+
44
+ self.remove_image = QPushButton(ButtonForm)
45
+ self.remove_image.setObjectName(u"remove_image")
46
+ sizePolicy = QSizePolicy(QSizePolicy.Policy.Minimum, QSizePolicy.Policy.Minimum)
47
+ sizePolicy.setHorizontalStretch(0)
48
+ sizePolicy.setVerticalStretch(0)
49
+ sizePolicy.setHeightForWidth(self.remove_image.sizePolicy().hasHeightForWidth())
50
+ self.remove_image.setSizePolicy(sizePolicy)
51
+ self.remove_image.setMaximumSize(QSize(30, 16777215))
52
+ icon = QIcon()
53
+ icon.addFile(u":/icons/icons/cross.png", QSize(), QIcon.Normal, QIcon.Off)
54
+ self.remove_image.setIcon(icon)
55
+
56
+ self.horizontalLayout_2.addWidget(self.remove_image)
57
+
58
+
59
+ self.formLayout.setLayout(0, QFormLayout.FieldRole, self.horizontalLayout_2)
60
+
61
+ self.label_9 = QLabel(ButtonForm)
62
+ self.label_9.setObjectName(u"label_9")
63
+
64
+ self.formLayout.setWidget(1, QFormLayout.LabelRole, self.label_9)
65
+
66
+ self.background_color = QPushButton(ButtonForm)
67
+ self.background_color.setObjectName(u"background_color")
68
+ sizePolicy1 = QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Maximum)
69
+ sizePolicy1.setHorizontalStretch(0)
70
+ sizePolicy1.setVerticalStretch(0)
71
+ sizePolicy1.setHeightForWidth(self.background_color.sizePolicy().hasHeightForWidth())
72
+ self.background_color.setSizePolicy(sizePolicy1)
73
+ self.background_color.setMaximumSize(QSize(16777215, 16777215))
74
+ palette = QPalette()
75
+ brush = QBrush(QColor(0, 0, 0, 255))
76
+ brush.setStyle(Qt.SolidPattern)
77
+ palette.setBrush(QPalette.Active, QPalette.WindowText, brush)
78
+ brush1 = QBrush(QColor(255, 255, 255, 255))
79
+ brush1.setStyle(Qt.SolidPattern)
80
+ palette.setBrush(QPalette.Active, QPalette.Button, brush1)
81
+ palette.setBrush(QPalette.Active, QPalette.Light, brush1)
82
+ palette.setBrush(QPalette.Active, QPalette.Midlight, brush1)
83
+ brush2 = QBrush(QColor(127, 127, 127, 255))
84
+ brush2.setStyle(Qt.SolidPattern)
85
+ palette.setBrush(QPalette.Active, QPalette.Dark, brush2)
86
+ brush3 = QBrush(QColor(170, 170, 170, 255))
87
+ brush3.setStyle(Qt.SolidPattern)
88
+ palette.setBrush(QPalette.Active, QPalette.Mid, brush3)
89
+ palette.setBrush(QPalette.Active, QPalette.Text, brush)
90
+ palette.setBrush(QPalette.Active, QPalette.BrightText, brush1)
91
+ palette.setBrush(QPalette.Active, QPalette.ButtonText, brush)
92
+ palette.setBrush(QPalette.Active, QPalette.Base, brush1)
93
+ palette.setBrush(QPalette.Active, QPalette.Window, brush1)
94
+ palette.setBrush(QPalette.Active, QPalette.Shadow, brush)
95
+ palette.setBrush(QPalette.Active, QPalette.AlternateBase, brush1)
96
+ brush4 = QBrush(QColor(255, 255, 220, 255))
97
+ brush4.setStyle(Qt.SolidPattern)
98
+ palette.setBrush(QPalette.Active, QPalette.ToolTipBase, brush4)
99
+ palette.setBrush(QPalette.Active, QPalette.ToolTipText, brush)
100
+ brush5 = QBrush(QColor(0, 0, 0, 128))
101
+ brush5.setStyle(Qt.SolidPattern)
102
+ #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
103
+ palette.setBrush(QPalette.Active, QPalette.PlaceholderText, brush5)
104
+ #endif
105
+ palette.setBrush(QPalette.Inactive, QPalette.WindowText, brush)
106
+ palette.setBrush(QPalette.Inactive, QPalette.Button, brush1)
107
+ palette.setBrush(QPalette.Inactive, QPalette.Light, brush1)
108
+ palette.setBrush(QPalette.Inactive, QPalette.Midlight, brush1)
109
+ palette.setBrush(QPalette.Inactive, QPalette.Dark, brush2)
110
+ palette.setBrush(QPalette.Inactive, QPalette.Mid, brush3)
111
+ palette.setBrush(QPalette.Inactive, QPalette.Text, brush)
112
+ palette.setBrush(QPalette.Inactive, QPalette.BrightText, brush1)
113
+ palette.setBrush(QPalette.Inactive, QPalette.ButtonText, brush)
114
+ palette.setBrush(QPalette.Inactive, QPalette.Base, brush1)
115
+ palette.setBrush(QPalette.Inactive, QPalette.Window, brush1)
116
+ palette.setBrush(QPalette.Inactive, QPalette.Shadow, brush)
117
+ palette.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush1)
118
+ palette.setBrush(QPalette.Inactive, QPalette.ToolTipBase, brush4)
119
+ palette.setBrush(QPalette.Inactive, QPalette.ToolTipText, brush)
120
+ #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
121
+ palette.setBrush(QPalette.Inactive, QPalette.PlaceholderText, brush5)
122
+ #endif
123
+ palette.setBrush(QPalette.Disabled, QPalette.WindowText, brush2)
124
+ palette.setBrush(QPalette.Disabled, QPalette.Button, brush1)
125
+ palette.setBrush(QPalette.Disabled, QPalette.Light, brush1)
126
+ palette.setBrush(QPalette.Disabled, QPalette.Midlight, brush1)
127
+ palette.setBrush(QPalette.Disabled, QPalette.Dark, brush2)
128
+ palette.setBrush(QPalette.Disabled, QPalette.Mid, brush3)
129
+ palette.setBrush(QPalette.Disabled, QPalette.Text, brush2)
130
+ palette.setBrush(QPalette.Disabled, QPalette.BrightText, brush1)
131
+ palette.setBrush(QPalette.Disabled, QPalette.ButtonText, brush2)
132
+ palette.setBrush(QPalette.Disabled, QPalette.Base, brush1)
133
+ palette.setBrush(QPalette.Disabled, QPalette.Window, brush1)
134
+ palette.setBrush(QPalette.Disabled, QPalette.Shadow, brush)
135
+ palette.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush1)
136
+ palette.setBrush(QPalette.Disabled, QPalette.ToolTipBase, brush4)
137
+ palette.setBrush(QPalette.Disabled, QPalette.ToolTipText, brush)
138
+ #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
139
+ palette.setBrush(QPalette.Disabled, QPalette.PlaceholderText, brush5)
140
+ #endif
141
+ self.background_color.setPalette(palette)
142
+
143
+ self.formLayout.setWidget(1, QFormLayout.FieldRole, self.background_color)
144
+
145
+ self.label_2 = QLabel(ButtonForm)
146
+ self.label_2.setObjectName(u"label_2")
147
+
148
+ self.formLayout.setWidget(2, QFormLayout.LabelRole, self.label_2)
149
+
150
+ self.horizontalLayout_3 = QHBoxLayout()
151
+ self.horizontalLayout_3.setObjectName(u"horizontalLayout_3")
152
+ self.text = QTextEdit(ButtonForm)
153
+ self.text.setObjectName(u"text")
154
+
155
+ self.horizontalLayout_3.addWidget(self.text)
156
+
157
+ self.verticalLayout_4 = QVBoxLayout()
158
+ self.verticalLayout_4.setObjectName(u"verticalLayout_4")
159
+ self.text_v_align = QPushButton(ButtonForm)
160
+ self.text_v_align.setObjectName(u"text_v_align")
161
+ self.text_v_align.setMinimumSize(QSize(40, 30))
162
+ self.text_v_align.setMaximumSize(QSize(30, 16777215))
163
+ icon1 = QIcon()
164
+ icon1.addFile(u":/icons/icons/vertical-align.png", QSize(), QIcon.Normal, QIcon.Off)
165
+ self.text_v_align.setIcon(icon1)
166
+
167
+ self.verticalLayout_4.addWidget(self.text_v_align)
168
+
169
+ self.text_h_align = QPushButton(ButtonForm)
170
+ self.text_h_align.setObjectName(u"text_h_align")
171
+ self.text_h_align.setMinimumSize(QSize(40, 30))
172
+ icon2 = QIcon()
173
+ icon2.addFile(u":/icons/icons/horizontal-align.png", QSize(), QIcon.Normal, QIcon.Off)
174
+ self.text_h_align.setIcon(icon2)
175
+
176
+ self.verticalLayout_4.addWidget(self.text_h_align)
177
+
178
+
179
+ self.horizontalLayout_3.addLayout(self.verticalLayout_4)
180
+
181
+
182
+ self.formLayout.setLayout(2, QFormLayout.FieldRole, self.horizontalLayout_3)
183
+
184
+ self.label_4 = QLabel(ButtonForm)
185
+ self.label_4.setObjectName(u"label_4")
186
+
187
+ self.formLayout.setWidget(3, QFormLayout.LabelRole, self.label_4)
188
+
189
+ self.horizontalLayout = QHBoxLayout()
190
+ self.horizontalLayout.setObjectName(u"horizontalLayout")
191
+ self.text_font = QComboBox(ButtonForm)
192
+ self.text_font.setObjectName(u"text_font")
193
+ sizePolicy2 = QSizePolicy(QSizePolicy.Policy.Preferred, QSizePolicy.Policy.Fixed)
194
+ sizePolicy2.setHorizontalStretch(0)
195
+ sizePolicy2.setVerticalStretch(0)
196
+ sizePolicy2.setHeightForWidth(self.text_font.sizePolicy().hasHeightForWidth())
197
+ self.text_font.setSizePolicy(sizePolicy2)
198
+
199
+ self.horizontalLayout.addWidget(self.text_font)
200
+
201
+ self.text_font_style = QComboBox(ButtonForm)
202
+ self.text_font_style.setObjectName(u"text_font_style")
203
+
204
+ self.horizontalLayout.addWidget(self.text_font_style)
205
+
206
+ self.text_font_size = QSpinBox(ButtonForm)
207
+ self.text_font_size.setObjectName(u"text_font_size")
208
+ sizePolicy3 = QSizePolicy(QSizePolicy.Policy.Fixed, QSizePolicy.Policy.Fixed)
209
+ sizePolicy3.setHorizontalStretch(0)
210
+ sizePolicy3.setVerticalStretch(0)
211
+ sizePolicy3.setHeightForWidth(self.text_font_size.sizePolicy().hasHeightForWidth())
212
+ self.text_font_size.setSizePolicy(sizePolicy3)
213
+ self.text_font_size.setMinimum(12)
214
+ self.text_font_size.setMaximum(72)
215
+
216
+ self.horizontalLayout.addWidget(self.text_font_size)
217
+
218
+ self.text_color = QPushButton(ButtonForm)
219
+ self.text_color.setObjectName(u"text_color")
220
+ sizePolicy4 = QSizePolicy(QSizePolicy.Policy.Maximum, QSizePolicy.Policy.Maximum)
221
+ sizePolicy4.setHorizontalStretch(0)
222
+ sizePolicy4.setVerticalStretch(0)
223
+ sizePolicy4.setHeightForWidth(self.text_color.sizePolicy().hasHeightForWidth())
224
+ self.text_color.setSizePolicy(sizePolicy4)
225
+ self.text_color.setMaximumSize(QSize(16777215, 16777215))
226
+ palette1 = QPalette()
227
+ palette1.setBrush(QPalette.Active, QPalette.WindowText, brush)
228
+ palette1.setBrush(QPalette.Active, QPalette.Button, brush1)
229
+ palette1.setBrush(QPalette.Active, QPalette.Light, brush1)
230
+ palette1.setBrush(QPalette.Active, QPalette.Midlight, brush1)
231
+ palette1.setBrush(QPalette.Active, QPalette.Dark, brush2)
232
+ palette1.setBrush(QPalette.Active, QPalette.Mid, brush3)
233
+ palette1.setBrush(QPalette.Active, QPalette.Text, brush)
234
+ palette1.setBrush(QPalette.Active, QPalette.BrightText, brush1)
235
+ palette1.setBrush(QPalette.Active, QPalette.ButtonText, brush)
236
+ palette1.setBrush(QPalette.Active, QPalette.Base, brush1)
237
+ palette1.setBrush(QPalette.Active, QPalette.Window, brush1)
238
+ palette1.setBrush(QPalette.Active, QPalette.Shadow, brush)
239
+ palette1.setBrush(QPalette.Active, QPalette.AlternateBase, brush1)
240
+ palette1.setBrush(QPalette.Active, QPalette.ToolTipBase, brush4)
241
+ palette1.setBrush(QPalette.Active, QPalette.ToolTipText, brush)
242
+ #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
243
+ palette1.setBrush(QPalette.Active, QPalette.PlaceholderText, brush5)
244
+ #endif
245
+ palette1.setBrush(QPalette.Inactive, QPalette.WindowText, brush)
246
+ palette1.setBrush(QPalette.Inactive, QPalette.Button, brush1)
247
+ palette1.setBrush(QPalette.Inactive, QPalette.Light, brush1)
248
+ palette1.setBrush(QPalette.Inactive, QPalette.Midlight, brush1)
249
+ palette1.setBrush(QPalette.Inactive, QPalette.Dark, brush2)
250
+ palette1.setBrush(QPalette.Inactive, QPalette.Mid, brush3)
251
+ palette1.setBrush(QPalette.Inactive, QPalette.Text, brush)
252
+ palette1.setBrush(QPalette.Inactive, QPalette.BrightText, brush1)
253
+ palette1.setBrush(QPalette.Inactive, QPalette.ButtonText, brush)
254
+ palette1.setBrush(QPalette.Inactive, QPalette.Base, brush1)
255
+ palette1.setBrush(QPalette.Inactive, QPalette.Window, brush1)
256
+ palette1.setBrush(QPalette.Inactive, QPalette.Shadow, brush)
257
+ palette1.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush1)
258
+ palette1.setBrush(QPalette.Inactive, QPalette.ToolTipBase, brush4)
259
+ palette1.setBrush(QPalette.Inactive, QPalette.ToolTipText, brush)
260
+ #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
261
+ palette1.setBrush(QPalette.Inactive, QPalette.PlaceholderText, brush5)
262
+ #endif
263
+ palette1.setBrush(QPalette.Disabled, QPalette.WindowText, brush2)
264
+ palette1.setBrush(QPalette.Disabled, QPalette.Button, brush1)
265
+ palette1.setBrush(QPalette.Disabled, QPalette.Light, brush1)
266
+ palette1.setBrush(QPalette.Disabled, QPalette.Midlight, brush1)
267
+ palette1.setBrush(QPalette.Disabled, QPalette.Dark, brush2)
268
+ palette1.setBrush(QPalette.Disabled, QPalette.Mid, brush3)
269
+ palette1.setBrush(QPalette.Disabled, QPalette.Text, brush2)
270
+ palette1.setBrush(QPalette.Disabled, QPalette.BrightText, brush1)
271
+ palette1.setBrush(QPalette.Disabled, QPalette.ButtonText, brush2)
272
+ palette1.setBrush(QPalette.Disabled, QPalette.Base, brush1)
273
+ palette1.setBrush(QPalette.Disabled, QPalette.Window, brush1)
274
+ palette1.setBrush(QPalette.Disabled, QPalette.Shadow, brush)
275
+ palette1.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush1)
276
+ palette1.setBrush(QPalette.Disabled, QPalette.ToolTipBase, brush4)
277
+ palette1.setBrush(QPalette.Disabled, QPalette.ToolTipText, brush)
278
+ #if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
279
+ palette1.setBrush(QPalette.Disabled, QPalette.PlaceholderText, brush5)
280
+ #endif
281
+ self.text_color.setPalette(palette1)
282
+
283
+ self.horizontalLayout.addWidget(self.text_color)
284
+
285
+ self.horizontalLayout.setStretch(0, 3)
286
+ self.horizontalLayout.setStretch(1, 2)
287
+ self.horizontalLayout.setStretch(2, 1)
288
+ self.horizontalLayout.setStretch(3, 1)
289
+
290
+ self.formLayout.setLayout(3, QFormLayout.FieldRole, self.horizontalLayout)
291
+
292
+ self.label_3 = QLabel(ButtonForm)
293
+ self.label_3.setObjectName(u"label_3")
294
+
295
+ self.formLayout.setWidget(5, QFormLayout.LabelRole, self.label_3)
296
+
297
+ self.command = QLineEdit(ButtonForm)
298
+ self.command.setObjectName(u"command")
299
+
300
+ self.formLayout.setWidget(5, QFormLayout.FieldRole, self.command)
301
+
302
+ self.label_5 = QLabel(ButtonForm)
303
+ self.label_5.setObjectName(u"label_5")
304
+
305
+ self.formLayout.setWidget(7, QFormLayout.LabelRole, self.label_5)
306
+
307
+ self.keys = QLineEdit(ButtonForm)
308
+ self.keys.setObjectName(u"keys")
309
+
310
+ self.formLayout.setWidget(7, QFormLayout.FieldRole, self.keys)
311
+
312
+ self.label_8 = QLabel(ButtonForm)
313
+ self.label_8.setObjectName(u"label_8")
314
+
315
+ self.formLayout.setWidget(8, QFormLayout.LabelRole, self.label_8)
316
+
317
+ self.switch_page = QSpinBox(ButtonForm)
318
+ self.switch_page.setObjectName(u"switch_page")
319
+ self.switch_page.setMinimum(0)
320
+ self.switch_page.setMaximum(999999999)
321
+ self.switch_page.setValue(0)
322
+
323
+ self.formLayout.setWidget(8, QFormLayout.FieldRole, self.switch_page)
324
+
325
+ self.label_10 = QLabel(ButtonForm)
326
+ self.label_10.setObjectName(u"label_10")
327
+
328
+ self.formLayout.setWidget(9, QFormLayout.LabelRole, self.label_10)
329
+
330
+ self.switch_state = QSpinBox(ButtonForm)
331
+ self.switch_state.setObjectName(u"switch_state")
332
+ self.switch_state.setMaximum(999999999)
333
+
334
+ self.formLayout.setWidget(9, QFormLayout.FieldRole, self.switch_state)
335
+
336
+ self.label_7 = QLabel(ButtonForm)
337
+ self.label_7.setObjectName(u"label_7")
338
+
339
+ self.formLayout.setWidget(10, QFormLayout.LabelRole, self.label_7)
340
+
341
+ self.change_brightness = QSpinBox(ButtonForm)
342
+ self.change_brightness.setObjectName(u"change_brightness")
343
+ self.change_brightness.setMinimum(-99)
344
+
345
+ self.formLayout.setWidget(10, QFormLayout.FieldRole, self.change_brightness)
346
+
347
+ self.label_6 = QLabel(ButtonForm)
348
+ self.label_6.setObjectName(u"label_6")
349
+
350
+ self.formLayout.setWidget(11, QFormLayout.LabelRole, self.label_6)
351
+
352
+ self.write = QPlainTextEdit(ButtonForm)
353
+ self.write.setObjectName(u"write")
354
+
355
+ self.formLayout.setWidget(11, QFormLayout.FieldRole, self.write)
356
+
357
+ self.label_force_refresh = QLabel(ButtonForm)
358
+ self.label_force_refresh.setObjectName(u"label_force_refresh")
359
+
360
+ self.formLayout.setWidget(12, QFormLayout.LabelRole, self.label_force_refresh)
361
+
362
+ self.force_refresh = QCheckBox(ButtonForm)
363
+ self.force_refresh.setObjectName(u"force_refresh")
364
+
365
+ self.formLayout.setWidget(12, QFormLayout.FieldRole, self.force_refresh)
366
+
367
+
368
+ self.retranslateUi(ButtonForm)
369
+
370
+ QMetaObject.connectSlotsByName(ButtonForm)
371
+ # setupUi
372
+
373
+ def retranslateUi(self, ButtonForm):
374
+ ButtonForm.setWindowTitle(QCoreApplication.translate("ButtonForm", u"Form", None))
375
+ self.label.setText(QCoreApplication.translate("ButtonForm", u"Image:", None))
376
+ self.add_image.setText(QCoreApplication.translate("ButtonForm", u"Image...", None))
377
+ #if QT_CONFIG(tooltip)
378
+ self.remove_image.setToolTip(QCoreApplication.translate("ButtonForm", u"Remove the image from the button", None))
379
+ #endif // QT_CONFIG(tooltip)
380
+ self.remove_image.setText("")
381
+ self.label_9.setText(QCoreApplication.translate("ButtonForm", u"Background", None))
382
+ #if QT_CONFIG(tooltip)
383
+ self.background_color.setToolTip(QCoreApplication.translate("ButtonForm", u"Text Color", None))
384
+ #endif // QT_CONFIG(tooltip)
385
+ self.background_color.setText("")
386
+ self.label_2.setText(QCoreApplication.translate("ButtonForm", u"Label:", None))
387
+ #if QT_CONFIG(tooltip)
388
+ self.text_v_align.setToolTip(QCoreApplication.translate("ButtonForm", u"Text vertical alignment", None))
389
+ #endif // QT_CONFIG(tooltip)
390
+ self.text_v_align.setText("")
391
+ #if QT_CONFIG(tooltip)
392
+ self.text_h_align.setToolTip(QCoreApplication.translate("ButtonForm", u"Text horizontal alignment", None))
393
+ #endif // QT_CONFIG(tooltip)
394
+ self.text_h_align.setText("")
395
+ self.label_4.setText(QCoreApplication.translate("ButtonForm", u"Label Font:", None))
396
+ #if QT_CONFIG(tooltip)
397
+ self.text_font.setToolTip(QCoreApplication.translate("ButtonForm", u"Text Font style", None))
398
+ #endif // QT_CONFIG(tooltip)
399
+ #if QT_CONFIG(tooltip)
400
+ self.text_font_style.setToolTip(QCoreApplication.translate("ButtonForm", u"Text Font", None))
401
+ #endif // QT_CONFIG(tooltip)
402
+ #if QT_CONFIG(tooltip)
403
+ self.text_font_size.setToolTip(QCoreApplication.translate("ButtonForm", u"Text Font size", None))
404
+ #endif // QT_CONFIG(tooltip)
405
+ #if QT_CONFIG(tooltip)
406
+ self.text_color.setToolTip(QCoreApplication.translate("ButtonForm", u"Text Color", None))
407
+ #endif // QT_CONFIG(tooltip)
408
+ self.text_color.setText("")
409
+ self.label_3.setText(QCoreApplication.translate("ButtonForm", u"Command:", None))
410
+ self.label_5.setText(QCoreApplication.translate("ButtonForm", u"Press Keys:", None))
411
+ self.label_8.setText(QCoreApplication.translate("ButtonForm", u"Switch Page:", None))
412
+ self.label_10.setText(QCoreApplication.translate("ButtonForm", u"Switch state", None))
413
+ self.label_7.setText(QCoreApplication.translate("ButtonForm", u"Brightness +/-:", None))
414
+ self.label_6.setText(QCoreApplication.translate("ButtonForm", u"Write Text:", None))
415
+ self.label_force_refresh.setText(QCoreApplication.translate("ButtonForm", u"Force Refresh:", None))
416
+ #if QT_CONFIG(tooltip)
417
+ self.force_refresh.setToolTip(QCoreApplication.translate("ButtonForm", u"Force icon refresh after command execution", None))
418
+ #endif // QT_CONFIG(tooltip)
419
+ self.force_refresh.setText(QCoreApplication.translate("ButtonForm", u"Refresh icon after command", None))
420
+ # retranslateUi
421
+