Skip to content

Commit

Permalink
added github icon
Browse files Browse the repository at this point in the history
  • Loading branch information
suitedaces committed Oct 27, 2024
1 parent 49242b7 commit 4ebb0a9
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 35 deletions.
Empty file added README.md
Empty file.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ anthropic
python-dotenv
pillow
numpy
qtawesome>=1.2.1
qtawesome
4 changes: 4 additions & 0 deletions run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from src.main import main

if __name__ == "__main__":
main()
Empty file added src/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions main.py → src/main.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import sys
import logging
from PyQt6.QtWidgets import QApplication
from window import MainWindow
from store import Store
from anthropic_client import AnthropicClient
from .window import MainWindow
from .store import Store
from .anthropic import AnthropicClient

logging.basicConfig(filename='agent.log', level=logging.DEBUG,
format='%(asctime)s - %(levelname)s - %(message)s')
Expand Down
4 changes: 2 additions & 2 deletions store.py → src/store.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging
from anthropic_client import AnthropicClient
from computer_control import ComputerControl
from .anthropic import AnthropicClient
from .computer import ComputerControl
from anthropic.types.beta import BetaMessage, BetaToolUseBlock, BetaTextBlock
import json

Expand Down
53 changes: 24 additions & 29 deletions window.py → src/window.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from PyQt6.QtWidgets import (QMainWindow, QVBoxLayout, QHBoxLayout, QWidget, QTextEdit,
QPushButton, QLabel, QProgressBar, QSystemTrayIcon, QMenu, QApplication, QDialog, QLineEdit, QMenuBar)
from PyQt6.QtCore import Qt, QPoint, pyqtSignal, QThread
from PyQt6.QtGui import QFont, QKeySequence, QShortcut, QAction, QTextCursor
import qtawesome as qta
from store import Store # Add this import
from anthropic_client import AnthropicClient # Add this import
from PyQt6.QtCore import Qt, QPoint, pyqtSignal, QThread, QUrl
from PyQt6.QtGui import QFont, QKeySequence, QShortcut, QAction, QTextCursor, QDesktopServices
from .store import Store
from .anthropic import AnthropicClient
import logging
import qtawesome as qta

logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -152,6 +152,23 @@ def setup_ui(self):
title_bar_layout.addStretch()

# Window controls
github_button = QPushButton()
github_button.setIcon(qta.icon('fa5b.github', color='white')) # Using qtawesome for GitHub icon
github_button.setFlat(True)
github_button.setStyleSheet("""
QPushButton {
color: #ffffff;
background-color: transparent;
border-radius: 8px;
padding: 4px 12px;
font-weight: bold;
}
QPushButton:hover {
background-color: #333333;
}
""")
github_button.clicked.connect(lambda: QDesktopServices.openUrl(QUrl('https://github.com/suitedaces/computer-agent')))

minimize_button = QPushButton("—")
minimize_button.setFlat(True)
minimize_button.setStyleSheet("""
Expand Down Expand Up @@ -183,6 +200,7 @@ def setup_ui(self):
}
""")

title_bar_layout.addWidget(github_button)
title_bar_layout.addWidget(minimize_button)
title_bar_layout.addWidget(close_button)
container_layout.addWidget(title_bar)
Expand Down Expand Up @@ -676,27 +694,4 @@ def handle_input_keypress(self, event):
cursor.deletePreviousChar()
# Default handling for other keys
else:
QTextEdit.keyPressEvent(self.input_area, event)























QTextEdit.keyPressEvent(self.input_area, event)

0 comments on commit 4ebb0a9

Please sign in to comment.