Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Obs Studio
提交
2052000e
O
Obs Studio
项目概览
小白菜888
/
Obs Studio
通知
4
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
Obs Studio
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
2052000e
编写于
4月 08, 2019
作者:
J
Jim
提交者:
GitHub
4月 08, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1788 from cg2121/rename-default-theme
UI: Rename Default theme to System
上级
b5cc26a9
94b3f803
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
50 addition
and
11 deletion
+50
-11
UI/data/locale/en-US.ini
UI/data/locale/en-US.ini
+1
-0
UI/data/themes/System.qss
UI/data/themes/System.qss
+0
-0
UI/obs-app.cpp
UI/obs-app.cpp
+10
-4
UI/ui-config.h.in
UI/ui-config.h.in
+2
-0
UI/window-basic-settings.cpp
UI/window-basic-settings.cpp
+37
-7
未找到文件。
UI/data/locale/en-US.ini
浏览文件 @
2052000e
...
...
@@ -86,6 +86,7 @@ ShowInMultiview="Show in Multiview"
VerticalLayout
=
"Vertical Layout"
Group
=
"Group"
DoNotShowAgain
=
"Do not show again"
Default
=
"(Default)"
# warning if program already open
AlreadyRunning.Title
=
"OBS is already running"
...
...
UI/data/themes/
Default
.qss
→
UI/data/themes/
System
.qss
浏览文件 @
2052000e
文件已移动
UI/obs-app.cpp
浏览文件 @
2052000e
...
...
@@ -54,6 +54,8 @@
#include <iostream>
#include "ui-config.h"
using
namespace
std
;
static
log_handler_t
def_log_handler
;
...
...
@@ -423,7 +425,7 @@ bool OBSApp::InitGlobalConfigDefaults()
if
(
!
config_get_bool
(
globalConfig
,
"General"
,
"Pre21Defaults"
))
{
config_set_default_string
(
globalConfig
,
"General"
,
"CurrentTheme"
,
"Dark"
);
"CurrentTheme"
,
DEFAULT_THEME
);
}
config_set_default_bool
(
globalConfig
,
"BasicWindow"
,
...
...
@@ -1026,18 +1028,22 @@ bool OBSApp::InitTheme()
const
char
*
themeName
=
config_get_string
(
globalConfig
,
"General"
,
"CurrentTheme"
);
if
(
strcmp
(
themeName
,
"Default"
)
==
0
)
themeName
=
"System"
;
if
(
!
themeName
)
{
/* Use deprecated "Theme" value if available */
themeName
=
config_get_string
(
globalConfig
,
"General"
,
"Theme"
);
if
(
!
themeName
)
themeName
=
"Default"
;
themeName
=
DEFAULT_THEME
;
}
if
(
strcmp
(
themeName
,
"Default"
)
!=
0
&&
SetTheme
(
themeName
))
if
(
strcmp
(
themeName
,
DEFAULT_THEME
)
!=
0
&&
SetTheme
(
themeName
))
return
true
;
return
SetTheme
(
"Default"
);
return
SetTheme
(
DEFAULT_THEME
);
}
OBSApp
::
OBSApp
(
int
&
argc
,
char
**
argv
,
profiler_name_store_t
*
store
)
...
...
UI/ui-config.h.in
浏览文件 @
2052000e
...
...
@@ -27,3 +27,5 @@
#define RESTREAM_ENABLED @RESTREAM_ENABLED@
#define RESTREAM_CLIENTID "@RESTREAM_CLIENTID@"
#define RESTREAM_HASH 0x@RESTREAM_HASH@
#define DEFAULT_THEME "Dark"
UI/window-basic-settings.cpp
浏览文件 @
2052000e
...
...
@@ -48,6 +48,7 @@
#include "window-projector.hpp"
#include <util/platform.h>
#include "ui-config.h"
using
namespace
std
;
...
...
@@ -1003,17 +1004,31 @@ void OBSBasicSettings::LoadThemeList()
}
}
QString
defaultTheme
;
defaultTheme
+=
DEFAULT_THEME
;
defaultTheme
+=
" "
;
defaultTheme
+=
QTStr
(
"Default"
);
/* Check shipped themes. */
QDirIterator
uIt
(
QString
(
themeDir
.
c_str
()),
QStringList
()
<<
"*.qss"
,
QDir
::
Files
);
while
(
uIt
.
hasNext
())
{
uIt
.
next
();
QString
name
=
uIt
.
fileName
().
section
(
"."
,
0
,
0
);
if
(
!
uniqueSet
.
contains
(
name
))
if
(
name
==
DEFAULT_THEME
)
name
=
defaultTheme
;
if
(
!
uniqueSet
.
contains
(
name
)
&&
name
!=
"Default"
)
ui
->
theme
->
addItem
(
name
);
}
int
idx
=
ui
->
theme
->
findText
(
App
()
->
GetTheme
());
const
char
*
themeName
=
App
()
->
GetTheme
();
if
(
strcmp
(
themeName
,
DEFAULT_THEME
)
==
0
)
themeName
=
QT_TO_UTF8
(
defaultTheme
);
int
idx
=
ui
->
theme
->
findText
(
themeName
);
if
(
idx
!=
-
1
)
ui
->
theme
->
setCurrentIndex
(
idx
);
}
...
...
@@ -2657,13 +2672,19 @@ void OBSBasicSettings::SaveGeneralSettings()
int
themeIndex
=
ui
->
theme
->
currentIndex
();
QString
themeData
=
ui
->
theme
->
itemText
(
themeIndex
);
string
theme
=
themeData
.
toStdString
();
QString
defaultTheme
;
defaultTheme
+=
DEFAULT_THEME
;
defaultTheme
+=
" "
;
defaultTheme
+=
QTStr
(
"Default"
);
if
(
themeData
==
defaultTheme
)
themeData
=
DEFAULT_THEME
;
if
(
WidgetChanged
(
ui
->
theme
))
{
config_set_string
(
GetGlobalConfig
(),
"General"
,
"CurrentTheme"
,
theme
.
c_str
(
));
QT_TO_UTF8
(
themeData
));
App
()
->
SetTheme
(
theme
);
App
()
->
SetTheme
(
theme
Data
.
toUtf8
().
constData
()
);
}
#if defined(_WIN32) || defined(__APPLE__)
...
...
@@ -3392,8 +3413,17 @@ void OBSBasicSettings::closeEvent(QCloseEvent *event)
void
OBSBasicSettings
::
on_theme_activated
(
int
idx
)
{
string
currT
=
ui
->
theme
->
itemText
(
idx
).
toStdString
();
App
()
->
SetTheme
(
currT
);
QString
currT
=
ui
->
theme
->
itemText
(
idx
);
QString
defaultTheme
;
defaultTheme
+=
DEFAULT_THEME
;
defaultTheme
+=
" "
;
defaultTheme
+=
QTStr
(
"Default"
);
if
(
currT
==
defaultTheme
)
currT
=
DEFAULT_THEME
;
App
()
->
SetTheme
(
currT
.
toUtf8
().
constData
());
}
void
OBSBasicSettings
::
on_listWidget_itemSelectionChanged
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录