@@ -237,7 +237,7 @@ def __init__(self, parent=None):
237237 self .export_plot : Optional [ExportPlot ] = None
238238 self .export_table : Optional [ExportTable ] = None
239239
240- self .scenario_box = QtWidgets . QComboBox ()
240+ self .scenario_box = SmallComboBox ()
241241 self .pt_layout = QtWidgets .QVBoxLayout ()
242242 self .layout = QtWidgets .QVBoxLayout ()
243243 self .setLayout (self .layout )
@@ -903,6 +903,16 @@ def update_plot(self):
903903 def update_table (self ):
904904 super ().update_table (self .df )
905905
906+ class SmallComboBox (QtWidgets .QComboBox ):
907+ """A small combo box that does not expand to fill the available space."""
908+
909+ def __init__ (self , parent = None ):
910+ super ().__init__ (parent )
911+ self .setSizePolicy (QtWidgets .QSizePolicy .Fixed , QtWidgets .QSizePolicy .Fixed )
912+ self .setMinimumWidth (100 )
913+ self .setMaximumWidth (200 )
914+ self .setSizeAdjustPolicy (QtWidgets .QComboBox .AdjustToContentsOnFirstShow )
915+
906916
907917class ContributionTab (NewAnalysisTab ):
908918 """Parent class for any 'XXX Contributions' sub-tab."""
@@ -913,9 +923,9 @@ def __init__(self, parent, **kwargs):
913923 self .combobox_menu = Combobox (
914924 func = QtWidgets .QComboBox (self ),
915925 func_label = QtWidgets .QLabel ("Reference Flow:" ),
916- method = QtWidgets . QComboBox (self ),
926+ method = SmallComboBox (self ),
917927 method_label = QtWidgets .QLabel ("Impact Category:" ),
918- agg = QtWidgets . QComboBox (self ),
928+ agg = SmallComboBox (self ),
919929 agg_label = QtWidgets .QLabel ("Aggregate by:" ),
920930 scenario = self .scenario_box ,
921931 scenario_label = QtWidgets .QLabel ("Scenario:" ),
0 commit comments