Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jlib
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
jlib
Commits
86e8c724
Commit
86e8c724
authored
May 27, 2025
by
captainwong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
qt darkmode stylesheet
parent
b16f189a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
143 additions
and
2 deletions
+143
-2
darkmode.h
jlib/qt/darkmode.h
+141
-0
process.h
jlib/win32/process.h
+2
-2
No files found.
jlib/qt/darkmode.h
0 → 100644
View file @
86e8c724
#ifndef __JLIB_QT_DARKMODE_H__
#define __JLIB_QT_DARKMODE_H__
namespace
jlib
{
namespace
qt
{
/**
* @brief Dark mode stylesheet for Qt applications.
*
* This stylesheet is designed to provide a dark theme for Qt applications,
* enhancing the user interface with a modern and visually appealing look.
* It includes styles for various widgets such as buttons, text fields, combo boxes,
* and more, ensuring a consistent dark theme throughout the application.
*/
static
const
char
*
dark_mode_stylesheet
=
R
"(
QDialog {
background-color: #333333;
font-family: 'SimHei', 'Microsoft YaHei', 'Arial', sans-serif;
font-size: 24pt;
}
QPushButton {
background-color: #555555;
color: #CCCCCC;
border: 1px solid #666666;
border-radius: 4px;
padding: 6px 12px;
min-width: 60px;
}
QPushButton:hover {
background-color: #666666;
}
QPushButton:pressed {
background-color: #777777;
}
QPushButton:disabled {
background-color: #444444;
color: #888888;
}
QLineEdit, QTextEdit {
background-color: #444444;
color: #CCCCCC;
border: 1px solid #555555;
border-radius: 3px;
padding: 4px;
}
/* 新增的下拉菜单专项样式 */
QComboBox QAbstractItemView {
background-color: #444444; /* 下拉菜单背景色 */
border: 1px solid #555555; /* 边框与主界面统一 */
border-radius: 3px;
color: white; /* 文字颜色 */
selection-background-color: #0078D4; /* 选中项背景色 */
selection-color: white; /* 选中项文字颜色 */
outline: 0; /* 去除虚线焦点框 */
max-height: 200px; /* 防止过长 */
}
/* 下拉菜单项的样式 */
QComboBox QAbstractItemView::item {
height: 28px; /* 统一行高 */
padding: 0 8px; /* 文字缩进 */
}
/* 原有基础样式增强 */
QComboBox {
background-color: #444444;
color: white;
border: 1px solid #555555;
border-radius: 3px;
}
/* 滚动条样式(保持整体风格统一) */
QComboBox QScrollBar:vertical {
background: #333333;
width: 10px;
}
QComboBox QScrollBar::handle:vertical {
background: #666666;
}
QGroupBox {
color: #AAEEAA;
border: 1px solid #555555;
margin-top: 10px;
padding-top: 15px;
}
QLabel {
color: #CCCCCC;
}
QCheckBox, QRadioButton {
color: #CCCCCC;
}
QListWidget {
background-color: #444444;
color: white;
border: 1px solid #555555;
border-radius: 3px;
}
QListWidgetItem {
background-color: #444444;
color: white;
padding: 4px 8px;
}
QPlainTextEdit {
background-color: #444444;
color: white;
border: 1px solid #555555;
border-radius: 3px;
padding: 4px;
}
QProgressBar {
background-color: #444444;
color: white;
border: 1px solid #555555;
border-radius: 3px;
}
QHexView {
background-color: #333333;
color: #CCCCCC;
}
QHexView::header {
background-color: #444444;
color: #CCCCCC;
}
QHexView::address {
background-color: #444444;
color: #CCCCCC;
}
QHexView::hex {
background-color: #444444;
color: #CCCCCC;
}
QHexView::ascii {
background-color: #444444;
color: #CCCCCC;
}
)"
;
}
// namespace qt
}
// namespace jlib
#endif // __JLIB_QT_DARKMODE_H__
jlib/win32/process.h
View file @
86e8c724
...
@@ -90,7 +90,7 @@ inline DWORD getppid()
...
@@ -90,7 +90,7 @@ inline DWORD getppid()
return
ppid
;
return
ppid
;
}
}
#ifdef JLIB_ENABLE_PROCESS_INFO
///////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////
// https://docs.microsoft.com/zh-cn/windows/win32/toolhelp/taking-a-snapshot-and-viewing-processes
// https://docs.microsoft.com/zh-cn/windows/win32/toolhelp/taking-a-snapshot-and-viewing-processes
...
@@ -428,7 +428,7 @@ inline ProcessInfos getProcessesInfo(ErrorOutputFunc output = dummyErrorOutputFu
...
@@ -428,7 +428,7 @@ inline ProcessInfos getProcessesInfo(ErrorOutputFunc output = dummyErrorOutputFu
CloseHandle
(
hProcessSnap
);
CloseHandle
(
hProcessSnap
);
return
(
pinfos
);
return
(
pinfos
);
}
}
#endif
/* JLIB_ENABLE_PROCESS_INFO */
}
// namespace win32
}
// namespace win32
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment