celldetective 1.0.2__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.
- celldetective/__init__.py +2 -0
- celldetective/__main__.py +432 -0
- celldetective/datasets/segmentation_annotations/blank +0 -0
- celldetective/datasets/signal_annotations/blank +0 -0
- celldetective/events.py +149 -0
- celldetective/extra_properties.py +100 -0
- celldetective/filters.py +89 -0
- celldetective/gui/__init__.py +20 -0
- celldetective/gui/about.py +44 -0
- celldetective/gui/analyze_block.py +563 -0
- celldetective/gui/btrack_options.py +898 -0
- celldetective/gui/classifier_widget.py +386 -0
- celldetective/gui/configure_new_exp.py +532 -0
- celldetective/gui/control_panel.py +438 -0
- celldetective/gui/gui_utils.py +495 -0
- celldetective/gui/json_readers.py +113 -0
- celldetective/gui/measurement_options.py +1425 -0
- celldetective/gui/neighborhood_options.py +452 -0
- celldetective/gui/plot_signals_ui.py +1042 -0
- celldetective/gui/process_block.py +1055 -0
- celldetective/gui/retrain_segmentation_model_options.py +706 -0
- celldetective/gui/retrain_signal_model_options.py +643 -0
- celldetective/gui/seg_model_loader.py +460 -0
- celldetective/gui/signal_annotator.py +2388 -0
- celldetective/gui/signal_annotator_options.py +340 -0
- celldetective/gui/styles.py +217 -0
- celldetective/gui/survival_ui.py +903 -0
- celldetective/gui/tableUI.py +608 -0
- celldetective/gui/thresholds_gui.py +1300 -0
- celldetective/icons/logo-large.png +0 -0
- celldetective/icons/logo.png +0 -0
- celldetective/icons/signals_icon.png +0 -0
- celldetective/icons/splash-test.png +0 -0
- celldetective/icons/splash.png +0 -0
- celldetective/icons/splash0.png +0 -0
- celldetective/icons/survival2.png +0 -0
- celldetective/icons/vignette_signals2.png +0 -0
- celldetective/icons/vignette_signals2.svg +114 -0
- celldetective/io.py +2050 -0
- celldetective/links/zenodo.json +561 -0
- celldetective/measure.py +1258 -0
- celldetective/models/segmentation_effectors/blank +0 -0
- celldetective/models/segmentation_generic/blank +0 -0
- celldetective/models/segmentation_targets/blank +0 -0
- celldetective/models/signal_detection/blank +0 -0
- celldetective/models/tracking_configs/mcf7.json +68 -0
- celldetective/models/tracking_configs/ricm.json +203 -0
- celldetective/models/tracking_configs/ricm2.json +203 -0
- celldetective/neighborhood.py +717 -0
- celldetective/scripts/analyze_signals.py +51 -0
- celldetective/scripts/measure_cells.py +275 -0
- celldetective/scripts/segment_cells.py +212 -0
- celldetective/scripts/segment_cells_thresholds.py +140 -0
- celldetective/scripts/track_cells.py +206 -0
- celldetective/scripts/train_segmentation_model.py +246 -0
- celldetective/scripts/train_signal_model.py +49 -0
- celldetective/segmentation.py +712 -0
- celldetective/signals.py +2826 -0
- celldetective/tracking.py +974 -0
- celldetective/utils.py +1681 -0
- celldetective-1.0.2.dist-info/LICENSE +674 -0
- celldetective-1.0.2.dist-info/METADATA +192 -0
- celldetective-1.0.2.dist-info/RECORD +66 -0
- celldetective-1.0.2.dist-info/WHEEL +5 -0
- celldetective-1.0.2.dist-info/entry_points.txt +2 -0
- celldetective-1.0.2.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Copright © 2023 Laboratoire Adhesion et Inflammation, Authored by Remy Torro.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from PyQt5.QtWidgets import QMainWindow, QComboBox, QLabel, QRadioButton, QLineEdit, QApplication, QPushButton, QScrollArea, QWidget, QVBoxLayout, QHBoxLayout
|
|
6
|
+
from PyQt5.QtCore import Qt, QSize
|
|
7
|
+
from celldetective.gui.gui_utils import center_window, QHSeperationLine
|
|
8
|
+
from superqt import QLabeledDoubleSlider, QLabeledSlider
|
|
9
|
+
from celldetective.utils import extract_experiment_channels, get_software_location
|
|
10
|
+
import json
|
|
11
|
+
import numpy as np
|
|
12
|
+
from superqt.fonticon import icon
|
|
13
|
+
from fonticon_mdi6 import MDI6
|
|
14
|
+
import os
|
|
15
|
+
|
|
16
|
+
class ConfigSignalAnnotator(QMainWindow):
|
|
17
|
+
|
|
18
|
+
"""
|
|
19
|
+
UI to set normalization and animation parameters for the annotator tool.
|
|
20
|
+
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
def __init__(self, parent=None):
|
|
24
|
+
|
|
25
|
+
super().__init__()
|
|
26
|
+
self.parent = parent
|
|
27
|
+
self.setWindowTitle("Configure signal annotator")
|
|
28
|
+
self.mode = self.parent.mode
|
|
29
|
+
self.exp_dir = self.parent.exp_dir
|
|
30
|
+
self.soft_path = get_software_location()
|
|
31
|
+
|
|
32
|
+
if self.mode=="targets":
|
|
33
|
+
self.instructions_path = self.parent.exp_dir + "configs/signal_annotator_config_targets.json"
|
|
34
|
+
elif self.mode=="effectors":
|
|
35
|
+
self.instructions_path = self.parent.exp_dir + "configs/signal_annotator_config_effectors.json"
|
|
36
|
+
|
|
37
|
+
exp_config = self.exp_dir +"config.ini"
|
|
38
|
+
#self.config_path = self.exp_dir + self.config_name
|
|
39
|
+
self.channel_names, self.channels = extract_experiment_channels(exp_config)
|
|
40
|
+
self.channel_names = np.array(self.channel_names)
|
|
41
|
+
self.channels = np.array(self.channels)
|
|
42
|
+
self.log_option = False
|
|
43
|
+
|
|
44
|
+
self.screen_height = self.parent.parent.parent.screen_height
|
|
45
|
+
center_window(self)
|
|
46
|
+
|
|
47
|
+
self.setMinimumHeight(int(0.4*self.screen_height))
|
|
48
|
+
self.setMaximumHeight(int(0.8*self.screen_height))
|
|
49
|
+
self.populate_widget()
|
|
50
|
+
#self.load_previous_measurement_instructions()
|
|
51
|
+
|
|
52
|
+
def populate_widget(self):
|
|
53
|
+
|
|
54
|
+
"""
|
|
55
|
+
Create the widgets.
|
|
56
|
+
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
self.scroll_area = QScrollArea(self)
|
|
60
|
+
self.button_widget = QWidget()
|
|
61
|
+
|
|
62
|
+
main_layout = QVBoxLayout()
|
|
63
|
+
main_layout.setContentsMargins(30,30,30,30)
|
|
64
|
+
|
|
65
|
+
sub_layout = QVBoxLayout()
|
|
66
|
+
sub_layout.setContentsMargins(10,10,10,20)
|
|
67
|
+
|
|
68
|
+
self.button_widget.setLayout(main_layout)
|
|
69
|
+
sub_layout.setContentsMargins(30,30,30,30)
|
|
70
|
+
|
|
71
|
+
sub_layout.addWidget(QLabel('Modality: '))
|
|
72
|
+
|
|
73
|
+
# Create radio buttons
|
|
74
|
+
option_layout = QHBoxLayout()
|
|
75
|
+
self.gs_btn = QRadioButton('grayscale')
|
|
76
|
+
self.gs_btn.setChecked(True)
|
|
77
|
+
option_layout.addWidget(self.gs_btn, alignment=Qt.AlignCenter)
|
|
78
|
+
|
|
79
|
+
self.rgb_btn = QRadioButton('RGB')
|
|
80
|
+
option_layout.addWidget(self.rgb_btn, alignment=Qt.AlignCenter)
|
|
81
|
+
sub_layout.addLayout(option_layout)
|
|
82
|
+
|
|
83
|
+
btn_hbox = QHBoxLayout()
|
|
84
|
+
|
|
85
|
+
self.percentile_btn = QPushButton()
|
|
86
|
+
self.percentile_btn.setIcon(icon(MDI6.percent_circle_outline,color="black"))
|
|
87
|
+
self.percentile_btn.setIconSize(QSize(20, 20))
|
|
88
|
+
self.percentile_btn.setStyleSheet(self.parent.parent.parent.button_select_all)
|
|
89
|
+
self.percentile_btn.setToolTip("Switch to percentile normalization values.")
|
|
90
|
+
self.percentile_btn.clicked.connect(self.switch_to_absolute_normalization_mode)
|
|
91
|
+
|
|
92
|
+
self.log_btn = QPushButton()
|
|
93
|
+
self.log_btn.setIcon(icon(MDI6.math_log,color="black"))
|
|
94
|
+
self.log_btn.setStyleSheet(self.parent.parent.parent.button_select_all)
|
|
95
|
+
self.log_btn.clicked.connect(self.switch_to_log)
|
|
96
|
+
self.log_btn.setToolTip("Log-transform the intensities.")
|
|
97
|
+
self.log_btn.setIconSize(QSize(20, 20))
|
|
98
|
+
|
|
99
|
+
btn_hbox.addWidget(QLabel(''), 90)
|
|
100
|
+
btn_hbox.addWidget(self.log_btn, 5,alignment=Qt.AlignRight)
|
|
101
|
+
btn_hbox.addWidget(self.percentile_btn, 5,alignment=Qt.AlignRight)
|
|
102
|
+
sub_layout.addLayout(btn_hbox)
|
|
103
|
+
|
|
104
|
+
self.channel_cbs = [QComboBox() for i in range(3)]
|
|
105
|
+
self.channel_cbs_lbls = [QLabel() for i in range(3)]
|
|
106
|
+
|
|
107
|
+
self.min_val_les = [QLineEdit('0') for i in range(3)]
|
|
108
|
+
self.min_val_lbls = [QLabel('Min value: ') for i in range(3)]
|
|
109
|
+
self.max_val_les = [QLineEdit('10000') for i in range(3)]
|
|
110
|
+
self.max_val_lbls = [QLabel('Max value: ') for i in range(3)]
|
|
111
|
+
self.percentile_mode = False
|
|
112
|
+
|
|
113
|
+
self.rgb_text = ['R: ', 'G: ', 'B: ']
|
|
114
|
+
|
|
115
|
+
for i in range(3):
|
|
116
|
+
|
|
117
|
+
hlayout = QHBoxLayout()
|
|
118
|
+
self.channel_cbs[i].addItems(self.channel_names)
|
|
119
|
+
self.channel_cbs[i].setCurrentIndex(i)
|
|
120
|
+
self.channel_cbs_lbls[i].setText(self.rgb_text[i])
|
|
121
|
+
hlayout.addWidget(self.channel_cbs_lbls[i], 20)
|
|
122
|
+
hlayout.addWidget(self.channel_cbs[i], 80)
|
|
123
|
+
sub_layout.addLayout(hlayout)
|
|
124
|
+
|
|
125
|
+
hlayout2 = QHBoxLayout()
|
|
126
|
+
hlayout2.addWidget(self.min_val_lbls[i], 20)
|
|
127
|
+
hlayout2.addWidget(self.min_val_les[i], 80)
|
|
128
|
+
sub_layout.addLayout(hlayout2)
|
|
129
|
+
|
|
130
|
+
hlayout3 = QHBoxLayout()
|
|
131
|
+
hlayout3.addWidget(self.max_val_lbls[i], 20)
|
|
132
|
+
hlayout3.addWidget(self.max_val_les[i], 80)
|
|
133
|
+
sub_layout.addLayout(hlayout3)
|
|
134
|
+
|
|
135
|
+
self.enable_channels()
|
|
136
|
+
|
|
137
|
+
self.gs_btn.toggled.connect(self.enable_channels)
|
|
138
|
+
self.rgb_btn.toggled.connect(self.enable_channels)
|
|
139
|
+
|
|
140
|
+
self.hsep = QHSeperationLine()
|
|
141
|
+
sub_layout.addWidget(self.hsep)
|
|
142
|
+
|
|
143
|
+
hbox_frac = QHBoxLayout()
|
|
144
|
+
hbox_frac.addWidget(QLabel('fraction: '), 20)
|
|
145
|
+
|
|
146
|
+
self.fraction_slider = QLabeledDoubleSlider()
|
|
147
|
+
self.fraction_slider.setSingleStep(0.05)
|
|
148
|
+
self.fraction_slider.setTickInterval(0.05)
|
|
149
|
+
self.fraction_slider.setSingleStep(1)
|
|
150
|
+
self.fraction_slider.setOrientation(1)
|
|
151
|
+
self.fraction_slider.setRange(0.1,1)
|
|
152
|
+
self.fraction_slider.setValue(0.25)
|
|
153
|
+
|
|
154
|
+
hbox_frac.addWidget(self.fraction_slider, 80)
|
|
155
|
+
sub_layout.addLayout(hbox_frac)
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
hbox_interval = QHBoxLayout()
|
|
159
|
+
hbox_interval.addWidget(QLabel('interval [ms]: '), 20)
|
|
160
|
+
|
|
161
|
+
self.interval_slider = QLabeledSlider()
|
|
162
|
+
self.interval_slider.setSingleStep(1)
|
|
163
|
+
self.interval_slider.setTickInterval(1)
|
|
164
|
+
self.interval_slider.setSingleStep(1)
|
|
165
|
+
self.interval_slider.setOrientation(1)
|
|
166
|
+
self.interval_slider.setRange(1,1000)
|
|
167
|
+
self.interval_slider.setValue(1)
|
|
168
|
+
hbox_interval.addWidget(self.interval_slider, 80)
|
|
169
|
+
sub_layout.addLayout(hbox_interval)
|
|
170
|
+
|
|
171
|
+
main_layout.addLayout(sub_layout)
|
|
172
|
+
|
|
173
|
+
self.submit_btn = QPushButton('Save')
|
|
174
|
+
self.submit_btn.setStyleSheet(self.parent.parent.parent.button_style_sheet)
|
|
175
|
+
self.submit_btn.clicked.connect(self.write_instructions)
|
|
176
|
+
main_layout.addWidget(self.submit_btn)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
self.button_widget.adjustSize()
|
|
180
|
+
self.scroll_area.setAlignment(Qt.AlignCenter)
|
|
181
|
+
self.scroll_area.setWidget(self.button_widget)
|
|
182
|
+
self.scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAsNeeded)
|
|
183
|
+
self.scroll_area.setHorizontalScrollBarPolicy(Qt.ScrollBarAsNeeded)
|
|
184
|
+
self.scroll_area.setWidgetResizable(True)
|
|
185
|
+
self.setCentralWidget(self.scroll_area)
|
|
186
|
+
self.show()
|
|
187
|
+
|
|
188
|
+
self.read_instructions()
|
|
189
|
+
|
|
190
|
+
QApplication.processEvents()
|
|
191
|
+
|
|
192
|
+
def enable_channels(self):
|
|
193
|
+
|
|
194
|
+
"""
|
|
195
|
+
Enable three channels when RGB mode is checked.
|
|
196
|
+
|
|
197
|
+
"""
|
|
198
|
+
|
|
199
|
+
if self.gs_btn.isChecked():
|
|
200
|
+
|
|
201
|
+
self.log_btn.setEnabled(True)
|
|
202
|
+
self.percentile_btn.setEnabled(False)
|
|
203
|
+
|
|
204
|
+
for k in range(1,3):
|
|
205
|
+
self.channel_cbs[k].setEnabled(False)
|
|
206
|
+
self.channel_cbs_lbls[k].setEnabled(False)
|
|
207
|
+
|
|
208
|
+
for k in range(3):
|
|
209
|
+
|
|
210
|
+
self.min_val_les[k].setEnabled(False)
|
|
211
|
+
self.min_val_lbls[k].setEnabled(False)
|
|
212
|
+
self.max_val_les[k].setEnabled(False)
|
|
213
|
+
self.max_val_lbls[k].setEnabled(False)
|
|
214
|
+
|
|
215
|
+
elif self.rgb_btn.isChecked():
|
|
216
|
+
|
|
217
|
+
self.log_btn.setEnabled(False)
|
|
218
|
+
self.percentile_btn.setEnabled(True)
|
|
219
|
+
|
|
220
|
+
for k in range(3):
|
|
221
|
+
|
|
222
|
+
self.channel_cbs[k].setEnabled(True)
|
|
223
|
+
self.channel_cbs_lbls[k].setEnabled(True)
|
|
224
|
+
|
|
225
|
+
self.min_val_les[k].setEnabled(True)
|
|
226
|
+
self.min_val_lbls[k].setEnabled(True)
|
|
227
|
+
self.max_val_les[k].setEnabled(True)
|
|
228
|
+
self.max_val_lbls[k].setEnabled(True)
|
|
229
|
+
|
|
230
|
+
def switch_to_absolute_normalization_mode(self):
|
|
231
|
+
|
|
232
|
+
"""
|
|
233
|
+
Use absolute or percentile values for the normalization of each individual channel.
|
|
234
|
+
|
|
235
|
+
"""
|
|
236
|
+
|
|
237
|
+
if self.percentile_mode:
|
|
238
|
+
self.percentile_mode = False
|
|
239
|
+
self.percentile_btn.setIcon(icon(MDI6.percent_circle_outline,color="black"))
|
|
240
|
+
self.percentile_btn.setIconSize(QSize(20, 20))
|
|
241
|
+
self.percentile_btn.setToolTip("Switch to percentile normalization values.")
|
|
242
|
+
for k in range(3):
|
|
243
|
+
self.min_val_lbls[k].setText('Min value: ')
|
|
244
|
+
self.min_val_les[k].setText('0')
|
|
245
|
+
self.max_val_lbls[k].setText('Max value: ')
|
|
246
|
+
self.max_val_les[k].setText('10000')
|
|
247
|
+
else:
|
|
248
|
+
self.percentile_mode = True
|
|
249
|
+
self.percentile_btn.setIcon(icon(MDI6.percent_circle,color="black"))
|
|
250
|
+
self.percentile_btn.setIconSize(QSize(20, 20))
|
|
251
|
+
self.percentile_btn.setToolTip("Switch to absolute normalization values.")
|
|
252
|
+
for k in range(3):
|
|
253
|
+
self.min_val_lbls[k].setText('Min percentile: ')
|
|
254
|
+
self.min_val_les[k].setText('0.01')
|
|
255
|
+
self.max_val_lbls[k].setText('Max percentile: ')
|
|
256
|
+
self.max_val_les[k].setText('99.99')
|
|
257
|
+
|
|
258
|
+
def write_instructions(self):
|
|
259
|
+
|
|
260
|
+
"""
|
|
261
|
+
Save the current configuration.
|
|
262
|
+
|
|
263
|
+
"""
|
|
264
|
+
|
|
265
|
+
instructions = {'rgb_mode': self.rgb_btn.isChecked(), 'percentile_mode': self.percentile_mode, 'fraction': float(self.fraction_slider.value()), 'interval': int(self.interval_slider.value()), 'log': self.log_option}
|
|
266
|
+
max_i = 3 if self.rgb_btn.isChecked() else 1
|
|
267
|
+
channels = []
|
|
268
|
+
for i in range(max_i):
|
|
269
|
+
channels.append([self.channel_cbs[i].currentText(), float(self.min_val_les[i].text()), float(self.max_val_les[i].text())])
|
|
270
|
+
instructions.update({'channels': channels})
|
|
271
|
+
|
|
272
|
+
print('Instructions: ', instructions)
|
|
273
|
+
file_name = self.instructions_path
|
|
274
|
+
with open(file_name, 'w') as f:
|
|
275
|
+
json.dump(instructions, f, indent=4)
|
|
276
|
+
print('Done.')
|
|
277
|
+
self.close()
|
|
278
|
+
|
|
279
|
+
def read_instructions(self):
|
|
280
|
+
|
|
281
|
+
"""
|
|
282
|
+
Read and set the widgets to the last configuration.
|
|
283
|
+
|
|
284
|
+
"""
|
|
285
|
+
|
|
286
|
+
print('Reading instructions..')
|
|
287
|
+
if os.path.exists(self.instructions_path):
|
|
288
|
+
with open(self.instructions_path, 'r') as f:
|
|
289
|
+
instructions = json.load(f)
|
|
290
|
+
print(instructions)
|
|
291
|
+
|
|
292
|
+
if 'rgb_mode' in instructions:
|
|
293
|
+
rgb_mode = instructions['rgb_mode']
|
|
294
|
+
if rgb_mode:
|
|
295
|
+
self.rgb_btn.setChecked(True)
|
|
296
|
+
self.gs_btn.setChecked(False)
|
|
297
|
+
|
|
298
|
+
if 'percentile_mode' in instructions:
|
|
299
|
+
percentile_mode = instructions['percentile_mode']
|
|
300
|
+
if percentile_mode:
|
|
301
|
+
self.percentile_btn.click()
|
|
302
|
+
|
|
303
|
+
if 'channels' in instructions:
|
|
304
|
+
channels = instructions['channels']
|
|
305
|
+
|
|
306
|
+
if len(channels)==1:
|
|
307
|
+
max_iter = 1
|
|
308
|
+
else:
|
|
309
|
+
max_iter = 3
|
|
310
|
+
|
|
311
|
+
for i in range(max_iter):
|
|
312
|
+
idx = self.channel_cbs[i].findText(channels[i][0])
|
|
313
|
+
self.channel_cbs[i].setCurrentIndex(idx)
|
|
314
|
+
self.min_val_les[i].setText(str(channels[i][1]))
|
|
315
|
+
self.max_val_les[i].setText(str(channels[i][2]))
|
|
316
|
+
|
|
317
|
+
if 'fraction' in instructions:
|
|
318
|
+
fraction = instructions['fraction']
|
|
319
|
+
self.fraction_slider.setValue(fraction)
|
|
320
|
+
|
|
321
|
+
if 'interval' in instructions:
|
|
322
|
+
interval = instructions['interval']
|
|
323
|
+
self.interval_slider.setValue(interval)
|
|
324
|
+
|
|
325
|
+
if 'log' in instructions:
|
|
326
|
+
self.log_option = not instructions['log']
|
|
327
|
+
self.switch_to_log()
|
|
328
|
+
|
|
329
|
+
def switch_to_log(self):
|
|
330
|
+
|
|
331
|
+
"""
|
|
332
|
+
Switch threshold histogram to log scale. Auto adjust.
|
|
333
|
+
"""
|
|
334
|
+
|
|
335
|
+
if not self.log_option:
|
|
336
|
+
self.log_btn.setIcon(icon(MDI6.math_log,color="#1565c0"))
|
|
337
|
+
self.log_option = True
|
|
338
|
+
else:
|
|
339
|
+
self.log_btn.setIcon(icon(MDI6.math_log,color="black"))
|
|
340
|
+
self.log_option = False
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
class Styles(object):
|
|
2
|
+
|
|
3
|
+
def __init__(self):
|
|
4
|
+
|
|
5
|
+
self.init_button_styles()
|
|
6
|
+
self.init_tab_styles()
|
|
7
|
+
|
|
8
|
+
def init_button_styles(self):
|
|
9
|
+
|
|
10
|
+
self.button_style_sheet = '''
|
|
11
|
+
QPushButton {
|
|
12
|
+
background-color: #1565c0;
|
|
13
|
+
color: white;
|
|
14
|
+
border-radius: 13px;
|
|
15
|
+
padding: 7px;
|
|
16
|
+
font-weight: bold;
|
|
17
|
+
font-size: 12px;
|
|
18
|
+
}
|
|
19
|
+
QPushButton:hover {
|
|
20
|
+
background-color: #2070EB;
|
|
21
|
+
}
|
|
22
|
+
QPushButton:pressed {
|
|
23
|
+
background-color: #ff8a00;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
QPushButton:!enabled {
|
|
27
|
+
background-color: #92a8c0;
|
|
28
|
+
color: white;
|
|
29
|
+
border-radius: 13px;
|
|
30
|
+
padding: 7px;
|
|
31
|
+
font-weight: bold;
|
|
32
|
+
font-size: 12px;
|
|
33
|
+
}
|
|
34
|
+
'''
|
|
35
|
+
|
|
36
|
+
self.button_style_sheet_2 = '''
|
|
37
|
+
QPushButton {
|
|
38
|
+
background-color: transparent;
|
|
39
|
+
border: 3px solid #1565c0;
|
|
40
|
+
color: #1565c0;
|
|
41
|
+
border-radius: 15px;
|
|
42
|
+
padding: 7px;
|
|
43
|
+
font-weight: bold;
|
|
44
|
+
font-size: 12px;
|
|
45
|
+
}
|
|
46
|
+
QPushButton:hover {
|
|
47
|
+
background-color: #ecf0f1;
|
|
48
|
+
}
|
|
49
|
+
QPushButton:pressed {
|
|
50
|
+
background-color: #ff8a00;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
QPushButton:disabled {
|
|
54
|
+
border: 3px solid rgba(21, 101, 192, 0.50);
|
|
55
|
+
color: rgba(21, 101, 192, 0.50);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
'''
|
|
59
|
+
|
|
60
|
+
self.button_style_sheet_2_not_done = '''
|
|
61
|
+
QPushButton {
|
|
62
|
+
background-color: transparent;
|
|
63
|
+
border: 3px solid #d14334;
|
|
64
|
+
color: #d14334;
|
|
65
|
+
border-radius: 15px;
|
|
66
|
+
padding: 7px;
|
|
67
|
+
font-weight: bold;
|
|
68
|
+
font-size: 12px;
|
|
69
|
+
}
|
|
70
|
+
QPushButton:hover {
|
|
71
|
+
background-color: #ecf0f1;
|
|
72
|
+
}
|
|
73
|
+
QPushButton:pressed {
|
|
74
|
+
background-color: #ff8a00;
|
|
75
|
+
}
|
|
76
|
+
'''
|
|
77
|
+
|
|
78
|
+
self.button_style_sheet_3 = '''
|
|
79
|
+
QPushButton {
|
|
80
|
+
background-color: #eeeeee;
|
|
81
|
+
color: black;
|
|
82
|
+
border-radius: 10px;
|
|
83
|
+
padding: 7px;
|
|
84
|
+
font-size: 8px;
|
|
85
|
+
}
|
|
86
|
+
QPushButton:hover {
|
|
87
|
+
background-color: #2070EB;
|
|
88
|
+
}
|
|
89
|
+
QPushButton:pressed {
|
|
90
|
+
background-color: #ff8a00;
|
|
91
|
+
}
|
|
92
|
+
'''
|
|
93
|
+
|
|
94
|
+
self.button_select_all = '''
|
|
95
|
+
QPushButton {
|
|
96
|
+
background-color: transparent;
|
|
97
|
+
color: black;
|
|
98
|
+
border-radius: 15px;
|
|
99
|
+
padding: 7px;
|
|
100
|
+
font-size: 9px;
|
|
101
|
+
}
|
|
102
|
+
QPushButton:hover {
|
|
103
|
+
background-color: #bdbdbd;
|
|
104
|
+
}
|
|
105
|
+
QPushButton:pressed {
|
|
106
|
+
background-color: #ff8a00;
|
|
107
|
+
}
|
|
108
|
+
'''
|
|
109
|
+
|
|
110
|
+
self.button_add = '''
|
|
111
|
+
QPushButton {
|
|
112
|
+
background-color: transparent;
|
|
113
|
+
color: black;
|
|
114
|
+
border-radius: 13px;
|
|
115
|
+
padding: 7px;
|
|
116
|
+
font-size: 12px;
|
|
117
|
+
Text-align: left;
|
|
118
|
+
}
|
|
119
|
+
QPushButton:hover {
|
|
120
|
+
background-color: #bdbdbd;
|
|
121
|
+
}
|
|
122
|
+
QPushButton:pressed {
|
|
123
|
+
background-color: #ff8a00;
|
|
124
|
+
}
|
|
125
|
+
'''
|
|
126
|
+
|
|
127
|
+
def init_tab_styles(self):
|
|
128
|
+
|
|
129
|
+
self.qtab_style = """
|
|
130
|
+
QTabWidget::pane {
|
|
131
|
+
border: 1px solid #B8B8B8;
|
|
132
|
+
background: white;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
QTabWidget::tab-bar:top {
|
|
136
|
+
top: 1px;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
QTabWidget::tab-bar:bottom {
|
|
140
|
+
bottom: 3px solid blue;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
QTabWidget::tab-bar:left {
|
|
144
|
+
right: 1px;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
QTabWidget::tab-bar:right {
|
|
148
|
+
left: 1px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
QTabBar::tab {
|
|
152
|
+
border: 1px solid #B8B8B8;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
QTabBar::tab:selected {
|
|
156
|
+
background: white;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
QTabBar::tab:!selected {
|
|
160
|
+
background: silver;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
QTabBar::tab:!selected:hover {
|
|
164
|
+
background: #999;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
QTabBar::tab:top:!selected {
|
|
168
|
+
margin-top: 3px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
QTabBar::tab:bottom:!selected {
|
|
172
|
+
margin-bottom: 3px;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
QTabBar::tab:top, QTabBar::tab:bottom {
|
|
176
|
+
min-width: 8ex;
|
|
177
|
+
margin-right: -1px;
|
|
178
|
+
padding: 5px 10px 5px 10px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
QTabBar::tab:top:selected {
|
|
182
|
+
border-bottom: 4px solid #1565c0;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
QTabBar::tab:top:last, QTabBar::tab:bottom:last,
|
|
187
|
+
QTabBar::tab:top:only-one, QTabBar::tab:bottom:only-one {
|
|
188
|
+
margin-right: 0;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
QTabBar::tab:left:!selected {
|
|
192
|
+
margin-right: 3px;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
QTabBar::tab:right:!selected {
|
|
196
|
+
margin-left: 3px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
QTabBar::tab:left, QTabBar::tab:right {
|
|
200
|
+
min-height: 8ex;
|
|
201
|
+
margin-bottom: -1px;
|
|
202
|
+
padding: 10px 5px 10px 5px;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
QTabBar::tab:left:selected {
|
|
206
|
+
border-left-color: none;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
QTabBar::tab:right:selected {
|
|
210
|
+
border-right-color: none;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
QTabBar::tab:left:last, QTabBar::tab:right:last,
|
|
214
|
+
QTabBar::tab:left:only-one, QTabBar::tab:right:only-one {
|
|
215
|
+
margin-bottom: 0;
|
|
216
|
+
}
|
|
217
|
+
"""
|