Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
小白菜888
Obs Studio
提交
75d62a8d
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,发现更多精彩内容 >>
未验证
提交
75d62a8d
编写于
4月 17, 2019
作者:
J
Jim
提交者:
GitHub
4月 17, 2019
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1623 from SuslikV/patch-11
UI: Correct custom property implementation
上级
4dc1c2a7
8a22889e
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
35 addition
and
13 deletion
+35
-13
UI/data/themes/Acri.qss
UI/data/themes/Acri.qss
+2
-2
UI/data/themes/Dark.qss
UI/data/themes/Dark.qss
+2
-2
UI/data/themes/Rachni.qss
UI/data/themes/Rachni.qss
+2
-2
UI/data/themes/System.qss
UI/data/themes/System.qss
+2
-2
UI/qt-display.cpp
UI/qt-display.cpp
+21
-2
UI/qt-display.hpp
UI/qt-display.hpp
+6
-2
UI/window-projector.cpp
UI/window-projector.cpp
+0
-1
未找到文件。
UI/data/themes/Acri.qss
浏览文件 @
75d62a8d
...
@@ -904,8 +904,8 @@ FocusList::item {
...
@@ -904,8 +904,8 @@ FocusList::item {
/* Preview background color */
/* Preview background color */
* [themeID="displayBackgroundColor"]
{
OBSQTDisplay
{
qproperty-displayBackgroundColor: #28282A;
qproperty-displayBackgroundColor: #28282A;
}
}
/* Preview/Program labels */
/* Preview/Program labels */
...
...
UI/data/themes/Dark.qss
浏览文件 @
75d62a8d
...
@@ -695,8 +695,8 @@ QLabel#errorLabel {
...
@@ -695,8 +695,8 @@ QLabel#errorLabel {
/* Preview background color */
/* Preview background color */
* [themeID="displayBackgroundColor"]
{
OBSQTDisplay
{
qproperty-displayBackgroundColor: rgb(76, 76, 76);
qproperty-displayBackgroundColor: rgb(76, 76, 76);
}
}
/* Preview/Program labels */
/* Preview/Program labels */
...
...
UI/data/themes/Rachni.qss
浏览文件 @
75d62a8d
...
@@ -1260,8 +1260,8 @@ QToolTip {
...
@@ -1260,8 +1260,8 @@ QToolTip {
/* Preview background color */
/* Preview background color */
* [themeID="displayBackgroundColor"]
{
OBSQTDisplay
{
qproperty-displayBackgroundColor: rgb(35, 38, 41);
qproperty-displayBackgroundColor: rgb(35, 38, 41);
}
}
/* Preview/Program labels */
/* Preview/Program labels */
...
...
UI/data/themes/System.qss
浏览文件 @
75d62a8d
...
@@ -138,8 +138,8 @@ QLabel#errorLabel {
...
@@ -138,8 +138,8 @@ QLabel#errorLabel {
/* Preview background color */
/* Preview background color */
* [themeID="displayBackgroundColor"]
{
OBSQTDisplay
{
qproperty-displayBackgroundColor: rgb(76, 76, 76);
qproperty-displayBackgroundColor: rgb(76, 76, 76);
}
}
/* Preview/Program labels */
/* Preview/Program labels */
...
...
UI/qt-display.cpp
浏览文件 @
75d62a8d
...
@@ -19,6 +19,13 @@ static inline long long color_to_int(QColor color)
...
@@ -19,6 +19,13 @@ static inline long long color_to_int(QColor color)
shift
(
color
.
alpha
(),
24
);
shift
(
color
.
alpha
(),
24
);
}
}
static
inline
QColor
rgba_to_color
(
uint32_t
rgba
)
{
return
QColor
::
fromRgb
(
rgba
&
0xFF
,
(
rgba
>>
8
)
&
0xFF
,
(
rgba
>>
16
)
&
0xFF
,
(
rgba
>>
24
)
&
0xFF
);
}
OBSQTDisplay
::
OBSQTDisplay
(
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
OBSQTDisplay
::
OBSQTDisplay
(
QWidget
*
parent
,
Qt
::
WindowFlags
flags
)
:
QWidget
(
parent
,
flags
)
:
QWidget
(
parent
,
flags
)
...
@@ -53,13 +60,25 @@ OBSQTDisplay::OBSQTDisplay(QWidget *parent, Qt::WindowFlags flags)
...
@@ -53,13 +60,25 @@ OBSQTDisplay::OBSQTDisplay(QWidget *parent, Qt::WindowFlags flags)
connect
(
windowHandle
(),
&
QWindow
::
visibleChanged
,
windowVisible
);
connect
(
windowHandle
(),
&
QWindow
::
visibleChanged
,
windowVisible
);
connect
(
windowHandle
(),
&
QWindow
::
screenChanged
,
sizeChanged
);
connect
(
windowHandle
(),
&
QWindow
::
screenChanged
,
sizeChanged
);
}
this
->
setProperty
(
"themeID"
,
"displayBackgroundColor"
);
QColor
OBSQTDisplay
::
GetDisplayBackgroundColor
()
const
{
return
rgba_to_color
(
backgroundColor
);
}
}
void
OBSQTDisplay
::
SetDisplayBackgroundColor
(
const
QColor
&
color
)
void
OBSQTDisplay
::
SetDisplayBackgroundColor
(
const
QColor
&
color
)
{
{
backgroundColor
=
(
uint32_t
)
color_to_int
(
color
);
uint32_t
newBackgroundColor
=
(
uint32_t
)
color_to_int
(
color
);
if
(
newBackgroundColor
!=
backgroundColor
)
{
backgroundColor
=
newBackgroundColor
;
UpdateDisplayBackgroundColor
();
}
}
void
OBSQTDisplay
::
UpdateDisplayBackgroundColor
()
{
obs_display_set_background_color
(
display
,
backgroundColor
);
obs_display_set_background_color
(
display
,
backgroundColor
);
}
}
...
...
UI/qt-display.hpp
浏览文件 @
75d62a8d
...
@@ -3,9 +3,12 @@
...
@@ -3,9 +3,12 @@
#include <QWidget>
#include <QWidget>
#include <obs.hpp>
#include <obs.hpp>
#define GREY_COLOR_BACKGROUND 0xFF4C4C4C
class
OBSQTDisplay
:
public
QWidget
{
class
OBSQTDisplay
:
public
QWidget
{
Q_OBJECT
Q_OBJECT
Q_PROPERTY
(
QColor
displayBackgroundColor
MEMBER
backgroundColor
Q_PROPERTY
(
QColor
displayBackgroundColor
MEMBER
backgroundColor
READ
GetDisplayBackgroundColor
WRITE
SetDisplayBackgroundColor
)
WRITE
SetDisplayBackgroundColor
)
OBSDisplay
display
;
OBSDisplay
display
;
...
@@ -27,8 +30,9 @@ public:
...
@@ -27,8 +30,9 @@ public:
inline
obs_display_t
*
GetDisplay
()
const
{
return
display
;}
inline
obs_display_t
*
GetDisplay
()
const
{
return
display
;}
uint32_t
backgroundColor
;
uint32_t
backgroundColor
=
GREY_COLOR_BACKGROUND
;
private
slots
:
QColor
GetDisplayBackgroundColor
()
const
;
void
SetDisplayBackgroundColor
(
const
QColor
&
color
);
void
SetDisplayBackgroundColor
(
const
QColor
&
color
);
void
UpdateDisplayBackgroundColor
();
};
};
UI/window-projector.cpp
浏览文件 @
75d62a8d
...
@@ -67,7 +67,6 @@ OBSProjector::OBSProjector(QWidget *widget, obs_source_t *source_, int monitor,
...
@@ -67,7 +67,6 @@ OBSProjector::OBSProjector(QWidget *widget, obs_source_t *source_, int monitor,
obs_display_add_draw_callback
(
GetDisplay
(),
obs_display_add_draw_callback
(
GetDisplay
(),
isMultiview
?
OBSRenderMultiview
:
OBSRender
,
isMultiview
?
OBSRenderMultiview
:
OBSRender
,
this
);
this
);
obs_display_set_background_color
(
GetDisplay
(),
0x000000
);
};
};
connect
(
this
,
&
OBSQTDisplay
::
DisplayCreated
,
addDrawCallback
);
connect
(
this
,
&
OBSQTDisplay
::
DisplayCreated
,
addDrawCallback
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录