@@ -366,14 +366,14 @@ def configure_manager(
366366
367367
368368def set_widget_title_icon (
369- widget : QWidget , title : str , icon : QG .QIcon , resize : tuple [int , int ] | None = None
369+ widget : QWidget , title : str , icon : QG .QIcon , size : tuple [int , int ] | None = None
370370) -> None :
371371 """Setups the widget title and icon
372372
373373 Args:
374374 title: The window title
375375 icon: The window icon
376- resize : The window size (width, height). Defaults to None (no resize)
376+ size : The window size (width, height). Defaults to None (no resize)
377377 """
378378 win32_fix_title_bar_background (widget )
379379 widget .setWindowTitle (title )
@@ -382,8 +382,8 @@ def set_widget_title_icon(
382382 if icon is not None :
383383 widget .setWindowIcon (icon )
384384 widget .setMinimumSize (320 , 240 )
385- if resize is not None :
386- widget .resize (* resize )
385+ if size is not None :
386+ widget .resize (* size )
387387
388388
389389def add_widget_to_grid_layout (
@@ -535,6 +535,7 @@ class PlotDialog(QW.QDialog, AbstractPlotDialogWindow, metaclass=PlotDialogMeta)
535535 title: The window title
536536 icon: The window icon
537537 edit: If True, the plot is editable
538+ size: The window size (width, height). Defaults to None (no resize)
538539 """
539540
540541 def __init__ (
@@ -547,9 +548,10 @@ def __init__(
547548 title : str = "PlotPy" ,
548549 icon : str = "plotpy.svg" ,
549550 edit : bool = False ,
551+ size : tuple [int , int ] | None = None ,
550552 ) -> None :
551553 super ().__init__ (parent )
552- set_widget_title_icon (self , title , icon , resize = ( 640 , 480 ) )
554+ set_widget_title_icon (self , title , icon , size )
553555 self .edit = edit
554556 self .button_box = None
555557 self .button_layout = None
@@ -692,6 +694,7 @@ class PlotWindow(QW.QMainWindow, AbstractPlotDialogWindow, metaclass=PlotWindowM
692694 If False, the user must register the tools manually.
693695 title: The window title
694696 icon: The window icon
697+ size: The window size (width, height). Defaults to None (no resize)
695698 """
696699
697700 def __init__ (
@@ -703,9 +706,10 @@ def __init__(
703706 auto_tools : bool = True ,
704707 title : str = "PlotPy" ,
705708 icon : str = "plotpy.svg" ,
709+ size : tuple [int , int ] | None = None ,
706710 ) -> None :
707711 super ().__init__ (parent )
708- set_widget_title_icon (self , title , icon , resize = ( 640 , 480 ) )
712+ set_widget_title_icon (self , title , icon , size )
709713 self .plot_layout = QW .QGridLayout ()
710714 self .plot_widget : PlotWidget = None
711715 self .manager : PlotManager = None
@@ -897,6 +901,7 @@ class SyncPlotWindow(QW.QMainWindow):
897901 If False, the user must register the tools manually.
898902 title: The window title
899903 icon: The window icon
904+ size: The window size (width, height). Defaults to None (no resize)
900905
901906 Usage: first, create a window, then add plots to it, then call the
902907 :py:meth:`.SyncPlotWindow.finalize_configuration` method to add panels and
@@ -920,9 +925,10 @@ def __init__(
920925 auto_tools : bool = True ,
921926 title : str = "PlotPy" ,
922927 icon : str = "plotpy.svg" ,
928+ size : tuple [int , int ] | None = None ,
923929 ) -> None :
924930 super ().__init__ (parent )
925- set_widget_title_icon (self , title , icon )
931+ set_widget_title_icon (self , title , icon , size )
926932 self .manager = PlotManager (None )
927933 self .manager .set_main (self )
928934 self .subplotwidget = SubplotWidget (self .manager , parent = self , options = options )
0 commit comments