PaIRS-UniNa 0.2.9__cp312-cp312-win_amd64.whl → 0.2.10__cp312-cp312-win_amd64.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.
@@ -80,8 +80,10 @@ if currentID in (developerIDs['GP_Win_Office'],developerIDs['GP_Win_Office_New']
80
80
  'C:/desk/PIV_Img/img1/',
81
81
  'C:/desk/PIV_Img/_data/PIV_data/virtual_case/',
82
82
  'C:/desk/PIV_Img/_data/PIV_data/real_case/',
83
+ 'C:/desk/PIV_Img/_data/SPIV_data/real_case/img/',
83
84
  'C:/desk/PIV_Img/_data/Calibration_data/pinhole/',
84
85
  'C:/desk/PIV_Img/_data/Calibration_data/cylinder/',
86
+ 'C:/desk/PIV_Img/_data/SPIV_data/real_case/calib/',
85
87
  ]
86
88
  basefold_DEBUG_VIS='C:/desk/PIV_Img/_data/PIV_data/real_case/'
87
89
  elif currentID==developerIDs['GP_WSL']:
@@ -148,6 +150,15 @@ fileChanges='Changes.txt'
148
150
  fileWhatsNew=['whatsnew.txt','whatwasnew.txt']
149
151
  icons_path="icons/"
150
152
 
153
+ gPaIRS_QMenu_style="""
154
+ QMenu::item:selected,
155
+ QMenu::item:checked,
156
+ QMenu::item:pressed {
157
+ background-color: rgba(0, 116, 255, 0.8);
158
+ color: white;
159
+ }
160
+ """
161
+
151
162
  from psutil import cpu_count
152
163
  NUMTHREADS_MAX=cpu_count(logical=True)#-1
153
164
  if NUMTHREADS_MAX<1: NUMTHREADS_MAX=1
@@ -808,12 +819,6 @@ def toPlainText(text):
808
819
  PlainTextConverter.setHtml(text) #for safety
809
820
  return PlainTextConverter.toPlainText()
810
821
 
811
- def showTip(obj,message):
812
- toolTipDuration=obj.toolTipDuration()
813
- obj.setToolTipDuration(3000)
814
- QToolTip.showText(QCursor.pos(),message)
815
- obj.setToolTipDuration(toolTipDuration)
816
-
817
822
  def clean_tree(tree:QTreeWidget):
818
823
  def remove_children(item:QTreeWidgetItem):
819
824
  while item.childCount() > 0:
@@ -1166,59 +1171,6 @@ def checkOutDated(packageName:str,printOutDated):
1166
1171
  f3=executor.submit(asyncio.run,checkOutDatedInternal(packageName))
1167
1172
  f3.add_done_callback(checkOutDatedComplete)
1168
1173
 
