Skip to content

Commit 1a322a3

Browse files
committed
Update style
1 parent b17e7ab commit 1a322a3

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

pyqt_openai/apiDialog.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from PySide6.QtWidgets import QVBoxLayout, QTableWidget, QHeaderView, QTableWidgetItem, QLabel, QLineEdit, QDialog, \
22
QDialogButtonBox
3+
from PySide6.QtCore import Qt
34

45
from pyqt_openai import HOW_TO_GET_OPENAI_API_KEY_URL, HOW_TO_GET_CLAUDE_API_KEY_URL, HOW_TO_GET_GEMINI_API_KEY_URL, \
56
HOW_TO_GET_LLAMA_API_KEY_URL
6-
from pyqt_openai.lang.translations import LangClass
77
from pyqt_openai.widgets.linkLabel import LinkLabel
88

99

@@ -54,6 +54,7 @@ def __initUi(self):
5454

5555
getApiKeyLbl = LinkLabel()
5656
getApiKeyLbl.setText('Link')
57+
getApiKeyLbl.setAlignment(Qt.AlignmentFlag.AlignCenter)
5758
getApiKeyLbl.setUrl(obj['get_api_key'])
5859
self.__tableWidget.setCellWidget(i, 2, getApiKeyLbl)
5960

pyqt_openai/widgets/animationButton.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ def __init__(self, text='Other API', duration=1000, start_value=1, end_value=0.5
1212
self.setGraphicsEffect(self.opacity_effect)
1313

1414
# Create the animation for the opacity effect
15-
self.animation = QPropertyAnimation(self.opacity_effect, b"opacity")
16-
self.animation.setDuration(duration) # Duration of one animation cycle (in milliseconds)
17-
self.animation.setStartValue(start_value) # Start with full opacity
18-
self.animation.setEndValue(end_value) # End with lower opacity
19-
self.animation.setEasingCurve(QEasingCurve.Type.InOutQuad) # Smooth transition
15+
self.opacity_animation = QPropertyAnimation(self.opacity_effect, b"opacity")
16+
self.opacity_animation.setDuration(duration) # Duration of one animation cycle (in milliseconds)
17+
self.opacity_animation.setStartValue(start_value) # Start with full opacity
18+
self.opacity_animation.setEndValue(end_value) # End with lower opacity
19+
self.opacity_animation.setEasingCurve(QEasingCurve.Type.InOutQuad) # Smooth transition
2020

2121
# Set the animation to alternate between fading in and out
22-
self.animation.setDirection(QPropertyAnimation.Direction.Forward) # Start direction
22+
self.opacity_animation.setDirection(QPropertyAnimation.Direction.Forward) # Start direction
2323

2424
# Connect the animation's finished signal to reverse direction
25-
self.animation.finished.connect(self.reverse_animation_direction)
25+
self.opacity_animation.finished.connect(self.reverse_animation_direction)
2626

2727
# Start the animation
28-
self.animation.start()
28+
self.opacity_animation.start()
2929

3030
def reverse_animation_direction(self):
3131
# Reverse the direction of the animation each time it finishes
32-
if self.animation.direction() == QPropertyAnimation.Direction.Forward:
33-
self.animation.setDirection(QPropertyAnimation.Direction.Backward)
32+
if self.opacity_animation.direction() == QPropertyAnimation.Direction.Forward:
33+
self.opacity_animation.setDirection(QPropertyAnimation.Direction.Backward)
3434
else:
35-
self.animation.setDirection(QPropertyAnimation.Direction.Forward)
36-
self.animation.start()
35+
self.opacity_animation.setDirection(QPropertyAnimation.Direction.Forward)
36+
self.opacity_animation.start()

0 commit comments

Comments
 (0)