mirror of https://github.com/buggins/dlangui.git
implement feature for issue #294 - ProgressBarWidget
This commit is contained in:
parent
db53e39ce3
commit
5ffe5db1e9
|
@ -791,8 +791,15 @@ class ImageDrawable : Drawable {
|
||||||
for (int xx = xx0; xx < rc.right; xx += imgdx) {
|
for (int xx = xx0; xx < rc.right; xx += imgdx) {
|
||||||
Rect dst = Rect(xx, yy, xx + imgdx, yy + imgdy);
|
Rect dst = Rect(xx, yy, xx + imgdx, yy + imgdy);
|
||||||
Rect src = Rect(0, 0, imgdx, imgdy);
|
Rect src = Rect(0, 0, imgdx, imgdy);
|
||||||
if (dst.intersects(rc))
|
if (dst.intersects(rc)) {
|
||||||
buf.drawFragment(dst.left, dst.top, _image.get, src);
|
Rect sr = src;
|
||||||
|
if (dst.right > rc.right)
|
||||||
|
sr.right -= dst.right - rc.right;
|
||||||
|
if (dst.bottom > rc.bottom)
|
||||||
|
sr.bottom -= dst.bottom - rc.bottom;
|
||||||
|
if (!sr.empty)
|
||||||
|
buf.drawFragment(dst.left, dst.top, _image.get, sr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -186,7 +186,7 @@ class ProgressBarWidget : AbstractProgressBar {
|
||||||
int w = animDrawable.width;
|
int w = animDrawable.width;
|
||||||
_animationPhase %= w * 1000;
|
_animationPhase %= w * 1000;
|
||||||
animDrawable.drawTo(buf, rc, 0, cast(int)(_animationPhase * _animationSpeedPixelsPerSecond / 1000), 0);
|
animDrawable.drawTo(buf, rc, 0, cast(int)(_animationPhase * _animationSpeedPixelsPerSecond / 1000), 0);
|
||||||
Log.d("progress animation draw ", _animationPhase, " rc=", rc);
|
//Log.d("progress animation draw ", _animationPhase, " rc=", rc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 246 B |
|
@ -507,13 +507,14 @@
|
||||||
|
|
||||||
<style id="PROGRESS_BAR"
|
<style id="PROGRESS_BAR"
|
||||||
padding="2pt,2pt,2pt,2pt"
|
padding="2pt,2pt,2pt,2pt"
|
||||||
|
margins="2pt,2pt,2pt,2pt"
|
||||||
minWidth="50pt"
|
minWidth="50pt"
|
||||||
minHeight="10pt"
|
minHeight="16pt"
|
||||||
backgroundColor="#D0D0D0"
|
backgroundImageId="progress_bar_background_frame"
|
||||||
padding="1pt,1pt,1pt,1pt">
|
>
|
||||||
<drawable id="progress_bar_gauge" value="#0000FF"/>
|
<drawable id="progress_bar_gauge" value="#4080FF"/>
|
||||||
<drawable id="progress_bar_gauge_animation" value="progress_bar_gauge_animation.tiled"/>
|
<drawable id="progress_bar_gauge_animation" value="progress_bar_gauge_animation.tiled"/>
|
||||||
<drawable id="progress_bar_indeterminate" value="#8080C0"/>
|
<drawable id="progress_bar_indeterminate" value="#80C080"/>
|
||||||
<drawable id="progress_bar_indeterminate_animation" value="progress_bar_gauge_animation.tiled"/>
|
<drawable id="progress_bar_indeterminate_animation" value="progress_bar_gauge_animation.tiled"/>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,7 @@ res/group_box_frame_up_left_dark.9.png
|
||||||
res/group_box_frame_up_right_dark.9.png
|
res/group_box_frame_up_right_dark.9.png
|
||||||
res/slider_background_dark.9.png
|
res/slider_background_dark.9.png
|
||||||
res/progress_bar_gauge_animation.png
|
res/progress_bar_gauge_animation.png
|
||||||
|
res/progress_bar_background_frame.9.png
|
||||||
res/i18n/std_en.ini
|
res/i18n/std_en.ini
|
||||||
res/i18n/std_ru.ini
|
res/i18n/std_ru.ini
|
||||||
res/list_item_background.xml
|
res/list_item_background.xml
|
||||||
|
|
Loading…
Reference in New Issue