1169
- def changes(self,TabType,filename,title=" Changes"):
1170
- FlagShow=False
1171
- if self.logChanges:
1172
- if self.logChanges.isVisible():
1173
- FlagShow=True
1174
- if FlagShow:
1175
- self.logChanges.hide()
1176
- self.logChanges.show()
1177
- else:
1178
- self.logChanges=TabType(self,True)
1179
- self.logChanges.resize(720,720)
1180
- self.logChanges.show()
1181
- self.logChanges.ui.progress_Proc.hide()
1182
- self.logChanges.ui.button_close_tab.hide()
1183
- icon=QPixmap(''+ icons_path +'news.png')
1184
- self.logChanges.ui.icon.setPixmap(icon)
1185
- self.logChanges.setWindowIcon(self.windowIcon())
1186
- self.logChanges.setWindowTitle(title)
1187
- self.logChanges.ui.name_tab.setText(title)
1188
-
1189
- self.logChanges.ui.log.setLineWrapColumnOrWidth(self.logChanges.ui.log.width()-20)
1190
- self.logChanges.ui.log.setStyleSheet("")
1191
-
1192
- def setFontPixelSize(logChanges:type(self.logChanges),fPixSize):
1193
- logfont=self.font()
1194
- logfont.setFamily(fontName)
1195
- logfont.setPixelSize(fPixSize+2)
1196
- logChanges.ui.log.setFont(logfont)
1197
- fPixSize_TabNames=min([fPixSize*2,30])
1198
- lab=logChanges.ui.name_tab
1199
- font=lab.font()
1200
- font.setPixelSize(fPixSize_TabNames)
1201
- lab.setFont(font)
1202
- self.logChanges.setFontPixelSize=lambda fS: setFontPixelSize(self.logChanges,fS)
1203
- self.logChanges.setFontPixelSize(self.TABpar.fontPixelSize)
1204
- def logResizeEvent(logChanges:type(self.logChanges),e):
1205
- super(type(logChanges),logChanges).resizeEvent(e)
1206
- logChanges.ui.log.setLineWrapColumnOrWidth(logChanges.ui.log.width()-20)
1207
- self.logChanges.ui.log.resizeEvent=lambda e: logResizeEvent(self.logChanges,e)
1208
-
1209
- self.logChanges.ui.icon.addfuncclick['whatsnew']=self.whatsNew
1210
- self.logChanges.ui.icon.setCustomCursor()
1211
-
1212
- try:
1213
- file = open(filename, "rb")
1214
- content = file.read().decode("utf-8")
1215
- self.logChanges.ui.log.setText(content)
1216
- file.close()
1217
- except Exception as inst:
1218
- pri.Error.red(f'There was a problem while reading the file {filename}:\n{inst}')
1219
- self.logChanges.ui.log.setText(f'No information about PaIRS-UniNa updates available!\n\nSorry for this, try to reinstall PaIRS-UniNa or alternatively contact the authors at {__mail__}.')
1220
- return
1221
-
1222
1174
  import webbrowser
1223
1175
  def downloadExampleData(self,url):
1224
1176
  Message=f'Test data are available at the following link:\n{url}'
