From 490d9469dc6683512acbcaac8b0fd6f9347297b9 Mon Sep 17 00:00:00 2001 From: johndoe6345789 Date: Mon, 5 Jan 2026 13:23:40 +0000 Subject: [PATCH] feat: Add console toolbar with copy and clear buttons for improved user interaction --- scripts/dev_commands.py | 50 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/scripts/dev_commands.py b/scripts/dev_commands.py index 46e3f7f..ee93ff2 100644 --- a/scripts/dev_commands.py +++ b/scripts/dev_commands.py @@ -968,6 +968,45 @@ def gui(args: argparse.Namespace) -> None: border-radius: 3px; } """) + + # Console toolbar + console_toolbar = QHBoxLayout() + + self.copy_console_btn = QPushButton("📋 Copy") + self.copy_console_btn.setStyleSheet(""" + QPushButton { + background-color: #2a475e; + color: #c6d1db; + border: none; + border-radius: 3px; + padding: 5px 15px; + } + QPushButton:hover { + background-color: #3e5c78; + } + """) + self.copy_console_btn.clicked.connect(self.copy_console) + console_toolbar.addWidget(self.copy_console_btn) + + self.clear_console_btn = QPushButton("🗑 Clear") + self.clear_console_btn.setStyleSheet(""" + QPushButton { + background-color: #2a475e; + color: #c6d1db; + border: none; + border-radius: 3px; + padding: 5px 15px; + } + QPushButton:hover { + background-color: #3e5c78; + } + """) + self.clear_console_btn.clicked.connect(self.console.clear) + console_toolbar.addWidget(self.clear_console_btn) + + console_toolbar.addStretch() + console_layout.addLayout(console_toolbar) + console_layout.addWidget(self.console) self.tab_widget.addTab(console_container, "Console Output") @@ -1446,6 +1485,17 @@ return {{ self.status_label.setStyleSheet("color: #ff6b6b; font-size: 9pt;") QTimer.singleShot(3000, lambda: self.status_label.setText("")) + def copy_console(self): + """Copy console output to clipboard""" + from PyQt6.QtWidgets import QApplication + clipboard = QApplication.clipboard() + selected_text = self.console.textCursor().selectedText() + if selected_text: + clipboard.setText(selected_text) + else: + # If no selection, copy all text + clipboard.setText(self.console.toPlainText()) + def play_game(self): """Launch the selected game""" if not self.current_game: