@@ -418,14 +418,14 @@ def create_control_panel(self):
418418 port_combo_qbox = QHBoxLayout ()
419419 # create and add port label
420420 label = QLabel ("Port:" )
421- movable_widget (port_combo_qbox , label , [50 ,0 ,0 ,0 ], Qt .AlignmentFlag .AlignRight , Qt . AlignmentFlag . AlignCenter )
421+ movable_widget (port_combo_qbox , label , [50 ,0 ,0 ,0 ], Qt .AlignmentFlag .AlignRight )
422422 # create and add port combobox
423423 self .port_combo = QComboBox ()
424- movable_widget (port_combo_qbox , self .port_combo , [0 ,0 ,0 ,0 ], Qt .AlignmentFlag .AlignLeft , Qt . AlignmentFlag . AlignCenter )
424+ movable_widget (port_combo_qbox , self .port_combo , [0 ,0 ,0 ,0 ], Qt .AlignmentFlag .AlignLeft )
425425 # create and add refresh button
426426 button = QPushButton ("Refresh" )
427427 button .clicked .connect (self .populate_serial_ports )
428- movable_widget (port_combo_qbox , button , [0 ,0 ,0 ,3 ], Qt .AlignmentFlag .AlignLeft , Qt . AlignmentFlag . AlignCenter )
428+ movable_widget (port_combo_qbox , button , [0 ,0 ,0 ,2 ], Qt .AlignmentFlag .AlignLeft )
429429 # set spacing between all widgets in port layout
430430 port_combo_qbox .setSpacing (0 )
431431 # add the port layout to the control row
@@ -439,12 +439,12 @@ def create_control_panel(self):
439439 baud_combo_qbox = QHBoxLayout ()
440440 # create the baud label and add it to the port horizontal layout
441441 baud_label = QLabel ("Baud:" )
442- movable_widget (baud_combo_qbox , baud_label , [0 ,0 ,0 ,0 ], Qt .AlignmentFlag .AlignRight , Qt . AlignmentFlag . AlignCenter )
442+ movable_widget (baud_combo_qbox , baud_label , [8 ,0 ,0 ,0 ], Qt .AlignmentFlag .AlignRight )
443443 # create the combobox
444444 self .baud_combo = QComboBox ()
445445 self .baud_combo .addItems (["9600" , "19200" , "38400" , "57600" , "115200" ])
446446 self .baud_combo .setCurrentText ("115200" )
447- movable_widget (baud_combo_qbox , self .baud_combo , [0 ,0 ,0 ,0 ], Qt .AlignmentFlag .AlignLeft , Qt . AlignmentFlag . AlignCenter )
447+ movable_widget (baud_combo_qbox , self .baud_combo , [0 ,0 ,0 ,0 ], Qt .AlignmentFlag .AlignLeft )
448448 # set the spacing of all items in the port horizontal layout to 0 so they are all clos
449449 baud_combo_qbox .setSpacing (0 )
450450 # finally, add the port horizontal layout to the control row horizontal layout
@@ -459,40 +459,58 @@ def create_control_panel(self):
459459 # create the connect button and add it to the connection horizontal layout
460460 self .connect_button = QPushButton ("Connect" )
461461 self .connect_button .clicked .connect (self .toggle_connection )
462- conn_combo_qbox . addWidget ( self .connect_button )
462+ movable_widget ( conn_combo_qbox , self .connect_button , [ 0 , 0 , 0 , 2.5 ], Qt . AlignmentFlag . AlignRight )
463463 # create the baud label and add it to the port horizontal layout
464- conn_combo_qbox .addWidget (QLabel ("Not connected" ),alignment = Qt .AlignmentFlag .AlignRight )
465- # set the spacing of all items in the port horizontal layout to 0 so they are all clos
464+ self .status_label = QLabel ("Not connected" )
465+ movable_widget (conn_combo_qbox , self .status_label , [10 ,0 ,0 ,0 ], Qt .AlignmentFlag .AlignLeft )
466+ # set the spacing of all items in the port horizontal layout to 0 so they are all close
466467 conn_combo_qbox .setSpacing (0 )
467468 # finally, add the port horizontal layout to the control row horizontal layout
468469 control_row .addLayout (conn_combo_qbox )
469470
470471 #
471472 control_row .setSpacing (0 )
472473
473- #
474- self .main_layout .setSpacing (0 )
475-
476474 #
477475 self .main_layout .addLayout (control_row )
478476
479477 def create_command_panel (self ):
480478 cmd_row = QHBoxLayout ()
481479
482- cmd_row .addWidget (QLabel ("Command:" ))
480+ ###
481+ # create a horizontal layout that will hold the command label and command combobox
482+ cmd_combo_qbox = QHBoxLayout ()
483+ # create the command label and add it to the command horizontal layout
484+ cmd_label = QLabel ("Command:" )
485+ movable_widget (cmd_combo_qbox , cmd_label , [20 ,0 ,0 ,0 ], Qt .AlignmentFlag .AlignRight )
486+ # create the command combobox and add it to the command horizontal layout
483487 self .command_input = QComboBox ()
484488 self .command_input .setEditable (True )
485489 self .command_input .addItems (default_quick_commands )
486490 self .command_input .setCurrentIndex (- 1 )
487491 self .command_input .lineEdit ().returnPressed .connect (self .send_serial_command )
488492 self .command_input .setFont (self .mono_font )
489- cmd_row .addWidget (self .command_input )
493+ self .command_input .setMinimumWidth (800 )
494+ movable_widget (cmd_combo_qbox , self .command_input , [0 ,0 ,0 ,0 ], Qt .AlignmentFlag .AlignLeft )
495+ # set the spacing of all items in the command horizontal layout to 0 so they are all close
496+ cmd_combo_qbox .setSpacing (0 )
497+ # finally, add the command horizontal layout to the command row horizontal layout
498+ cmd_row .addLayout (cmd_combo_qbox )
490499
500+ # add some spacing between the command layout and the send button
501+ #cmd_row.addSpacing(20)
491502
503+ ###
504+ # create a send button and add it directly to the command row horizontal layout
492505 self .send_button = QPushButton ("Send" )
493506 self .send_button .clicked .connect (self .send_serial_command )
494- cmd_row .addWidget (self .send_button )
507+ #self.send_button.setMaximumWidth(100)
508+ movable_widget (cmd_row , self .send_button , [8 ,0 ,0 ,0 ], Qt .AlignmentFlag .AlignLeft )
509+
510+ #
511+ cmd_row .setSpacing (0 )
495512
513+ #
496514 self .main_layout .addLayout (cmd_row )
497515
498516 def create_tabs (self ):
0 commit comments