@@ -481,6 +481,38 @@ def init_widgets(self):
481481 if self .w .stackedWidget_mainTab .count () == 11 :
482482 self .w .btn_user .hide ()
483483
484+ # see if a popup window panels is required
485+ self .Btn = None
486+ if not INFO .ZIPPED_TABS is None :
487+ for name , loc , cmd in INFO .ZIPPED_TABS :
488+ if loc == 'WINDOW' :
489+
490+ # add panel to a dialog window
491+ self .w ['popup' ] = d = QtWidgets .QDialog (self .w )
492+ temp = self .w [name .replace (' ' ,'_' )]
493+ # set to apropriate size for panel
494+ d .setMinimumSize (600 ,400 )
495+ d .setWindowTitle (name )
496+ d .setWindowFlags (d .windowFlags () | QtCore .Qt .WindowStaysOnTopHint )
497+ d .finished .connect (self .onClosePopup )
498+ d ._lastgeometry = None
499+
500+ layout = QtWidgets .QGridLayout (d )
501+ layout .setContentsMargins (0 ,0 ,0 ,0 )
502+ layout .addWidget (temp , 0 , 0 )
503+
504+ # add launch button to screen
505+ self .btn = QtWidgets .QPushButton (self .w )
506+ self .btn .setEnabled (True )
507+ self .btn .setMinimumSize (64 , 40 )
508+ self .btn .setIconSize (QtCore .QSize (38 , 38 ))
509+ self .btn .setIcon (QtGui .QIcon (':/qt-project.org/styles/commonstyle/images/up-32.png' ))
510+ self .btn .clicked .connect (self .togglePopup )
511+ self .w .layout_buttonbar .insertWidget (len (self .w .layout_buttonbar ) - 4 , self .btn )
512+
513+ # only one allowed
514+ break
515+
484516 def init_probe (self ):
485517 probe = INFO .get_error_safe_setting ('PROBE' , 'USE_PROBE' , 'none' ).lower ()
486518 if probe == 'versaprobe' :
@@ -2149,6 +2181,20 @@ def midiAction(self, button, num):
21492181 button .pressed .emit ()
21502182 button .setProperty ('ini_mdi_command_action' , False )
21512183
2184+ # show/hide a popup window panel (if defined in the INI)
2185+ def togglePopup (self ):
2186+ if self .w ['popup' ].isVisible ():
2187+ self .w ['popup' ]._lastgeometry = self .w ['popup' ].geometry ()
2188+ self .w ['popup' ].hide ()
2189+ else :
2190+ self .w ['popup' ].show ()
2191+ if not self .w ['popup' ]._lastgeometry is None :
2192+ self .w ['popup' ].setGeometry (self .w ['popup' ]._lastgeometry )
2193+
2194+
2195+ def onClosePopup (self , * args ):
2196+ self .w ['popup' ]._lastgeometry = self .w ['popup' ].geometry ()
2197+
21522198 #####################
21532199 # KEY BINDING CALLS #
21542200 #####################
0 commit comments