cellects 0.3.1__py3-none-any.whl → 0.3.5__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.
- cellects/core/cellects_paths.py +1 -1
- cellects/core/script_based_run.py +5 -1
- cellects/gui/advanced_parameters.py +21 -32
- cellects/gui/cellects.py +10 -4
- cellects/gui/custom_widgets.py +4 -103
- cellects/gui/first_window.py +37 -43
- cellects/gui/if_several_folders_window.py +11 -18
- cellects/gui/image_analysis_window.py +103 -119
- cellects/gui/required_output.py +7 -16
- cellects/gui/video_analysis_window.py +50 -65
- cellects/image_analysis/shape_descriptors.py +1 -1
- cellects/utils/load_display_save.py +2 -2
- {cellects-0.3.1.dist-info → cellects-0.3.5.dist-info}/METADATA +10 -10
- {cellects-0.3.1.dist-info → cellects-0.3.5.dist-info}/RECORD +18 -18
- {cellects-0.3.1.dist-info → cellects-0.3.5.dist-info}/LICENSE +0 -0
- {cellects-0.3.1.dist-info → cellects-0.3.5.dist-info}/WHEEL +0 -0
- {cellects-0.3.1.dist-info → cellects-0.3.5.dist-info}/entry_points.txt +0 -0
- {cellects-0.3.1.dist-info → cellects-0.3.5.dist-info}/top_level.txt +0 -0
cellects/core/cellects_paths.py
CHANGED
|
@@ -35,7 +35,7 @@ def load_data(rgb_video: NDArray=None, pathway: str='', sample_number:int=None,
|
|
|
35
35
|
po = ProgramOrganizer()
|
|
36
36
|
if rgb_video is None:
|
|
37
37
|
if len(pathway) == 0:
|
|
38
|
-
pathway = Path(os.getcwd() + "/data/
|
|
38
|
+
pathway = Path(os.getcwd() + "/data/single_experiment")
|
|
39
39
|
po.all['global_pathway'] = pathway
|
|
40
40
|
po.all['first_folder_sample_number'] = sample_number
|
|
41
41
|
po.all['radical'] = radical
|
|
@@ -87,6 +87,10 @@ def run_one_video_analysis(po, with_video_in_ram: bool=False):
|
|
|
87
87
|
l = [i, i + 1, po.vars, segment, False, show_seg, videos_already_in_ram]
|
|
88
88
|
MA = MotionAnalysis(l)
|
|
89
89
|
MA.get_descriptors_from_binary()
|
|
90
|
+
if os.path.isfile('colony_centroids1_20col_t20_y1000_x1000.csv'):
|
|
91
|
+
os.remove('colony_centroids1_20col_t20_y1000_x1000.csv')
|
|
92
|
+
if os.path.isfile('data/single_experiment/colony_centroids1_20col_t20_y1000_x1000.csv'):
|
|
93
|
+
os.remove('data/single_experiment/colony_centroids1_20col_t20_y1000_x1000.csv')
|
|
90
94
|
# MA.detect_growth_transitions()
|
|
91
95
|
# MA.networks_analysis(show_seg)
|
|
92
96
|
# MA.study_cytoscillations(show_seg)
|
|
@@ -558,24 +558,25 @@ class AdvancedParameters(WindowType):
|
|
|
558
558
|
self.right_col_layout.addWidget(self.edit_widget)
|
|
559
559
|
|
|
560
560
|
# VIII/ Finalize layout and add the night mode option and the ok button
|
|
561
|
-
self.left_col_layout.addItem(
|
|
562
|
-
self.right_col_layout.addItem(
|
|
561
|
+
self.left_col_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.MinimumExpanding))
|
|
562
|
+
self.right_col_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.MinimumExpanding))
|
|
563
563
|
self.left_col_widget.setLayout(self.left_col_layout)
|
|
564
564
|
self.right_col_widget.setLayout(self.right_col_layout)
|
|
565
|
+
self.central_widget = QtWidgets.QWidget()
|
|
565
566
|
self.central_layout = QtWidgets.QHBoxLayout()
|
|
566
|
-
self.central_layout.addItem(
|
|
567
|
+
self.central_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
|
|
567
568
|
self.left_scroll_table.setWidget(self.left_col_widget)
|
|
568
569
|
self.left_scroll_table.setWidgetResizable(True)
|
|
570
|
+
self.left_scroll_table.setParent(self.central_widget)
|
|
569
571
|
self.central_layout.addWidget(self.left_scroll_table)
|
|
570
|
-
self.central_layout.addItem(
|
|
572
|
+
self.central_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
|
|
571
573
|
self.right_scroll_table.setWidget(self.right_col_widget)
|
|
572
574
|
self.right_scroll_table.setWidgetResizable(True)
|
|
575
|
+
self.right_scroll_table.setParent(self.central_widget)
|
|
573
576
|
self.central_layout.addWidget(self.right_scroll_table)
|
|
574
|
-
self.central_layout.addItem(
|
|
575
|
-
self.central_widget = QtWidgets.QWidget()
|
|
577
|
+
self.central_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
|
|
576
578
|
self.central_widget.setLayout(self.central_layout)
|
|
577
579
|
self.layout.addWidget(self.central_widget)
|
|
578
|
-
# self.layout.addItem(self.vertical_space)
|
|
579
580
|
|
|
580
581
|
# Last row
|
|
581
582
|
self.last_row_layout = QtWidgets.QHBoxLayout()
|
|
@@ -595,7 +596,7 @@ class AdvancedParameters(WindowType):
|
|
|
595
596
|
self.last_row_layout.addWidget(self.night_mode_cb)
|
|
596
597
|
self.last_row_layout.addWidget(self.night_mode_label)
|
|
597
598
|
self.last_row_layout.addWidget(self.reset_all_settings)
|
|
598
|
-
self.last_row_layout.addItem(
|
|
599
|
+
self.last_row_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
|
|
599
600
|
self.last_row_layout.addWidget(self.message)
|
|
600
601
|
self.last_row_layout.addWidget(self.cancel)
|
|
601
602
|
self.last_row_layout.addWidget(self.ok)
|
|
@@ -746,15 +747,13 @@ class AdvancedParameters(WindowType):
|
|
|
746
747
|
"""
|
|
747
748
|
self.edit_widget = QtWidgets.QWidget()
|
|
748
749
|
self.edit_layout = QtWidgets.QVBoxLayout()
|
|
749
|
-
self.csc_table_widget = QtWidgets.QWidget()
|
|
750
|
-
self.csc_table_layout = QtWidgets.QVBoxLayout()
|
|
751
750
|
|
|
752
751
|
# 2) Titles
|
|
753
752
|
self.video_csc_label = FixedText(AP["Csc_for_video_analysis"]["label"] + ':',
|
|
754
753
|
tip=AP["Csc_for_video_analysis"]["tips"],
|
|
755
754
|
night_mode=self.parent().po.all['night_mode'])
|
|
756
755
|
self.video_csc_label.setFixedHeight(30)
|
|
757
|
-
self.
|
|
756
|
+
self.edit_layout.addWidget(self.video_csc_label)
|
|
758
757
|
self.both_csc_widget = QtWidgets.QWidget()
|
|
759
758
|
self.both_csc_layout = QtWidgets.QHBoxLayout()
|
|
760
759
|
|
|
@@ -786,7 +785,7 @@ class AdvancedParameters(WindowType):
|
|
|
786
785
|
self.row2[i].setVisible(False)
|
|
787
786
|
self.row3[i].setVisible(False)
|
|
788
787
|
self.first_csc_layout.setHorizontalSpacing(0)
|
|
789
|
-
self.first_csc_layout.addItem(
|
|
788
|
+
self.first_csc_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum), 0, 5, 3, 1)
|
|
790
789
|
self.first_csc_widget.setLayout(self.first_csc_layout)
|
|
791
790
|
self.both_csc_layout.addWidget(self.first_csc_widget)
|
|
792
791
|
|
|
@@ -801,12 +800,12 @@ class AdvancedParameters(WindowType):
|
|
|
801
800
|
self.row22[i].setVisible(False)
|
|
802
801
|
self.row23[i].setVisible(False)
|
|
803
802
|
self.second_csc_layout.setHorizontalSpacing(0)
|
|
804
|
-
self.second_csc_layout.addItem(
|
|
803
|
+
self.second_csc_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum), 0, 5, 3, 1)
|
|
805
804
|
self.second_csc_widget.setLayout(self.second_csc_layout)
|
|
806
|
-
self.both_csc_layout.addItem(
|
|
805
|
+
self.both_csc_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
|
|
807
806
|
self.both_csc_layout.addWidget(self.second_csc_widget)
|
|
808
807
|
self.both_csc_widget.setLayout(self.both_csc_layout)
|
|
809
|
-
self.
|
|
808
|
+
self.edit_layout.addWidget(self.both_csc_widget)
|
|
810
809
|
|
|
811
810
|
# 4) logical_operator
|
|
812
811
|
self.logical_op_widget = QtWidgets.QWidget()
|
|
@@ -814,12 +813,12 @@ class AdvancedParameters(WindowType):
|
|
|
814
813
|
self.logical_op_layout = QtWidgets.QHBoxLayout()
|
|
815
814
|
self.logical_op_layout.addWidget(self.logical_operator_label)
|
|
816
815
|
self.logical_op_layout.addWidget(self.logical_operator_between_combination_result)
|
|
817
|
-
self.logical_op_layout.addItem(
|
|
816
|
+
self.logical_op_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
|
|
818
817
|
self.logical_operator_between_combination_result.setVisible(False)
|
|
819
818
|
self.logical_operator_label.setVisible(False)
|
|
820
819
|
self.logical_op_widget.setLayout(self.logical_op_layout)
|
|
821
820
|
self.logical_op_widget.setFixedHeight(50)
|
|
822
|
-
self.
|
|
821
|
+
self.edit_layout.addWidget(self.logical_op_widget)
|
|
823
822
|
|
|
824
823
|
# 6) Open the more_than_2_colors row layout
|
|
825
824
|
self.more_than_2_colors_widget = QtWidgets.QWidget()
|
|
@@ -843,15 +842,11 @@ class AdvancedParameters(WindowType):
|
|
|
843
842
|
self.more_than_2_colors_layout.addWidget(self.more_than_two_colors)
|
|
844
843
|
self.more_than_2_colors_layout.addWidget(self.more_than_two_colors_label)
|
|
845
844
|
self.more_than_2_colors_layout.addWidget(self.distinct_colors_number)
|
|
846
|
-
self.more_than_2_colors_layout.addItem(
|
|
845
|
+
self.more_than_2_colors_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
|
|
847
846
|
self.more_than_2_colors_widget.setLayout(self.more_than_2_colors_layout)
|
|
848
847
|
self.more_than_2_colors_widget.setFixedHeight(50)
|
|
849
|
-
self.
|
|
850
|
-
self.
|
|
851
|
-
self.csc_table_widget.setLayout(self.csc_table_layout)
|
|
852
|
-
|
|
853
|
-
self.edit_layout.addWidget(self.csc_table_widget)
|
|
854
|
-
|
|
848
|
+
self.edit_layout.addWidget(self.more_than_2_colors_widget)
|
|
849
|
+
self.edit_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.MinimumExpanding))
|
|
855
850
|
self.edit_widget.setLayout(self.edit_layout)
|
|
856
851
|
|
|
857
852
|
def one_csc_editing(self):
|
|
@@ -1303,16 +1298,10 @@ class AdvancedParameters(WindowType):
|
|
|
1303
1298
|
if not are_dicts_equal:
|
|
1304
1299
|
self.parent().po.find_if_lighter_background()
|
|
1305
1300
|
|
|
1306
|
-
if not self.parent().
|
|
1307
|
-
self.parent().
|
|
1301
|
+
if not self.parent().thread_dict['SaveAllVars'].isRunning():
|
|
1302
|
+
self.parent().thread_dict['SaveAllVars'].start()
|
|
1308
1303
|
|
|
1309
1304
|
if self.parent().last_is_first:
|
|
1310
1305
|
self.parent().change_widget(0) # FirstWidget
|
|
1311
1306
|
else:
|
|
1312
1307
|
self.parent().change_widget(3) # ImageAnalysisWindow ThirdWidget
|
|
1313
|
-
|
|
1314
|
-
def closeEvent(self, event):
|
|
1315
|
-
"""
|
|
1316
|
-
Handle the close event for a QWidget.
|
|
1317
|
-
"""
|
|
1318
|
-
event.accept
|
cellects/gui/cellects.py
CHANGED
|
@@ -110,8 +110,8 @@ class CellectsMainWidget(QtWidgets.QStackedWidget):
|
|
|
110
110
|
|
|
111
111
|
self.instantiate_widgets()
|
|
112
112
|
|
|
113
|
-
self.
|
|
114
|
-
self.
|
|
113
|
+
self.thread_dict = {}
|
|
114
|
+
self.thread_dict['SaveAllVars'] = SaveAllVarsThread(self)
|
|
115
115
|
self.change_widget(0)
|
|
116
116
|
self.center()
|
|
117
117
|
|
|
@@ -192,9 +192,15 @@ class CellectsMainWidget(QtWidgets.QStackedWidget):
|
|
|
192
192
|
QtWidgets.QMessageBox.No)
|
|
193
193
|
|
|
194
194
|
if reply == QtWidgets.QMessageBox.Yes:
|
|
195
|
-
|
|
195
|
+
for _, thread in self.imageanalysiswindow.thread_dict.items():
|
|
196
|
+
thread.wait()
|
|
197
|
+
for _, thread in self.ifseveralfolderswindow.thread_dict.items():
|
|
198
|
+
thread.wait()
|
|
199
|
+
for _, thread in self.videoanalysiswindow.thread_dict.items():
|
|
200
|
+
thread.wait()
|
|
201
|
+
for _, thread in self.firstwindow.thread_dict.items():
|
|
202
|
+
thread.wait()
|
|
196
203
|
logging.info("Closing main window.")
|
|
197
204
|
event.accept()
|
|
198
|
-
self.close()
|
|
199
205
|
else:
|
|
200
206
|
event.ignore()
|
cellects/gui/custom_widgets.py
CHANGED
|
@@ -16,9 +16,6 @@ print(font_names)
|
|
|
16
16
|
"Baskerville" in font_names
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
|
-
# colorblind-friendly : rgb(42, 251, 97) , rgb(126, 85, 197)
|
|
20
|
-
# titlesize = 40
|
|
21
|
-
|
|
22
19
|
if os.name == 'nt':
|
|
23
20
|
buttonfont = QFont("Century Gothic", 17, QFont.Bold)
|
|
24
21
|
titlefont = f"Baskerville Old Face" #"40pt Baskerville Old Face"
|
|
@@ -60,6 +57,7 @@ class WindowType(QtWidgets.QWidget):
|
|
|
60
57
|
def __init__(self, parent, night_mode=False):
|
|
61
58
|
super().__init__()
|
|
62
59
|
|
|
60
|
+
self.thread_dict = {}
|
|
63
61
|
self.setVisible(False)
|
|
64
62
|
self.setParent(parent)
|
|
65
63
|
self.frame = QtWidgets.QFrame(self)
|
|
@@ -67,10 +65,6 @@ class WindowType(QtWidgets.QWidget):
|
|
|
67
65
|
self.display_image = None
|
|
68
66
|
self.setFont(QFont(textfont, textsize, QFont.Medium))
|
|
69
67
|
self.night_mode_switch(night_mode)
|
|
70
|
-
self.horizontal_space = QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding,
|
|
71
|
-
QtWidgets.QSizePolicy.Maximum)
|
|
72
|
-
self.vertical_space = QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Maximum,
|
|
73
|
-
QtWidgets.QSizePolicy.MinimumExpanding)
|
|
74
68
|
|
|
75
69
|
def resizeEvent(self, event):
|
|
76
70
|
'''
|
|
@@ -125,7 +119,7 @@ class MainTabsType(WindowType):
|
|
|
125
119
|
self.main_tabs_layout.addWidget(self.video_tab)
|
|
126
120
|
self.main_tabs_widget.setLayout(self.main_tabs_layout)
|
|
127
121
|
self.Vlayout.addWidget(self.main_tabs_widget)
|
|
128
|
-
self.Vlayout.addItem(
|
|
122
|
+
self.Vlayout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.MinimumExpanding))
|
|
129
123
|
|
|
130
124
|
|
|
131
125
|
class FullScreenImage(QtWidgets.QLabel):
|
|
@@ -134,10 +128,8 @@ class FullScreenImage(QtWidgets.QLabel):
|
|
|
134
128
|
self.true_shape = image.shape
|
|
135
129
|
self.max_height = screen_height
|
|
136
130
|
self.max_width = screen_width
|
|
137
|
-
# self.im_size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
|
|
138
131
|
self.im_size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
|
|
139
132
|
QtWidgets.QSizePolicy.MinimumExpanding)
|
|
140
|
-
# self.im_size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
|
141
133
|
self.setSizePolicy(self.im_size_policy)
|
|
142
134
|
|
|
143
135
|
self.height_width_ratio = image.shape[0] / image.shape[1]
|
|
@@ -149,10 +141,6 @@ class FullScreenImage(QtWidgets.QLabel):
|
|
|
149
141
|
self.scaled_shape = [round(self.max_width * self.height_width_ratio), self.max_width]
|
|
150
142
|
else:
|
|
151
143
|
self.scaled_shape = [self.max_height, np.round(self.max_height / self.height_width_ratio)]
|
|
152
|
-
# self.setFixedHeight(self.scaled_shape[0])
|
|
153
|
-
# self.setFixedWidth(self.scaled_shape[1])
|
|
154
|
-
# self.setMaximumHeight(self.scaled_shape[0])
|
|
155
|
-
# self.setMaximumWidth(self.scaled_shape[1])
|
|
156
144
|
self.setMinimumSize(self.scaled_shape[1], self.scaled_shape[0])
|
|
157
145
|
self.setPixmap(QPixmap(image))
|
|
158
146
|
self.adjustSize()
|
|
@@ -164,10 +152,8 @@ class InsertImage(QtWidgets.QLabel):
|
|
|
164
152
|
self.true_shape = image.shape
|
|
165
153
|
self.max_height = max_height
|
|
166
154
|
self.max_width = max_width
|
|
167
|
-
# self.im_size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
|
|
168
155
|
self.im_size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
|
|
169
156
|
QtWidgets.QSizePolicy.MinimumExpanding)
|
|
170
|
-
# self.im_size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
|
|
171
157
|
self.setSizePolicy(self.im_size_policy)
|
|
172
158
|
|
|
173
159
|
self.height_width_ratio = image.shape[0] / image.shape[1]
|
|
@@ -179,12 +165,8 @@ class InsertImage(QtWidgets.QLabel):
|
|
|
179
165
|
self.scaled_shape = [round(self.max_width * self.height_width_ratio), self.max_width]
|
|
180
166
|
else:
|
|
181
167
|
self.scaled_shape = [self.max_height, np.round(self.max_height / self.height_width_ratio)]
|
|
182
|
-
# self.setFixedHeight(self.scaled_shape[0])
|
|
183
|
-
# self.setFixedWidth(self.scaled_shape[1])
|
|
184
168
|
self.setMaximumHeight(self.scaled_shape[0])
|
|
185
169
|
self.setMaximumWidth(self.scaled_shape[1])
|
|
186
|
-
# self.resize(self.scaled_shape[1], self.scaled_shape[0])
|
|
187
|
-
# self.setMinimumSize(self.scaled_shape[0], self.scaled_shape[1])
|
|
188
170
|
self.setPixmap(QPixmap(image))
|
|
189
171
|
self.adjustSize()
|
|
190
172
|
|
|
@@ -200,18 +182,8 @@ class InsertImage(QtWidgets.QLabel):
|
|
|
200
182
|
self.scaled_shape = [int(np.round(self.max_width * self.height_width_ratio)), self.max_width]
|
|
201
183
|
else:
|
|
202
184
|
self.scaled_shape = [self.max_height, int(np.round(self.max_height / self.height_width_ratio))]
|
|
203
|
-
# self.setFixedHeight(self.scaled_shape[0])
|
|
204
|
-
# self.setFixedWidth(self.scaled_shape[1])
|
|
205
185
|
self.setMaximumHeight(self.scaled_shape[0])
|
|
206
186
|
self.setMaximumWidth(self.scaled_shape[1])
|
|
207
|
-
# self.resize(self.scaled_shape[1], self.scaled_shape[0])
|
|
208
|
-
|
|
209
|
-
# if text is not None:
|
|
210
|
-
# pass
|
|
211
|
-
# pos = QtCore.QPoint(50, 50)
|
|
212
|
-
# painter = QPainter(self)
|
|
213
|
-
# painter.drawText(pos, text)
|
|
214
|
-
# painter.setPen(QColor(color, color, color))
|
|
215
187
|
self.setPixmap(QPixmap(image))
|
|
216
188
|
|
|
217
189
|
def update_image_scaling_factors(self):
|
|
@@ -233,19 +205,9 @@ class PButton(QtWidgets.QPushButton):
|
|
|
233
205
|
self.setToolTip(tip)
|
|
234
206
|
self.night_mode_switch(night_mode)
|
|
235
207
|
self.setFont(buttonfont)
|
|
236
|
-
# self.setStyleSheet("background-color: rgb(50,50,65);\n" #50,50,65 150, 150, 150 153, 204, 205 122, 0, 61 30, 144, 220
|
|
237
|
-
# "border-color: rgb(255, 255, 255);\n"
|
|
238
|
-
# "color: rgb(255, 255, 255);\n"
|
|
239
|
-
# "font: 17pt \"Segoe UI Semibold\";\n"
|
|
240
|
-
# "border : 1px solid rgb(255, 255, 255);"
|
|
241
|
-
# "border-radius : 12px;\n"
|
|
242
|
-
# )
|
|
243
208
|
self.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
|
|
244
209
|
self.setFixedWidth(len(text)*15 + 25)
|
|
245
210
|
self.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
|
|
246
|
-
# if fade:
|
|
247
|
-
# # self.mouseMoveEvent.connect(self.fade)
|
|
248
|
-
# self.clicked.connect(self.fade)
|
|
249
211
|
|
|
250
212
|
def night_mode_switch(self, night_mode):
|
|
251
213
|
if night_mode:
|
|
@@ -322,7 +284,6 @@ class Spinbox(QtWidgets.QWidget):
|
|
|
322
284
|
|
|
323
285
|
self._line_edit = QtWidgets.QLineEdit(self)
|
|
324
286
|
self._line_edit.setAlignment(QtCore.Qt.AlignLeft)
|
|
325
|
-
# self._line_edit.setAlignment(QtCore.Qt.AlignRight)
|
|
326
287
|
self._layout.addWidget(self._line_edit)
|
|
327
288
|
|
|
328
289
|
button_layout = QtWidgets.QVBoxLayout()
|
|
@@ -354,17 +315,11 @@ class Spinbox(QtWidgets.QWidget):
|
|
|
354
315
|
self.decimals = decimals
|
|
355
316
|
if decimals is not None:
|
|
356
317
|
self.setDecimals(decimals)
|
|
357
|
-
# self.setStepType(QtWidgets.QAbstractSpinBox.AdaptiveDecimalStepType)
|
|
358
318
|
else:
|
|
359
319
|
self.setDecimals(0)
|
|
360
320
|
self.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
|
|
361
321
|
self.setFont(QFont(textfont, textsize, QFont.Medium))
|
|
362
322
|
self.night_mode_switch(night_mode)
|
|
363
|
-
# self.setStyleSheet("""
|
|
364
|
-
# QSpinBox::up-button { subcontrol-origin: border; subcontrol-position: top right; width: 16px; }
|
|
365
|
-
# QSpinBox::down-button { subcontrol-origin: border; subcontrol-position: bottom right; width: 16px; }
|
|
366
|
-
# QSpinBox::up-arrow, QSpinBox::down-arrow { width: 10px; height: 10px; }
|
|
367
|
-
# """)
|
|
368
323
|
|
|
369
324
|
self.setStyleSheet("""
|
|
370
325
|
QPushButton {
|
|
@@ -479,18 +434,9 @@ class Combobox(QtWidgets.QComboBox):
|
|
|
479
434
|
if current_idx is not None:
|
|
480
435
|
self.setCurrentIndex(current_idx)
|
|
481
436
|
self.setFixedHeight(30)
|
|
482
|
-
#self.adjustSize()
|
|
483
|
-
#max([len(item) for item in items_list])
|
|
484
|
-
# width = self.minimumSizeHint().width()
|
|
485
|
-
# self.setMinimumWidth(width+30)
|
|
486
|
-
# self.setFixedWidth(self.minimumSizeHint().width() + 5)
|
|
487
|
-
|
|
488
|
-
# self.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum)
|
|
489
437
|
self.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
|
|
490
438
|
self.night_mode_switch(night_mode)
|
|
491
439
|
|
|
492
|
-
# self.setStyleSheet("QComboBox::drop - down:!editable{background: transparent; border: none;};"
|
|
493
|
-
# "QComboBox {border: '1px solid rgb(127, 127, 127)'; border-radius: 4px}")
|
|
494
440
|
self.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
|
|
495
441
|
def night_mode_switch(self, night_mode):
|
|
496
442
|
if night_mode:
|
|
@@ -543,11 +489,8 @@ class EditText(QtWidgets.QLineEdit):
|
|
|
543
489
|
self.setText(str(text))
|
|
544
490
|
self.night_mode_switch(night_mode)
|
|
545
491
|
self.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
|
|
546
|
-
# self.setAttribute(QtCore.Qt.WA_MacShowFocusRect, 0)
|
|
547
492
|
|
|
548
493
|
def night_mode_switch(self, night_mode):
|
|
549
|
-
# self.setStyleSheet("border: %s" % bordercolor)
|
|
550
|
-
# self.setStyleSheet("border: %s" % night_border_color)
|
|
551
494
|
if night_mode:
|
|
552
495
|
self.setStyleSheet(
|
|
553
496
|
"background-color: %s; color: %s; font: %s; border-bottom: %s; border-top: %s" % (
|
|
@@ -557,26 +500,6 @@ class EditText(QtWidgets.QLineEdit):
|
|
|
557
500
|
"background-color: %s; color: %s; font: %s; border-bottom: %s; border-top: %s" % (
|
|
558
501
|
backgroundcolor, textColor, f"{textsize}pt {textfont};", f"1px solid grey", f"1px dotted #adadad"))
|
|
559
502
|
|
|
560
|
-
# "QLineEdit"
|
|
561
|
-
# "{"
|
|
562
|
-
# "border : 5px solid black;"
|
|
563
|
-
# "}"
|
|
564
|
-
# "QLineEdit::hover"
|
|
565
|
-
# "{"
|
|
566
|
-
# "border-color : red green blue yellow"
|
|
567
|
-
# "}")
|
|
568
|
-
|
|
569
|
-
# if night_mode:
|
|
570
|
-
# self.setStyleSheet(
|
|
571
|
-
# "background-color: %s; color: %s; font: %s; border-color: %s; selection-color: %s; alternate-border-color: %s; selection-background-color: %s" % (
|
|
572
|
-
# night_background_color, night_text_Color, f"{textsize}pt {textfont};", night_border_color,
|
|
573
|
-
# night_selection_color, night_selection_border_color, night_selection_background_color))
|
|
574
|
-
# else:
|
|
575
|
-
# self.setStyleSheet(
|
|
576
|
-
# "background-color: %s; color: %s; font: %s; border-color: %s; selection-color: %s; alternate-border-color: %s; selection-background-color: %s" % (
|
|
577
|
-
# backgroundcolor, textColor, f"{textsize}pt {textfont};", bordercolor, selectioncolor,
|
|
578
|
-
# selectionbordercolor, selectionbackgroundcolor))
|
|
579
|
-
|
|
580
503
|
|
|
581
504
|
class FixedText(QtWidgets.QLabel):
|
|
582
505
|
def __init__(self, text, police=None, halign='l', valign="c", tip=None, night_mode=False):
|
|
@@ -597,18 +520,8 @@ class FixedText(QtWidgets.QLabel):
|
|
|
597
520
|
|
|
598
521
|
if police is not None:
|
|
599
522
|
if police > 23:
|
|
600
|
-
# self.setStyleSheet("font: %s; margin-bottom: %s" % (titlefont, "30%;"))
|
|
601
|
-
|
|
602
|
-
# self.night_mode_switch(night_mode, titlefont)
|
|
603
523
|
self.night_mode_switch(night_mode, f"{police}pt {titlefont}")
|
|
604
|
-
|
|
605
|
-
# self.setFont(titlefont)
|
|
606
|
-
# self.setStyleSheet("margin-bottom: 30%;\n")
|
|
607
524
|
self.setMargin(2)
|
|
608
|
-
# else:
|
|
609
|
-
# self.night_mode_switch(night_mode, f"{police}pt {textfont}")
|
|
610
|
-
# self.night_mode_switch(night_mode, QFont(textfont, police + 2, QFont.Medium))
|
|
611
|
-
# self.setFont(QFont(textfont, police + 2, QFont.Medium))
|
|
612
525
|
|
|
613
526
|
else:
|
|
614
527
|
self.setFont(QFont(textfont, textsize + 2, QFont.Medium))
|
|
@@ -624,12 +537,6 @@ class FixedText(QtWidgets.QLabel):
|
|
|
624
537
|
border: black solid 1px
|
|
625
538
|
}""")
|
|
626
539
|
|
|
627
|
-
# self.setStyleSheet("""QToolTip {
|
|
628
|
-
# background-color: rgb(150, 150, 150);
|
|
629
|
-
# color: rgb(1, 1, 1);
|
|
630
|
-
# border: black solid 1px
|
|
631
|
-
# }""")
|
|
632
|
-
|
|
633
540
|
def night_mode_switch(self, night_mode, font):
|
|
634
541
|
if night_mode:
|
|
635
542
|
self.setStyleSheet("font: %s; color: %s; margin-bottom: %s" % (font, night_text_Color, "30%"))
|
|
@@ -644,7 +551,6 @@ class LineWidget(QtWidgets.QWidget):
|
|
|
644
551
|
self.line = QtWidgets.QFrame()
|
|
645
552
|
if ori == "h":
|
|
646
553
|
self.line.setFrameShape(QtWidgets.QFrame.HLine)
|
|
647
|
-
# self.setFrameShadow(QtWidgets.QFrame.Sunken)
|
|
648
554
|
else:
|
|
649
555
|
self.line.setFrameShape(QtWidgets.QFrame.VLine)
|
|
650
556
|
self.night_mode_switch(night_mode)
|
|
@@ -652,11 +558,9 @@ class LineWidget(QtWidgets.QWidget):
|
|
|
652
558
|
size = [1, 4]
|
|
653
559
|
self.line.setFixedHeight(size[0])
|
|
654
560
|
self.line.setFixedWidth(size[1])
|
|
655
|
-
|
|
656
|
-
QtWidgets.QSizePolicy.Maximum)
|
|
657
|
-
self.layout.addItem(horizontal_space)
|
|
561
|
+
self.layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
|
|
658
562
|
self.layout.addWidget(self.line)
|
|
659
|
-
self.layout.addItem(
|
|
563
|
+
self.layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
|
|
660
564
|
self.setLayout(self.layout)
|
|
661
565
|
|
|
662
566
|
def night_mode_switch(self, night_mode):
|
|
@@ -685,12 +589,9 @@ class MainTabsWidget(QtWidgets.QPushButton):
|
|
|
685
589
|
self.state = "not_in_use" # States: "not_in_use", "in_use", "not_usable"
|
|
686
590
|
self.setFont(buttonfont)
|
|
687
591
|
|
|
688
|
-
|
|
689
592
|
# Set basic properties
|
|
690
593
|
self.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
|
|
691
|
-
# self.setFixedWidth(len(text)*15 + 25)
|
|
692
594
|
self.setFixedHeight(35)
|
|
693
|
-
# self.setMinimumWidth(80)
|
|
694
595
|
self.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
|
|
695
596
|
|
|
696
597
|
self.night_mode_switch(night_mode)
|