mirror of
https://github.com/lc-soft/LCUI.git
synced 2026-11-30 16:48:21 +01:00
test: add test for absolutely positioned progress bar
This commit is contained in:
@@ -155,6 +155,14 @@ static void test_inline_block_nesting(void)
|
||||
&w->box.border, &rect);
|
||||
}
|
||||
|
||||
static void test_absolutely_positioned_progress_bar(void)
|
||||
{
|
||||
LCUI_Widget w;
|
||||
|
||||
w = LCUIWidget_GetById("example-progress-bar__bar");
|
||||
it_i("It should have the correct width", (int)w->width, (int)(w->parent->box.content.width * 0.5));
|
||||
}
|
||||
|
||||
static void test_block_layout_1280(void)
|
||||
{
|
||||
LCUI_Widget w;
|
||||
@@ -418,6 +426,8 @@ static void test_block_layout_1280(void)
|
||||
describe("test auto size", test_auto_size);
|
||||
describe("test dropdown", test_dropdown);
|
||||
describe("test inline block nesting", test_inline_block_nesting);
|
||||
describe("test absolutely positioned progress bar",
|
||||
test_absolutely_positioned_progress_bar);
|
||||
}
|
||||
|
||||
static void test_block_layout_600(void)
|
||||
|
||||
@@ -286,3 +286,23 @@ textview, body {
|
||||
right: 5px;
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
#example-progress-bar .message-box {
|
||||
padding: 15px 25px;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
#example-progress-bar .progress {
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 10px;
|
||||
position: absolute;
|
||||
background-color: #f0f0f0;
|
||||
}
|
||||
|
||||
#example-progress-bar .progress-bar {
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
background-color: #7cbbff;
|
||||
}
|
||||
|
||||
@@ -141,6 +141,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="example" id="example-progress-bar">
|
||||
<div class="example__title">(5) Absolutely positioned progress bar</div>
|
||||
<div class="example__content">
|
||||
<div class="message-box">
|
||||
<div>loading...</div>
|
||||
<div class="progress">
|
||||
<div class="progress-bar" id="progressbar"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -141,6 +141,17 @@
|
||||
</w>
|
||||
</w>
|
||||
</w>
|
||||
<w class="example" id="example-progress-bar">
|
||||
<textview class="example__title">(5) Absolutely positioned progress bar</textview>
|
||||
<w class="example__content">
|
||||
<w class="message-box">
|
||||
<textview>loading...</textview>
|
||||
<w class="progress">
|
||||
<w class="progress-bar" id="example-progress-bar__bar"></w>
|
||||
</w>
|
||||
</w>
|
||||
</w>
|
||||
</w>
|
||||
</w>
|
||||
</w>
|
||||
<scrollbar target="main" />
|
||||
|
||||
Reference in New Issue
Block a user