编辑 - 这个主题在最新版本的 P4V 上不能正常工作,我推荐上面 mokoto 的回答!
我已经修改了 Perforce/P4VResources/skins 中的 Default.qss 以创建我自己的深色主题。
我会在这里发布,我添加了 cmets,主要只是编辑了十六进制代码值。随意使用和修改。
!https://imgur.com/a/IyvSX54
/* DARK THEME - JP */
/* Modified */
/* Log Window Text */
LightweightTextView
{
background-color: #1E1E1E;
color: #A0A0A0;
}
/* Generic Text */
QLabel {
background-color: #1E1E1E;
color: #A0A0A0;
}
/* History/Pending/Submitted Items */
QAbstractItemView {
background-color: #1E1E1E;
color: #A0A0A0;
}
/* Window In Focus */
QAbstractItemView[hasFocus="true"]::item:selected:hover {
background-color: #0085C7;
color: #D3D3D3;
}
QAbstractItemView[hasFocus="true"]::branch:selected:hover {
background-color: #0085C7;
color: #D3D3D3;
}
QAbstractItemView[hasFocus="true"]::item:selected {
background-color: #2B4D73;
color: #A0A0A0;
}
QAbstractItemView[hasFocus="true"]::branch:selected {
background-color: #2B4D73;
color: #A0A0A0;
}
/* Window Out Of Focus */
QAbstractItemView[hasFocus="false"]::item:selected:hover {
background-color: #0085C7;
color: #D3D3D3;
}
QAbstractItemView[hasFocus="false"]::branch:selected:hover {
background-color: #0085C7;
}
QAbstractItemView[hasFocus="false"]::item:selected {
background-color: #343434;
color: #A0A0A0;
}
QAbstractItemView[hasFocus="false"]::branch:selected {
background-color: #343434;
color: #A0A0A0;
}
QAbstractItemView::item:hover {
background-color: #0085C7;
color: #D3D3D3;
}
QAbstractItemView::branch:hover {
background-color: #0085C7;
color: #D3D3D3;
}
/* Expand/Collapse Icons */
QAbstractItemView::branch:has-children:!has-siblings:closed,
QAbstractItemView::branch:closed:has-children:has-siblings {
background-color: #1E1E1E;
border-image: none;
image: url(:/directory_collapsed.png);
}
QAbstractItemView::branch:open:has-children:!has-siblings,
QAbstractItemView::branch:open:has-children:has-siblings {
background-color: #1E1E1E;
border-image: none;
image: url(:/directory_expanded.png);
}
/* List Headers */
QHeaderView::section {
background-color: #404040;
color: #808080;
padding: 2px;
border-top: 0px;
border-bottom: 0px;
border-left: 0px;
border-right: 1px solid #c2cfd8;
font-size: 11px;
}
/* Text Input Boxes */
QLineEdit {
selection-background-color: #0085C7;
background-color: #5E5E5E;
color: #ffffff;
}
/* Unmodified */
/*
Modal lists can't figure out focus well
but we can hardcode them safely
*/
DefinitionTree::branch:selected {
background-color: #0088CC;
}
DefinitionTree::branch:selected:hover {
background-color: #0085C7;
}
DefinitionTree::item:selected {
background-color: #0088CC;
}
DefinitionTree::item:selected:hover {
background-color: #0085C7;
}
TFilterView::branch:selected {
background-color: #0088CC;
}
TFilterView::branch:selected:hover {
background-color: #0085C7;
}
TFilterView::item:selected {
background-color: #0088CC;
}
TFilterView::item:selected:hover {
background-color: #0085C7;
}
UIPreferencesDialog QTreeWidget::branch:selected {
background-color: #0088CC;
}
UIPreferencesDialog QTreeWidget::branch:selected:hover {
background-color: #0085C7;
}
UIPreferencesDialog QTreeWidget::item:selected {
background-color: #0088CC;
}
UIPreferencesDialog QTreeWidget::item:selected:hover {
background-color: #0085C7;
}
QTreeView::branch:selected {
background-color: #0088CC;
}
QTreeView::branch:selected:hover {
background-color: #0085C7;
}
QTreeView::item:selected {
background-color: #0088CC;
}
QTreeView::item:selected:hover {
background-color: #0085C7;
}
QTableWidget::item:selected {
background-color: #0088CC;
}
QTableWidget:item:selected:hover {
background-color: #0085C7;
}
ConnectionPane::item:selected {
background-color: #0088CC;
}
ConnectionPane:item:selected:hover {
background-color: #0085C7;
}
/*---------------------------------*/
/* NOT SURE WHAT THIS STUFF IS YET */
/*---------------------------------*/
QSplitter#P4MergeSplitter::handle:vertical {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #a7a7a7, stop: 0.17 #a7a7a7,
stop: 0.18 transparent, stop: 0.83 transparent,
stop: 0.84 #a7a7a7, stop: 1.0 #a7a7a7);
}
P4mSplitter {
width: 50px;
}
QSplitterHandle {
background-color: #f0f0f0;
}
QTabBar::tab {
background-color: #1E1E1E;
color: #A0A0A0;
border-left: none;
border-right: 1px solid #dddddd;
min-width: 8ex;
padding: 5px;
margin-bottom: 2px;
}
QTabBar::close-button {
image: url(:/clear_icon.png);
margin-bottom: 4px;
}
QTabWidget::tab-bar {
background-color: #ededed;
left: 0px;
}
QToolBar {
background-color: #ededed;
padding: 4px;
}
UISpecList {
background-color: #f0f0f0;
}
QToolBar#P4VToolBar::separator:vertical {
height: 2px;
width: 100px;
color: #FFFFFF;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #d8d8d8, stop: 0.5 #d8d8d8,
stop: 0.6 #ffffff, stop: 1.0 #ffffff);
}
UIFilterWidget {
background-color: #f0f0f0;
}
WorkspaceStatusBar {
background-color: #f0f0f0;
color: #000000;
}
QWidget#UIChangeWindow_QWidget {
background-color: #fafafa;
}
QWidget#InnerWidget_for_QScrollArea {
background-color: transparent;
}
RevDetails {
background-color: #ededed;
}
RevDetails QLabel {
color: #777777;
}
UIBrowseUsersDialog {
background-color: #f0f0f0;
}
Gui--PasswordDialog {
background-color: #f0f0f0;
}
QDialogButtonBox {
background-color: transparent;
}
UISpecPicker {
background-color: #f0f0f0;
}
UIClearableComboBox QPushButton {
min-width:0px;
background-color:transparent;
}
Gui--FormWidget {
background-color: transparent;
}
/*--------------------------------------------------------------------*/
/* THIS STUFF HAS BEEN MODIFIED BUT FOR SOME REASON IT CAN'T BE MOVED */
/*--------------------------------------------------------------------*/
/* Check Box */
QCheckBox {
background-color: #transparent;
color: #ffffff;
}
/* Combo Boxes */
QComboBox
{
selection-background-color: #5091bc;
background-color: #5E5E5E;
color: #ffffff;
}
QComboBox:hover
{
background-color: #8E8E8E;
color: #ffffff;
}
QComboBox:on
{
background-color: #777777;
selection-background-color: #777777;
}
QComboBox QAbstractItemView
{
background-color: #1E1E1E;
color: #ffffff;
}
MostRecentCombo {
background-color: #1E1E1E;
color: #ffffff;
}
QComboBox {
background-color: #5E5E5E;
color: #ffffff;
}
/* Read Only Text */
QLineEdit[readOnly="true"]
{
color: #ffffff;
background: transparent;
}
/* Title Bar Menu */
QMainWindow::separator {
width: 1px;
height: 1px;
}
QMenuBar {
background-color: #1E1E1E;
selection-background-color: #9ABFD9;
color: #A0A0A0;
}
QMenu {
background-color: #1E1E1E;
color: #A0A0A0;
border: 1px solid #999999;
padding-top: 5px;
}
QMenu::item {
/* sets background of menu item. set this to something non-transparent
if you want menu color and menu item color to be different */
background-color: transparent;
}
QMenu::item:selected {
color: #ffffff;
background-color: #5091bc;
}
/* Progress Bar Background */
QProgressBar
{
border: 1px solid #5E5E5E;
border-radius: 0px;
text-align: center;
}
/* Progress Bar Chunks */
QProgressBar::chunk {
background-color: #0088cc;
width: 10px;
margin: 1px;
}
/* Common Buttons */
QPushButton {
background-color: #1E1E1E;
color: #A0A0A0;
}
/* Scroll Bar Horizontal */
QScrollBar:horizontal {
border-top: 1px solid #ffffff;
background-color: #1E1E1E;
height: 13px;
margin: 0px 13px 0 13px;
}
QScrollBar::handle:horizontal
{
background-color: #5E5E5E;
min-height: 20px;
}
QScrollBar::add-line:horizontal {
border-top: 1px solid #ffffff;
border-radius: 0px;
background-color: #1E1E1E;
width: 13px;
subcontrol-position: right;
subcontrol-origin: margin;
}
QScrollBar::sub-line:horizontal {
border-top: 1px solid #ffffff;
border-radius: 0px;
background-color: #1E1E1E;
width: 13px;
subcontrol-position: left;
subcontrol-origin: margin;
}
QScrollBar::left-arrow
{
background-color: #5E5E5E;
height: 10px;
width: 10px;
image: url(:/scroll_left_arrow.png);
}
QScrollBar::right-arrow
{
background-color: #5E5E5E;
height: 10px;
width: 10px;
image: url(:/scroll_right_arrow.png);
}
/* Scroll Bar Vertical */
QScrollBar:vertical
{
background-color: #1E1E1E;
width: 13px;
margin: 13px 0 13px 0;
border-left: 1px solid #ffffff;
}
QScrollBar::handle:vertical
{
background-color: #5E5E5E;
min-height: 20px;
border-radius: 0px;
}
QScrollBar::add-line:vertical
{
border-left: 1px solid #ffffff;
border-radius: 0px;
background-color: #1E1E1E;
height: 13px;
subcontrol-position: bottom;
subcontrol-origin: margin;
}
QScrollBar::sub-line:vertical
{
border-left: 1px solid #ffffff;
border-radius: 0px;
background-color: #1E1E1E;
height: 13px;
subcontrol-position: top;
subcontrol-origin: margin;
}
QScrollBar::up-arrow
{
background-color: #5E5E5E;
height: 10px;
width: 10px;
image: url(:/scroll_up_arrow.png);
}
QScrollBar::down-arrow
{
background-color: #5E5E5E;
height: 10px;
width: 10px;
image: url(:/scroll_down_arrow.png);
}
/* Area Behind Filter Options */
QSplitter {
background-color: #1E1E1E;
width: 6px;
height: 6px;
}
/* Main horizontal above log pane only*/
QSplitter#centralSplitter::handle {
height: 6px;
width: 4px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #5E5E5E, stop: 0.17 #5E5E5E,
stop: 0.18 #5E5E5E, stop: 0.83 #5E5E5E,
stop: 0.84 #5E5E5E, stop: 1.0 #5E5E5E);
}
/* Horizontal Splitter Handle */
QSplitter::handle:horizontal {
height: 4px;
width: 4px;
background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,
stop: 0 #5E5E5E, stop: 0.17 #5E5E5E,
stop: 0.18 #5E5E5E, stop: 1.0 #5E5E5E);
image: url(:/splitter_handle_horizontal.png);
}
/* Vertical Splitter Handle */
QSplitter::handle:vertical {
height: 4px;
width: 4px;
background-color: #5E5E5E;
image: url(:/splitter_handle_vertical.png);
}
/* When hovering over a tab */
QTabBar::tab:hover {
color: #D3D3D3;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #ff0000, stop: 0.89 #ff0000,
stop: 0.9 #ff0000, stop: 1.0 #ff0000);
margin-bottom: 2px;
}
/* When a tab that is not the first or last has been selected */
QTabBar::tab:selected {
color: #A0A0A0;
background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,
stop: 0 #5E5E5E, stop: 0.89 #5E5E5E,
stop: 0.9 #5E5E5E, stop: 1.0 #5E5E5E);
border-top-left-radius: 0px;
border-top-right-radius: 0px;
margin-bottom: 2px;
}
/* When a tab is not selected */
QTabBar::tab:!selected { /* make non-selected tabs look smaller */
background-color: #1E1E1E;
color: #A0A0A0;
margin-top: 0px;
}
/* When the first tab has been selected */
QTabBar::tab:first:selected { /* the first selected tab has nothing to overlap with on the left */
background-color: #5E5E5E;
color: #A0A0A0;
margin-left: 0;
}
/* When the last tab has been selected */
QTabBar::tab:last:selected { /* the last selected tab has nothing to overlap with on the right */
background-color: #5E5E5E;
color: #A0A0A0;
margin-right: 0;
}
/* Single Tab Background */
QTabBar::tab:only-one { /* if there is only one tab, we don't want overlapping margins */
background-color: #5E5E5E;
color: #A0A0A0;
margin: 0;
}
/* Line Under Tabs */
QTabBar {
background-color: #1E1E1E;
}
/* Pop Up Window Text Boxes */
QTextEdit[readOnly="true"]
{
background-color: #5E5E5E;
color: #ffffff;
padding: 0px;
border: 1px solid rgba(0,0,0,10);
}
QTextEdit[readOnly="false"]
{
background-color: #5E5E5E;
color: #ffffff;
}
/* Pop Up Dialog */
QDialog {
background-color: #1E1E1E;
color: #A0A0A0;
}
/* Initial Pop Up Dialog */
QStackedWidget {
background-color: #1E1E1E;
color: #A0A0A0;
}
/* Center Sliding Widget */
QWidget#centralWidget {
background-color: #5E5E5E;
color: #A0A0A0;
}
/* Tool Bar Background */
UIWorkspace2 QToolBar {
background-color: #1E1E1E;
color: #A0A0A0;
spacing: 15px;
}
/* Tool Bar Horizontal Separator */
QToolBar#P4VToolBar::separator:horizontal {
height: 100px;
width: 2px;
color: #A0A0A0;
background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,
stop: 0 #5E5E5E, stop: 0.5 #5E5E5E,
stop: 0.6 #5E5E5E, stop: 1.0 #5E5E5E);
}
/* Address Bar Background */
QToolBar#AddressBar {
background-color: #1E1E1E;
color: #A0A0A0;
}
/* Buttons */
QToolBar#P4VToolBar QToolButton {
background-color: #1E1E1E;
color: #808080;
font-size: 10px;
}
/* Filter Panel */
QScrollArea#filterScrollArea QWidget#filterScrollWidget {
background-color: #1E1E1E;
color: #A0A0A0;
}
/* + & - buttons */
QScrollArea#filterScrollArea QToolButton {
background-color: #5E5E5E;
color: #A0A0A0;
}
/* Widget Background */
QFrame#ExtendedTabWidget-mCornerWidget {
background-color: #5E5E5E;
color: #A0A0A0;
}
/* Generic Background Space */
UIWorkspaceWidget {
background-color: #1E1E1E;
color: #A0A0A0;
}
/* Button Hover */
QToolBar#P4VToolBar QToolButton:hover {
background-color: #1E1E1E;
color: #A0A0A0;
}
/* Button Disabled */
QToolBar#P4VToolBar QToolButton:disabled {
background-color: #1E1E1E;
color: #404040;
}
/* Tool Tips */
QToolTip {
border: 1px solid #e5d36c;
background-color: #fdfdc9;
color: #000000;
border-radius: 0px;
opacity: 250;
font-size: 11px;
}
/* Depo/Workspace Panel */
Gui--DirectoryTreeView {
background-color: #1E1E1E;
color: #A0A0A0;
}
Gui--DirectoryTreeView::item:hover {
background-color: #0085C7;
color: #D3D3D3;
}
Gui--DirectoryTreeView::branch:hover {
background-color: #0085C7;
color: #D3D3D3;
}
/* Common Background */
UIConfigurationDialog {
background-color: #1E1E1E;
color: #A0A0A0;
}
/* Border for Depo/Workspace Panel */
UITabTitleWidget QStackedWidget#qt_tabwidget_stackedwidget {
background-color: #1E1E1E;
color: #A0A0A0;
}
/* Bar At Bottom Of Window */
QStatusBar {
background-color: #1E1E1E;
color: #A0A0A0;
max-height: 20px;
margin-bottom: 1px;
}
/* Pop Up Window Background */
UISpecWindow {
background-color: #1E1E1E;
}
/* Pop Up Window Text */
UISpecWindow QLabel {
color: #A0A0A0;
}