Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Graphic Ui
提交
b963df17
G
Graphic Ui
项目概览
OpenHarmony
/
Graphic Ui
大约 1 年 前同步成功
通知
13
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
Graphic Ui
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
b963df17
编写于
6月 02, 2021
作者:
O
openharmony_ci
提交者:
Gitee
6月 02, 2021
浏览文件
操作
浏览文件
下载
差异文件
!190 【图形】TDD测试问题
Merge pull request !190 from 邓志豪/TDDProblem
上级
71d95beb
5a37de40
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
15 addition
and
7 deletion
+15
-7
frameworks/components/ui_button.cpp
frameworks/components/ui_button.cpp
+1
-0
frameworks/components/ui_time_picker.cpp
frameworks/components/ui_time_picker.cpp
+3
-0
frameworks/font/ui_font.cpp
frameworks/font/ui_font.cpp
+5
-1
frameworks/themes/theme_manager.cpp
frameworks/themes/theme_manager.cpp
+0
-3
interfaces/kits/font/ui_font.h
interfaces/kits/font/ui_font.h
+1
-0
interfaces/kits/themes/theme_manager.h
interfaces/kits/themes/theme_manager.h
+4
-1
test/unittest/common/focus_manager_unit_test.cpp
test/unittest/common/focus_manager_unit_test.cpp
+1
-1
test/unittest/font/ui_font_unit_test.cpp
test/unittest/font/ui_font_unit_test.cpp
+0
-1
未找到文件。
frameworks/components/ui_button.cpp
浏览文件 @
b963df17
...
@@ -249,6 +249,7 @@ void UIButton::Enable()
...
@@ -249,6 +249,7 @@ void UIButton::Enable()
void
UIButton
::
SetState
(
ButtonState
state
)
void
UIButton
::
SetState
(
ButtonState
state
)
{
{
state_
=
state
;
state_
=
state
;
style_
=
buttonStyles_
[
state_
];
Invalidate
();
Invalidate
();
}
}
...
...
frameworks/components/ui_time_picker.cpp
浏览文件 @
b963df17
...
@@ -53,6 +53,9 @@ UITimePicker::UITimePicker()
...
@@ -53,6 +53,9 @@ UITimePicker::UITimePicker()
}
else
{
}
else
{
style_
=
&
(
StyleDefault
::
GetPickerHighlightStyle
());
style_
=
&
(
StyleDefault
::
GetPickerHighlightStyle
());
}
}
#if ENABLE_FOCUS_MANAGER
focusable_
=
true
;
#endif
highlightFontId_
=
style_
->
font_
;
highlightFontId_
=
style_
->
font_
;
highlightColor_
=
style_
->
textColor_
;
highlightColor_
=
style_
->
textColor_
;
...
...
frameworks/font/ui_font.cpp
浏览文件 @
b963df17
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#endif
#endif
namespace
OHOS
{
namespace
OHOS
{
bool
UIFont
::
setFontAllocFlag_
=
false
;
UIFont
::
UIFont
()
:
instance_
(
nullptr
),
defaultInstance_
(
nullptr
){};
UIFont
::
UIFont
()
:
instance_
(
nullptr
),
defaultInstance_
(
nullptr
){};
UIFont
::~
UIFont
(){};
UIFont
::~
UIFont
(){};
...
@@ -38,11 +39,13 @@ UIFont* UIFont::GetInstance()
...
@@ -38,11 +39,13 @@ UIFont* UIFont::GetInstance()
if
(
instance
.
instance_
==
nullptr
)
{
if
(
instance
.
instance_
==
nullptr
)
{
instance
.
defaultInstance_
=
new
UIFontVector
();
instance
.
defaultInstance_
=
new
UIFontVector
();
instance
.
instance_
=
instance
.
defaultInstance_
;
instance
.
instance_
=
instance
.
defaultInstance_
;
setFontAllocFlag_
=
true
;
}
}
#else
#else
if
(
instance
.
instance_
==
nullptr
)
{
if
(
instance
.
instance_
==
nullptr
)
{
instance
.
defaultInstance_
=
new
UIFontBitmap
();
instance
.
defaultInstance_
=
new
UIFontBitmap
();
instance
.
instance_
=
instance
.
defaultInstance_
;
instance
.
instance_
=
instance
.
defaultInstance_
;
setFontAllocFlag_
=
true
;
}
}
#endif
#endif
return
&
instance
;
return
&
instance
;
...
@@ -51,9 +54,10 @@ UIFont* UIFont::GetInstance()
...
@@ -51,9 +54,10 @@ UIFont* UIFont::GetInstance()
void
UIFont
::
SetFont
(
BaseFont
*
font
)
void
UIFont
::
SetFont
(
BaseFont
*
font
)
{
{
if
(
font
!=
nullptr
)
{
if
(
font
!=
nullptr
)
{
if
(
defaultInstance_
!=
nullptr
)
{
if
(
defaultInstance_
!=
nullptr
&&
setFontAllocFlag_
)
{
delete
defaultInstance_
;
delete
defaultInstance_
;
defaultInstance_
=
nullptr
;
defaultInstance_
=
nullptr
;
setFontAllocFlag_
=
false
;
}
}
defaultInstance_
=
font
;
defaultInstance_
=
font
;
instance_
=
font
;
instance_
=
font
;
...
...
frameworks/themes/theme_manager.cpp
浏览文件 @
b963df17
...
@@ -24,9 +24,6 @@ ThemeManager& ThemeManager::GetInstance()
...
@@ -24,9 +24,6 @@ ThemeManager& ThemeManager::GetInstance()
void
ThemeManager
::
SetCurrent
(
Theme
*
theme
)
void
ThemeManager
::
SetCurrent
(
Theme
*
theme
)
{
{
if
(
theme_
!=
nullptr
)
{
delete
theme_
;
}
theme_
=
theme
;
theme_
=
theme
;
}
}
}
// namespace OHOS
}
// namespace OHOS
\ No newline at end of file
interfaces/kits/font/ui_font.h
浏览文件 @
b963df17
...
@@ -233,6 +233,7 @@ private:
...
@@ -233,6 +233,7 @@ private:
BaseFont
*
instance_
;
BaseFont
*
instance_
;
BaseFont
*
defaultInstance_
;
BaseFont
*
defaultInstance_
;
static
bool
setFontAllocFlag_
;
};
};
}
// namespace OHOS
}
// namespace OHOS
#endif
#endif
interfaces/kits/themes/theme_manager.h
浏览文件 @
b963df17
...
@@ -78,7 +78,10 @@ public:
...
@@ -78,7 +78,10 @@ public:
private:
private:
ThemeManager
()
:
theme_
(
nullptr
)
{}
ThemeManager
()
:
theme_
(
nullptr
)
{}
~
ThemeManager
()
{}
virtual
~
ThemeManager
()
{
theme_
=
nullptr
;
}
Theme
*
theme_
;
Theme
*
theme_
;
};
};
...
...
test/unittest/common/focus_manager_unit_test.cpp
浏览文件 @
b963df17
...
@@ -57,6 +57,7 @@ void FocusManagerTest::SetUpTestCase(void)
...
@@ -57,6 +57,7 @@ void FocusManagerTest::SetUpTestCase(void)
void
FocusManagerTest
::
TearDownTestCase
(
void
)
void
FocusManagerTest
::
TearDownTestCase
(
void
)
{
{
FocusManager
::
GetInstance
()
->
ClearFocus
();
if
(
viewGroup_
!=
nullptr
)
{
if
(
viewGroup_
!=
nullptr
)
{
viewGroup_
->
Remove
(
label1_
);
viewGroup_
->
Remove
(
label1_
);
viewGroup_
->
Remove
(
label2_
);
viewGroup_
->
Remove
(
label2_
);
...
@@ -71,7 +72,6 @@ void FocusManagerTest::TearDownTestCase(void)
...
@@ -71,7 +72,6 @@ void FocusManagerTest::TearDownTestCase(void)
delete
label2_
;
delete
label2_
;
label2_
=
nullptr
;
label2_
=
nullptr
;
}
}
FocusManager
::
GetInstance
()
->
ClearFocus
();
}
}
/**
/**
...
...
test/unittest/font/ui_font_unit_test.cpp
浏览文件 @
b963df17
...
@@ -80,7 +80,6 @@ HWTEST_F(UIFontTest, Graphic_Font_Test_GetInstance_001, TestSize.Level0)
...
@@ -80,7 +80,6 @@ HWTEST_F(UIFontTest, Graphic_Font_Test_GetInstance_001, TestSize.Level0)
*/
*/
HWTEST_F
(
UIFontTest
,
Graphic_Font_Test_IsVectorFont_001
,
TestSize
.
Level1
)
HWTEST_F
(
UIFontTest
,
Graphic_Font_Test_IsVectorFont_001
,
TestSize
.
Level1
)
{
{
UIFont
::
GetInstance
()
->
SetFont
(
font_
);
#if ENABLE_VECTOR_FONT
#if ENABLE_VECTOR_FONT
bool
ret
=
UIFont
::
GetInstance
()
->
IsVectorFont
();
bool
ret
=
UIFont
::
GetInstance
()
->
IsVectorFont
();
EXPECT_EQ
(
ret
,
true
);
EXPECT_EQ
(
ret
,
true
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录