• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2020-2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "themes/theme.h"
17 #include "components/root_view.h"
18 #include "components/ui_view.h"
19 
20 namespace OHOS {
Theme()21 Theme::Theme()
22 {
23     InitBasicStyle();
24     InitButtonStyle();
25     InitLabelStyle();
26     InitPickerStyle();
27     InitProgressStyle();
28     InitSliderStyle();
29 };
30 
InitBasicStyle()31 void Theme::InitBasicStyle()
32 {
33     basicStyle_ = StyleDefault::GetDefaultStyle();
34 }
35 
InitButtonStyle()36 void Theme::InitButtonStyle()
37 {
38     buttonStyle_.released = StyleDefault::GetButtonReleasedStyle();
39     buttonStyle_.pressed = StyleDefault::GetButtonPressedStyle();
40 }
41 
InitLabelStyle()42 void Theme::InitLabelStyle()
43 {
44     labelStyle_ = StyleDefault::GetLabelStyle();
45 }
46 
InitPickerStyle()47 void Theme::InitPickerStyle()
48 {
49     pickerBackgroundStyle_ = StyleDefault::GetPickerBackgroundStyle();
50     pickerHighlightStyle_ = StyleDefault::GetPickerHighlightStyle();
51 }
52 
InitProgressStyle()53 void Theme::InitProgressStyle()
54 {
55     progressBackgroundStyle_ = StyleDefault::GetProgressBackgroundStyle();
56     progressForegroundStyle_ = StyleDefault::GetProgressForegroundStyle();
57 }
58 
InitSliderStyle()59 void Theme::InitSliderStyle()
60 {
61     sliderKnobStyle_ = StyleDefault::GetPickerBackgroundStyle();
62 }
63 } // namespace OHOS