Skip to content

Commit ae1757b

Browse files
committed
update terminal tabs style
1 parent 7e536de commit ae1757b

File tree

2 files changed

+14
-29
lines changed

2 files changed

+14
-29
lines changed

entry/src/main/ets/pages/Index.ets

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { webview } from '@kit.ArkWeb';
22
import { FULL_PERCENT } from '../model/TabStyle';
3-
import { TabSheets } from './TabSheetComponent';
3+
import { TabSheets } from './TabSheets';
44
import { TermModel } from '../model/TermModel';
55
import { common } from '@kit.AbilityKit';
66

@@ -49,12 +49,6 @@ struct Index {
4949
controller: this.controller
5050
})
5151

52-
Divider()
53-
.height(1)
54-
.width(FULL_PERCENT)
55-
.color('#222222')
56-
.backgroundColor($r('sys.color.ohos_id_color_subheading_separator_dark'))
57-
5852
Tabs({ barPosition: BarPosition.Start, index: this.focusIndex, controller: this.controller }) {
5953
ForEach(this.tabArray, (item: TermModel, index: number) => {
6054
TabContent() {

entry/src/main/ets/pages/TabSheetComponent.ets renamed to entry/src/main/ets/pages/TabSheets.ets

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export struct TabSheets {
2323
.textOverflow({ overflow: TextOverflow.Clip })
2424
.maxLines(1)
2525
.flexShrink(1)
26+
.padding({ right: 10 })
2627
Stack() {
2728
Image($r('app.media.ic_public_cancel_filled'))
2829
.width(STYLE_CONFIGURATION.ICON_SIZE)
@@ -37,33 +38,19 @@ export struct TabSheets {
3738
}
3839
.flexShrink(1)
3940
.padding({
40-
left: $r('sys.float.ohos_id_elements_margin_horizontal_m'),
41+
left: $r('sys.float.ohos_id_elements_margin_horizontal_l'),
4142
right: $r('sys.float.ohos_id_elements_margin_horizontal_m')
4243
})
43-
.borderRadius($r('sys.float.ohos_id_corner_radius_default_xs'))
44+
.borderRadius({
45+
topLeft: $r('sys.float.ohos_id_corner_radius_default_s'),
46+
topRight: $r('sys.float.ohos_id_corner_radius_default_s')
47+
})
4448
.height(FULL_PERCENT)
45-
.backgroundColor(this.middleIndex === index ? '#222222' : $r('sys.color.ohos_id_color_sub_background'))
49+
.backgroundColor(this.middleIndex === index ? $r('sys.color.ohos_id_color_sub_background') : '#333333')
4650
.onClick(() => {
4751
this.controller.changeIndex(index);
4852
this.focusIndex = index;
4953
})
50-
51-
Stack() {
52-
if (this.middleIndex !== index && this.middleIndex - 1 !== index) {
53-
Divider()
54-
.vertical(true)
55-
.strokeWidth(STYLE_CONFIGURATION.SEPARATOR_STROKE_WIDTH)
56-
.height('50%')
57-
.lineCap(LineCapStyle.Round)
58-
} else {
59-
Divider()
60-
.vertical(true)
61-
.strokeWidth(STYLE_CONFIGURATION.SEPARATOR_STROKE_WIDTH)
62-
.height('50%')
63-
.lineCap(LineCapStyle.Round)
64-
.color($r('sys.color.ohos_id_color_background_transparent'))
65-
}
66-
}
6754
}, (item: TermModel) => 'tab-' + item.id.toString())
6855

6956
if (this.tabArray.length < MAX_TABS) {
@@ -88,8 +75,12 @@ export struct TabSheets {
8875
.hoverEffect(HoverEffect.Highlight)
8976
}
9077
}
91-
.padding(STYLE_CONFIGURATION.TAB_SHEET_PADDING)
92-
.backgroundColor($r('sys.color.ohos_id_color_sub_background'))
78+
.padding({
79+
left: STYLE_CONFIGURATION.TAB_SHEET_PADDING,
80+
right: STYLE_CONFIGURATION.TAB_SHEET_PADDING,
81+
top: STYLE_CONFIGURATION.TAB_SHEET_PADDING
82+
})
83+
.backgroundColor('#333333')
9384
.width(FULL_PERCENT)
9485
.height(STYLE_CONFIGURATION.TAB_BAR_HEIGHT)
9586
}

0 commit comments

Comments
 (0)