Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Obs Studio
提交
9f1c442d
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,发现更多精彩内容 >>
提交
9f1c442d
编写于
1月 20, 2020
作者:
J
jp9000
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
UI: Add option to toggle source icons to View menu
上级
8c549a32
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
61 addition
and
16 deletion
+61
-16
UI/data/locale/en-US.ini
UI/data/locale/en-US.ini
+1
-0
UI/forms/OBSBasic.ui
UI/forms/OBSBasic.ui
+14
-2
UI/obs-app.cpp
UI/obs-app.cpp
+2
-0
UI/source-tree.cpp
UI/source-tree.cpp
+28
-14
UI/source-tree.hpp
UI/source-tree.hpp
+3
-0
UI/window-basic-main.cpp
UI/window-basic-main.cpp
+12
-0
UI/window-basic-main.hpp
UI/window-basic-main.hpp
+1
-0
未找到文件。
UI/data/locale/en-US.ini
浏览文件 @
9f1c442d
...
...
@@ -591,6 +591,7 @@ Basic.MainMenu.View.Docks.LockUI="Lock UI"
Basic.MainMenu.View.Docks.CustomBrowserDocks
=
"Custom Browser Docks..."
Basic.MainMenu.View.Toolbars.Listboxes
=
"&Listboxes"
Basic.MainMenu.View.SceneTransitions
=
"S&cene Transitions"
Basic.MainMenu.View.SourceIcons
=
"Source &Icons"
Basic.MainMenu.View.StatusBar
=
"&Status Bar"
Basic.MainMenu.View.Fullscreen.Interface
=
"Fullscreen Interface"
...
...
UI/forms/OBSBasic.ui
浏览文件 @
9f1c442d
...
...
@@ -188,7 +188,7 @@
<x>
0
</x>
<y>
0
</y>
<width>
1079
</width>
<height>
2
2
</height>
<height>
2
1
</height>
</rect>
</property>
<widget
class=
"QMenu"
name=
"menu_File"
>
...
...
@@ -393,6 +393,7 @@
<addaction
name=
"separator"
/>
<addaction
name=
"viewMenuDocks"
/>
<addaction
name=
"viewMenuToolbars"
/>
<addaction
name=
"toggleSourceIcons"
/>
<addaction
name=
"toggleStatusBar"
/>
<addaction
name=
"separator"
/>
<addaction
name=
"stats"
/>
...
...
@@ -728,7 +729,7 @@
<rect>
<x>
0
</x>
<y>
0
</y>
<width>
64
</width>
<width>
80
</width>
<height>
16
</height>
</rect>
</property>
...
...
@@ -1788,6 +1789,17 @@
<string>
Basic.MainMenu.Help.About
</string>
</property>
</action>
<action
name=
"toggleSourceIcons"
>
<property
name=
"checkable"
>
<bool>
true
</bool>
</property>
<property
name=
"checked"
>
<bool>
true
</bool>
</property>
<property
name=
"text"
>
<string>
Basic.MainMenu.View.SourceIcons
</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
...
...
UI/obs-app.cpp
浏览文件 @
9f1c442d
...
...
@@ -424,6 +424,8 @@ bool OBSApp::InitGlobalConfigDefaults()
"ShowListboxToolbars"
,
true
);
config_set_default_bool
(
globalConfig
,
"BasicWindow"
,
"ShowStatusBar"
,
true
);
config_set_default_bool
(
globalConfig
,
"BasicWindow"
,
"ShowSourceIcons"
,
true
);
config_set_default_bool
(
globalConfig
,
"BasicWindow"
,
"StudioModeLabels"
,
true
);
...
...
UI/source-tree.cpp
浏览文件 @
9f1c442d
...
...
@@ -59,21 +59,25 @@ SourceTreeItem::SourceTreeItem(SourceTree *tree_, OBSSceneItem sceneitem_)
OBSBasic
*
main
=
reinterpret_cast
<
OBSBasic
*>
(
App
()
->
GetMainWindow
());
const
char
*
id
=
obs_source_get_id
(
source
);
QIcon
icon
;
if
(
strcmp
(
id
,
"scene"
)
==
0
)
icon
=
main
->
GetSceneIcon
();
else
if
(
strcmp
(
id
,
"group"
)
==
0
)
icon
=
main
->
GetGroupIcon
();
else
icon
=
main
->
GetSourceIcon
(
id
);
QLabel
*
iconLabel
=
nullptr
;
if
(
tree
->
iconsVisible
)
{
QIcon
icon
;
if
(
strcmp
(
id
,
"scene"
)
==
0
)
icon
=
main
->
GetSceneIcon
();
else
if
(
strcmp
(
id
,
"group"
)
==
0
)
icon
=
main
->
GetGroupIcon
();
else
icon
=
main
->
GetSourceIcon
(
id
);
QPixmap
pixmap
=
icon
.
pixmap
(
QSize
(
16
,
16
));
QPixmap
pixmap
=
icon
.
pixmap
(
QSize
(
16
,
16
));
QLabel
*
iconLabel
=
new
QLabel
();
iconLabel
->
setPixmap
(
pixmap
);
iconLabel
->
setFixedSize
(
16
,
16
);
iconLabel
->
setStyleSheet
(
"background: none"
);
iconLabel
=
new
QLabel
();
iconLabel
->
setPixmap
(
pixmap
);
iconLabel
->
setFixedSize
(
16
,
16
);
iconLabel
->
setStyleSheet
(
"background: none"
);
}
vis
=
new
VisibilityCheckBox
();
vis
->
setSizePolicy
(
QSizePolicy
::
Maximum
,
QSizePolicy
::
Maximum
);
...
...
@@ -100,8 +104,10 @@ SourceTreeItem::SourceTreeItem(SourceTree *tree_, OBSSceneItem sceneitem_)
boxLayout
=
new
QHBoxLayout
();
boxLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
boxLayout
->
addWidget
(
iconLabel
);
boxLayout
->
addSpacing
(
2
);
if
(
iconLabel
)
{
boxLayout
->
addWidget
(
iconLabel
);
boxLayout
->
addSpacing
(
2
);
}
boxLayout
->
addWidget
(
label
);
boxLayout
->
addWidget
(
vis
);
boxLayout
->
addSpacing
(
1
);
...
...
@@ -972,6 +978,14 @@ void SourceTree::UpdateIcons()
stm
->
SceneChanged
();
}
void
SourceTree
::
SetIconsVisible
(
bool
visible
)
{
SourceTreeModel
*
stm
=
GetStm
();
iconsVisible
=
visible
;
stm
->
SceneChanged
();
}
void
SourceTree
::
ResetWidgets
()
{
OBSScene
scene
=
GetCurrentScene
();
...
...
UI/source-tree.hpp
浏览文件 @
9f1c442d
...
...
@@ -144,6 +144,8 @@ class SourceTree : public QListView {
QStaticText
textNoSources
;
QSvgRenderer
iconNoSources
;
bool
iconsVisible
=
true
;
void
UpdateNoSourcesMessage
();
void
ResetWidgets
();
...
...
@@ -178,6 +180,7 @@ public:
bool
GroupedItemsSelected
()
const
;
void
UpdateIcons
();
void
SetIconsVisible
(
bool
visible
);
public
slots
:
inline
void
ReorderItems
()
{
GetStm
()
->
ReorderItems
();
}
...
...
UI/window-basic-main.cpp
浏览文件 @
9f1c442d
...
...
@@ -1647,6 +1647,10 @@ void OBSBasic::OBSInit()
SET_VISIBILITY
(
"ShowStatusBar"
,
toggleStatusBar
);
#undef SET_VISIBILITY
bool
sourceIconsVisible
=
config_get_bool
(
GetGlobalConfig
(),
"BasicWindow"
,
"ShowSourceIcons"
);
ui
->
toggleSourceIcons
->
setChecked
(
sourceIconsVisible
);
{
ProfileScope
(
"OBSBasic::Load"
);
disableSaving
--
;
...
...
@@ -6801,6 +6805,14 @@ void OBSBasic::on_toggleStatusBar_toggled(bool visible)
visible
);
}
void
OBSBasic
::
on_toggleSourceIcons_toggled
(
bool
visible
)
{
ui
->
sources
->
SetIconsVisible
(
visible
);
config_set_bool
(
App
()
->
GlobalConfig
(),
"BasicWindow"
,
"ShowSourceIcons"
,
visible
);
}
void
OBSBasic
::
on_actionLockPreview_triggered
()
{
ui
->
preview
->
ToggleLocked
();
...
...
UI/window-basic-main.hpp
浏览文件 @
9f1c442d
...
...
@@ -893,6 +893,7 @@ private slots:
void
on_toggleListboxToolbars_toggled
(
bool
visible
);
void
on_toggleStatusBar_toggled
(
bool
visible
);
void
on_toggleSourceIcons_toggled
(
bool
visible
);
void
on_transitions_currentIndexChanged
(
int
index
);
void
on_transitionAdd_clicked
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录