@@ -1354,7 +1306,7 @@ def checkRequiredPackages(self, filename=rqrdpckgs_filename, FlagDisplay=False,
1354
1306
  else:
1355
1307
  pri.Error.red(f"Malformed line: {line}")
1356
1308
 
1357
- Flag = False
1309
+ FlagUpdateFile = False
1358
1310
  warnings = []
1359
1311
 
1360
1312
  for i, pkg in enumerate(required_packages):
@@ -1364,9 +1316,10 @@ def checkRequiredPackages(self, filename=rqrdpckgs_filename, FlagDisplay=False,
1364
1316
  installed_version = None
1365
1317
 
1366
1318
  # Update current installed version
1367
- if installed_version is not None and (installed_version != vcurr_list[i] or FlagDisplay):
1368
- vcurr_list[i] = installed_version
1369
- Flag = True
1319
+ if installed_version is not None:
1320
+ if installed_version != vcurr_list[i]:
1321
+ vcurr_list[i] = installed_version
1322
+ FlagUpdateFile = True
1370
1323
 
1371
1324
  # Check if within [vmin, vmax]
1372
1325
  if not (le_ver(vmin_list[i],installed_version) and le_ver(installed_version,vmax_list[i])):
@@ -1381,7 +1334,7 @@ def checkRequiredPackages(self, filename=rqrdpckgs_filename, FlagDisplay=False,
1381
1334
 
1382
1335
  # Show warning
1383
1336
  if len(warnings)>0: self.FlagPackIssue=True
1384
- if len(warnings)>0 or FlagForcePrint:
1337
+ if ( (FlagUpdateFile or FlagDisplay) and len(warnings)>0 ) or FlagForcePrint :
1385
1338
  message = (
1386
1339
  "Some installed packages have a version outside the target range used to develop "
1387
1340
  "the current release of the PaIRS_UniNa package.\n\n"
@@ -1413,7 +1366,7 @@ def checkRequiredPackages(self, filename=rqrdpckgs_filename, FlagDisplay=False,
1413
1366
  warningDialog(self, Message="All installed packages are within the expected version range.", flagScreenCenter=True,pixmap=icons_path+'greenv.png')
1414
1367
 
1415
1368
  # Update file if needed
1416
- if Flag:
1369
+ if FlagUpdateFile:
1417
1370
  with open(filename, "w") as f:
1418
1371
  for pkg, vmin, vmax, vcurr in zip(required_packages, vmin_list, vmax_list, vcurr_list):
1419
1372
  f.write(f"{pkg}\t{vmin}\t{vmax}\t{vcurr if vcurr else 0}\n")
@@ -735,13 +735,12 @@ class Process_Tab(gPaIRS_Tab):
735
735
  message="Please, insert at least one element!"
736
736
  else:
737
737
  message="Items must be inserted in decreasing order!"
738
- wlab.setToolTip(message)
739
- wlab.setStatusTip(message)
740
- """
741
- QToolTip.showText(QCursor.pos(),wlab.toolTip(),wedit,QRect(),3000)
742
- """
743
738
  else:
744
739
  wlab.setPixmap(QPixmap())
740
+ message=""
741
+ show_mouse_tooltip(wedit,message)
742
+ wlab.setToolTip(message)
743
+ wlab.setStatusTip(message)
745
744
  self.PROpar.VectFlag[self.Vect_widgets.index(wedit)]=not FlagError
746
745
  return split_text, vect, FlagError
747
746
 
@@ -1292,18 +1291,25 @@ class Process_Tab(gPaIRS_Tab):
1292
1291
  def line_edit_IW_action(self):
1293
1292
  text=self.ui.line_edit_IW.text()
1294
1293
  split_text=re.split(r'(\d+)', text)[1:-1:2]
1295
- vect=[int(split_text[i]) for i in (0,2,1,3)]
1296
- if len(vect)==4:
1294
+ if len(split_text)!=4:
1295
+ message="Please insert four distinct values to edit the current PIV process iteration!"
1296
+ show_mouse_tooltip(self,message)
1297
+ self.line_edit_IW_set()
1298
+ else:
1299
+ vect=[int(split_text[i]) for i in (0,2,1,3)]
1297
1300
  k=self.PROpar.row
1298
1301
  FlagValid=True
1299
1302
  if k>0: FlagValid=FlagValid and all([vect[i]<=self.PROpar.Vect[i][k-1] for i in range(4)])
1300
1303
  if k<self.PROpar.Nit-1 and FlagValid: FlagValid=FlagValid and all([vect[i]>=self.PROpar.Vect[i][k+1] for i in range(4)])
1301
1304
  if FlagValid:
1305
+ message=""
1306
+ show_mouse_tooltip(self,message)
1302
1307
  for i in range(4):
1303
1308
  self.PROpar.Vect[i][k]=vect[i] #np.array([vect[i]])
1304
1309
  else:
1305
- message='IW sizes o r spacings were assigned inconsistently! Please, retry!'
1306
- showTip(self,message)
1310
+ message='IW sizes or spacings were assigned inconsistently! They must be inserted in decreasing order across iterations. Please, retry!'
1311
+ show_mouse_tooltip(self,message)
1312
+ self.line_edit_IW_set()
1307
1313
  self.PROpar.flag_rect_wind=any([v!=w for v,w in zip(self.PROpar.Vect[0],self.PROpar.Vect[2])]) or any([v!=w for v,w in zip(self.PROpar.Vect[1],self.PROpar.Vect[3])])
1308
1314
  return
1309
1315
 
@@ -1329,6 +1335,7 @@ class Process_Tab(gPaIRS_Tab):
1329
1335
  item=table_iter.currentItem()
1330
1336
  if not item: return
1331
1337
  menu=QMenu(table_iter)
1338
+ menu.setStyleSheet(self.gui.ui.menu.styleSheet())
1332
1339
  buttons=['add', 'delete']
1333
1340
  name=[]
1334
1341
  tips=['Add new iteration to the PIV process','Delete current iteration from the PIV process']
@@ -1361,10 +1368,7 @@ class Process_Tab(gPaIRS_Tab):
1361
1368
  item.setStatusTip('')
1362
1369
 
1363
1370
  message='No context menu available! Please, pause processing.'
1364
- toolTipDuration=self.toolTipDuration()
1365
- self.setToolTipDuration(3000)
1366
- QToolTip.showText(QCursor.pos(),message)
1367
- self.setToolTipDuration(toolTipDuration)
1371
+ show_mouse_tooltip(self,message)
1368
1372
  item.setToolTip(toolTip)
1369
1373
  item.setStatusTip(toolTip)
1370
1374
 
@@ -1688,13 +1692,13 @@ class Process_Tab(gPaIRS_Tab):
1688
1692
  FlagStable=FlagStable and not flagUnstable
1689
1693
  if k==self.PROpar.Nit-1:
1690
1694
  if j==0:
1691
- if self.father and hasattr(self.father,'w_Export'): Res=self.father.w_Export.OUTpar.xres
1695
+ if self.father and hasattr(self.father,'w_Output'): Res=self.father.w_Output.OUTpar.xres
1692
1696
  else: Res=0
1693
1697
  self.MTF=[lam,MTF.T,f'IW size-spacing: {Wa:d}-{Wc:d}. Vel.-correl. windowing: {VelWin}-{CorrWin}.',Res]
1694
1698
 
1695
1699
  else:
1696
1700
  if self.PROpar.Vect[j*2][kVect]>self.PROpar.Vect[(j-1)*2][kVect]:
1697
- if self.father: Res=self.father.w_Export.OUTpar.xres*self.father.w_Export.OUTpar.pixAR
1701
+ if self.father: Res=self.father.w_Output.OUTpar.xres*self.father.w_Output.OUTpar.pixAR
1698
1702
  else: Res=0
1699
1703
  self.MTF=[lam,MTF.T,f'IW size-spacing: {Wa:d}-{Wc:d}. Vel.-correl. windowing: {VelWin}-{CorrWin}.',Res]
1700
1704
  if FlagStable:
@@ -134,15 +134,22 @@ class Process_Tab_Disp(gPaIRS_Tab):
134
134
  def line_edit_IW_action(self):
135
135
  text=self.ui.line_edit_IW.text()
136
136
  split_text=re.split(r'(\d+)', text)[1:-1:2]
137
+ if len(split_text)==0:
138
+ message="Please insert at least one value!"
139
+ show_mouse_tooltip(self,message)
140
+ self.line_edit_IW_set()
141
+ return
137
142
  split_num=[int(t) for t in split_text]
138
143
  if len(split_num)<4: split_num+=[split_num[-1]]*(4-len(split_num))
139
144
  vect=[int(split_num[i]) for i in (0,2,1,3)]
140
145
  FlagValid=len(vect)==4 and all([v>0 for v in vect])
141
146
  if FlagValid:
142
147
  self.PROpar.Vect=vect
148
+ message=""
143
149
  else:
144
150
  message='IW sizes or spacings were assigned inconsistently! Please, retry!'
145
- showTip(self,message)
151
+ show_mouse_tooltip(self,message)
152
+ self.line_edit_IW_set()
146
153
  return
147
154
 
148
155
  #******************** Settings
@@ -64,6 +64,8 @@ class GPApar(TABpar):
64
64
 
65
65
  self.printTypes = printTypes
66
66
  self.NumCores = 0
67
+ self.globalVals = {}
68
+ self.globalExceptions = {'Calibration': ['FlagSPIVCal']}
67
69
 
68
70
  self.stateFields=[f for f,_ in self.__dict__.items() if f not in self.infoFields]
69
71
 
PaIRS_UniNa/TabTools.py CHANGED
@@ -706,16 +706,130 @@ class gPaIRS_Tab(QWidget):
706
706
  lab.setFont(font)
707
707
 
708
708
  def setTABWarnLabel(self):
709
- self.ui.name_tab.setFixedWidth(self.ui.name_tab.sizeHint().width())
710
- self.ui.label_done.setPixmap(self.pixmap_done if self.TABpar.OptionDone==1 else self.pixmap_warnc)
711
- self.ui.label_done.setToolTip(self.TABpar.warningMessage)
712
-
709
+ if hasattr(self.ui,'label_done'):
710
+ self.ui.name_tab.setFixedWidth(self.ui.name_tab.sizeHint().width())
711
+ self.ui.label_done.setPixmap(self.pixmap_done if self.TABpar.OptionDone==1 else self.pixmap_warnc)
712
+ self.ui.label_done.setToolTip(self.TABpar.warningMessage)
713
+
714
+ def syncPrevGlobalFields(self, ref_vals=None, include_bases=False, exceptions=[], FlagSync=True):
715
+ """
716
+ Sync class-level fields (declared in class bodies, e.g. PROpar.mode = mode_init)
717
+ across all TABpar-like instances inside self.TABpar_prev (nested lists / None / TABpar).
718
+
719
+ Parameters
720
+ ----------
721
+ ref : object | None
722
+ Reference TABpar instance whose values will be copied (default: self.TABpar).
723
+ include_bases : bool
724
+ If True, include class-level fields declared in base classes too.
725
+ If False, include ONLY fields declared in the concrete class (e.g., PROpar only).
726
+ """
727
+
728
+ ref = getattr(self, "TABpar", None)
729
+ if ref is None:
730
+ return []
731
+ ref_cls = type(ref)
732
+
733
+ # Decide which class we consider as "TABpar-like"
734
+ # If your tabs store subclasses of a known ParClass, use that; otherwise fallback to TABpar.
735
+ par_base = getattr(self, "ParClass", None)
736
+ if par_base is None:
737
+ par_base = TABpar # assumes TABpar is in scope in TabTools.py
738
+
739
+ # Reference object
740
+ if ref_vals is None:
741
+
742
+ # Collect class-level fields declared in class bodies
743
+ def _class_fields(cls):
744
+ if include_bases:
745
+ classes = [C for C in cls.mro() if C not in (object,)]
746
+ else:
747
+ classes = [cls]
748
+
749
+ out = []
750
+ for C in classes:
751
+ for name, val in C.__dict__.items():
752
+ if name.startswith("__"):
753
+ continue
754
+ # Skip methods / descriptors
755
+ if callable(val) or isinstance(val, (staticmethod, classmethod, property)):
756
+ continue
757
+ out.append(name)
758
+
759
+ # Unique preserving order
760
+ seen = set()
761
+ fields = []
762
+ for n in out:
763
+ if n not in seen:
764
+ seen.add(n)
765
+ fields.append(n)
766
+ return fields
767
+
768
+ fields = _class_fields(ref_cls)
769
+
770
+ # Build reference values (prefer instance override, otherwise class default)
771
+ ref_vals = {}
772
+ #pri.Info.green(f'{self.TABname}:')
773
+ for f in fields:
774
+ try:
775
+ ref_vals[f] = getattr(ref, f)
776
+ #pri.Info.green(f'{f} = {ref_vals[f]}')
777
+ except Exception:
778
+ pass
779
+ #pri.Info.green('\n')
780
+
781
+ if not FlagSync: return ref_vals
782
+
783
+ # Exclude exception fields (if any)
784
+ if exceptions:
785
+ exc = set(exceptions)
786
+ ref_vals = {k: v for k, v in ref_vals.items() if k not in exc}
787
+
788
+ # Walk nested structure and patch instances
789
+ def _walk(node, ParBase=par_base): # <-- bind ParBase safely here
790
+ if node is None:
791
+ return
792
+ if isinstance(node, ParBase):
793
+ for f, v in ref_vals.items():
794
+ try:
795
+ setattr(node, f, v)
796
+ except Exception:
797
+ pass
798
+ return
799
+ if isinstance(node, (list, tuple)):
800
+ for it in node:
801
+ _walk(it, ParBase)
802
+ return
803
+ if isinstance(node, dict):
804
+ for it in node.values():
805
+ _walk(it, ParBase)
806
+ return
807
+
808
+ _walk(getattr(self, "TABpar_prev", None))
809
+
810
+ # Set class-level (global) fields ONCE
811
+ for C in (ref_cls, self.TABpar, self.TABpar_old):
812
+ if C is None:
813
+ continue
814
+ for f, v in ref_vals.items():
815
+ try:
816
+ setattr(C, f, v)
817
+ except Exception:
818
+ pass
819
+ return ref_vals
820
+
713
821
  #*************************************************** Undo/redo
714
822
  def adjustTABparInd(self):
715
823
  TABpar_ind=self.TABpar_at(self.TABpar.ind)
716
824
  if TABpar_ind:
717
825
  TABpar_ind.copyfrom(self.TABpar)
718
826
 
827
+ def adjustFromTABparInd(self,ind=None):
828
+ if ind is None: ind=self.TABpar.ind
829
+ TABpar_ind=self.TABpar_at(ind)
830
+ if TABpar_ind:
831
+ self.TABpar.copyfrom(TABpar_ind)
832
+
719
833
  def gen_TABpar(self,ind,FlagSet=True,FlagEmptyPrev=False,FlagNone=False,FlagInsert=-1,Process=None,Step=None):
720
834
  Prev=prev=self.TABpar_prev if FlagSet else []
721
835
 
@@ -956,6 +1070,7 @@ class gPaIRS_Tab(QWidget):
956
1070
  d=0
957
1071
 
958
1072
  menu=QMenu(b)
1073
+ menu.setStyleSheet(self.gui.ui.menu.styleSheet())
959
1074
  act=[]
960
1075
  nur=len(krange)
961
1076
  flag=nur==Num_Prevs_back_forw
@@ -989,7 +1104,6 @@ class gPaIRS_Tab(QWidget):
989
1104
  if self.TABpar.ind[:-1]==ind[:-1]:
990
1105
  self.TABpar.ind[-1]=0
991
1106
 
992
-
993
1107
  #*************************************************** Special spin boxes (x,y,w,h)
994
1108
  def setMinMaxSpinxywh(self):
995
1109
  self.ui.spin_x.setMinimum(0)
@@ -1062,7 +1176,10 @@ def setupWid(self:gPaIRS_Tab,FlagFontSize=True):
1062
1176
 
1063
1177
  if hasattr(self,'widgets'): widgets=self.widgets
1064
1178
  else: widgets=self.findChildren(QWidget)
1179
+ if isinstance(widgets[0],list):
1180
+ widgets=[w for wi in widgets for w in wi]
1065
1181
  widgets+=self.findChildren(CollapsibleBox)
1182
+ widgets+=self.findChildren(QTextEdit)
1066
1183
  for w in widgets:
1067
1184
  w:QToolButton
1068
1185
  if hasattr(w,'toolTip'):
@@ -1082,9 +1199,51 @@ def setupWid(self:gPaIRS_Tab,FlagFontSize=True):
1082
1199
  if hasattr(w,'setup2'):
1083
1200
  w.setup2()
1084
1201
 
1085
- if isinstance(w,QToolButton) or isinstance(w,QPushButton):
1202
+ if isinstance(w,QToolButton) or isinstance(w,QPushButton) or isinstance(w,QCheckBox) or isinstance(w,QRadioButton) or isinstance(w,QComboBox):
1086
1203
  if w.cursor().shape()==Qt.CursorShape.ArrowCursor:
1087
1204
  w.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))
1205
+ if isinstance(w,QToolButton) or isinstance(w,QPushButton):
1206
+ if not w.icon().isNull():
1207
+ size = w.iconSize()
1208
+ new_size = QSize(
1209
+ max(1, size.width() ),
1210
+ max(1, size.height() )
1211
+ )
1212
+ w.setIconSize(new_size)
1213
+ if (isinstance(w,QToolButton) or isinstance(w,QPushButton) or isinstance(w,ClickableLabel) or w.objectName()=='logo') and w.metaObject().className() not in ('DraggableButton','RichTextPushButton') and w.objectName() not in ('binButton','CollapsibleBox_toggle','StartingPage_Button'):
1214
+ if w.objectName() in ('logo','title_icon','workspace_icon'):
1215
+ apply_hover_glow_label(w)
1216
+ w.default_stylesheet=w.styleSheet()
1217
+ else:
1218
+ setButtonHoverStyle(w)
1219
+ if w.metaObject().className() == "RichTextPushButton":
1220
+ w.icnWidget.setAttribute(Qt.WA_Hover, True)
1221
+ w.icnWidget.setMouseTracking(True)
1222
+ setButtonHoverStyle(w,FlagCls=False)
1223
+ setButtonHoverStyle(w.icnWidget,FlagCls=False,FlagBorder=False)
1224
+ if isinstance(w,QCheckBox) or isinstance(w,QRadioButton):
1225
+ style=f"{w.metaObject().className()}{'::hover{ background-color: rgba(0, 116, 255, 0.1); border-radius: 6px;}'}"
1226
+ w.setStyleSheet(style)
1227
+ if isinstance(w,QSlider):
1228
+ w.setMouseTracking(True)
1229
+ cursor_filter = SliderHandleCursorFilter(w)
1230
+ w.installEventFilter(cursor_filter)
1231
+ if w.objectName()=='log' and hasattr(self,'gui'):
1232
+ base="""
1233
+ QTextEdit {
1234
+ background-color: #000000;
1235
+ color: #FFFFFF;
1236
+ border: 1px solid #2a2a2a;
1237
+ border-radius: 6px;
1238
+
1239
+ padding: 2px;
1240
+
1241
+ selection-background-color: rgba(0, 116, 255, 0.8);
1242
+ selection-color: #FFFFFF;
1243
+ }
1244
+ """
1245
+ w.setStyleSheet(base + "\n" + gPaIRS_QMenu_style)
1246
+
1088
1247
 
1089
1248
  for sname in ('range_from','range_to','x','y','w','h'):
1090
1249
  if hasattr(self.ui,"spin_"+sname):
PaIRS_UniNa/Vis_Tab.py CHANGED
@@ -443,6 +443,7 @@ class Vis_Tab(gPaIRS_Tab):
443
443
  pri.Time.magenta('Colormap generation: start')
444
444
  # Create the popup menu
445
445
  self.colorMapMenu = QMenu(self)
446
+ self.colorMapMenu.setStyleSheet(self.gui.ui.menu.styleSheet())
446
447
  # Add the colormap thumbnails to the menu
447
448
  def on_colormap_selected(name):
448
449
  self.VISpar.vcolorMap[self.VISpar.variableKey]=self.VISpar.colorMap=name
@@ -463,6 +464,7 @@ class Vis_Tab(gPaIRS_Tab):
463
464
  pri.Time.magenta('Vector color generation: start')
464
465
  # Create the popup menu
465
466
  self.vectorColorMenu = QMenu(self)
467
+ self.vectorColorMenu.setStyleSheet(self.gui.ui.menu.styleSheet())
466
468
  # Add the colormap thumbnails to the menu
467
469
  def on_vectorcolor_selected(name):
468
470
  self.VISpar.vvectorColor[self.VISpar.variableKey]=self.VISpar.vectorColor=name
@@ -477,7 +479,9 @@ class Vis_Tab(gPaIRS_Tab):
477
479
  action = menu.addAction(QIcon(pixmap), ' '+colorName.lower())
478
480
  action.triggered.connect(lambda _, name=colorName: on_vectorcolor_selected(name))
479
481
  pri.Time.magenta('Vector color generation: end')
480
-
482
+
483
+ apply_hover_glow_label(self.ui.icon)
484
+
481
485
  #------------------------------------- Declaration of parameters
482
486
  self.VISpar_base=VISpar()
483
487
  self.VISpar:VISpar=self.TABpar
@@ -505,14 +509,15 @@ class Vis_Tab(gPaIRS_Tab):
505
509
 
506
510
  slider.valueChanged.connect(callback)
507
511
 
512
+ """
508
513
  if n in ('nclev','streamdens'):
509
514
  def sliderMessage(s:QSlider):
510
515
  if self.VISpar.field_rep==2:
511
516
  tip = f"Release to repaint"
512
- else: tip=""
513
- QToolTip.showText(s.mapToGlobal(s.rect().topLeft()), tip)
517
+ show_mouse_tooltip(s,tip)
514
518
  slider.sliderPressed.connect(lambda: sliderMessage(slider))
515
-
519
+ """
520
+
516
521
  setattr(self,'slider_'+n+'_callbcak',callback)
517
522
  setattr(self,'spin_'+n+'_action',action)
518
523
  setattr(self,'spin_'+n+'_set',setting)
@@ -1347,6 +1352,7 @@ class Vis_Tab(gPaIRS_Tab):
1347
1352
 
1348
1353
  # Create a context menu and populate it with the available sizes
1349
1354
  menu = QMenu(self)
1355
+ menu.setStyleSheet(self.gui.ui.menu.styleSheet())
1350
1356
  for i in range(n):
1351
1357
  label = f"{Vect[2][i]} x {Vect[0][i]}"
1352
1358
  act = menu.addAction(label)
@@ -2024,6 +2030,7 @@ class Vis_Tab(gPaIRS_Tab):
2024
2030
  #*************************************************** Menus
2025
2031
  def contextMenuEvent(self, event):
2026
2032
  contextMenu = QMenu(self)
2033
+ contextMenu.setStyleSheet(self.gui.ui.menu.styleSheet())
2027
2034
  copy2clipboard = contextMenu.addAction("Copy to clipboard ("+self.QS_copy2clipboard.key().toString(QKeySequence.NativeText)+")")
2028
2035
  copy2clipboard.setIcon(self.ui.plot.copyIcon)
2029
2036
  copy2newfig = contextMenu.addAction("Open in new figure ("+self.QS_copy2newfig.key().toString(QKeySequence.NativeText)+")")
@@ -385,6 +385,7 @@ class Vis_Tab_CalVi(gPaIRS_Tab):
385
385
  self.ui.w_Commands.setVisible(self.VISpar.FlagRunning)
386
386
  if self.VISpar.FlagRunning:
387
387
  self.calibView.contextMenu = QtWidgets.QMenu(self)
388
+ self.calibView.contextMenu.setStyleSheet(self.gui.ui.menu.styleSheet())
388
389
  for a in self.calibView.contextMenuActions:
389
390
  self.calibView.contextMenu.addAction(a)
390
391
  self.calibView.contextMenu.insertSeparator(self.calibView.contextMenuActions[1])
@@ -968,8 +969,6 @@ class Vis_Tab_CalVi(gPaIRS_Tab):
968
969
  FlagVisible=all([not bool(p) for p in calVect.flagPlane[:-1]])
969
970
  self.gui.ui.button_Run_CalVi.setVisible(FlagVisible)
970
971
 
971
-
972
-
973
972
 
974
973
  if __name__ == "__main__":
975
974
  import sys
Binary file
PaIRS_UniNa/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
- __version__="0.2.9"
1
+ __version__="0.2.10"
2
2
  __subversion__="0"
3
- __year__='2025'
4
- __date__='2025.12.12'
3
+ __year__='2026'
4
+ __date__='2026.01.05'
5
5
  __mail__='etfd@unina.it'
6
6
  __website__='https://pairs.unina.it'