Skip to content

Commit

Permalink
UI update
Browse files Browse the repository at this point in the history
UI update
  • Loading branch information
DoiiarX committed Feb 2, 2024
1 parent 6d93200 commit 557e127
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion cddagl/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.7.7
1.7.8
24 changes: 24 additions & 0 deletions cddagl/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,30 @@ def start_ui(locale, single_instance):
load_gettext_locale(get_locale_path(), locale)

main_app = QApplication(sys.argv)

app.setStyleSheet("""
/* 设置按钮的背景颜色、文本颜色和字体 */
QPushButton {
background-color: #ffffff; /* 白色背景 */
color: #333333; /* 深灰色文本 */
font-size: 16px; /* 字体大小 */
border: 1px solid #cccccc; /* 浅灰色边框 */
border-radius: 5px; /* 圆角 */
padding: 10px 20px; /* 设置内边距 */
}
/* 鼠标悬停时的样式 */
QPushButton:hover {
background-color: #f0f0f0; /* 悬停时的浅灰色背景 */
}
/* 鼠标按下时的样式 */
QPushButton:pressed {
background-color: #e0e0e0; /* 鼠标按下时的深浅灰色背景 */
}
""")

main_app.setWindowIcon(QIcon(get_resource_path('launcher.ico')))

main_app.single_instance = single_instance
Expand Down
10 changes: 10 additions & 0 deletions cddagl/ui/views/mods.py
Original file line number Diff line number Diff line change
Expand Up @@ -1086,6 +1086,16 @@ def repository_clicked(self):
authors = ', '.join(authors)
self.author_le.setText(authors)
self.description_le.setText(selected_info.get('description', ''))
self.textbox.setToolTip(selected_info.get('description', ''))
self.description_le.setStyleSheet(
"QToolTip {"
" font-size: 14px;" # 设置字体大小
" background-color: yellow;" # 设置背景颜色
" color: black;" # 设置文本颜色
" border: 1px solid gray;" # 设置边框
"}"
)

self.category_le.setText(selected_info.get('category', ''))
self.version_le.setText(selected_info.get('version', _('Unknown')))

Expand Down

0 comments on commit 557e127

Please sign in to comment.