189 {
190
191 canvas.setPen(0, PenStyle.NoPen, 0);
192
193 double padding =
dip2px(5);
194 QPainter.Paint paint = new QPainter.Paint();
195
196
198
199 double subwidth =
dip2px(12);
200 double subheight =
dip2px(3);
201 double minCenterY = padding + (subheight * 2.f);
202 double subCenterX =
width() / 2.f;
203 double subCenterY =
Math.
max(minCenterY,
height() * 2.f / 5.f);
204 if (_bShowResult) {
205 if (_bResult) {
206 DrawComplete(canvas,padding,paint,subCenterX,subCenterY,minCenterY,subwidth,subheight);
207 } else {
208 DrawFatal(canvas,padding,paint,subCenterX,subCenterY,minCenterY,subwidth,subheight);
209 }
210 } else {
211 DrawWaiting(canvas,padding,paint,subCenterX,subCenterY,minCenterY,subwidth,subheight);
212 }
213
215 double textX = subCenterX - (
_textWidth / 2.f);
216 double textY = (subCenterY + (subwidth * 1.75f)) + (((
height() - padding) - (subCenterY + (subwidth * 1.75f))) / 2);
217
218
219 if (_bShowProgress) {
220 textY = subCenterY + (subwidth * 1.75f) + (_textHeight * 1.2f) ;
221 }
222 canvas.drawText(_titleText, (int)textX, (int)(textY + (_textHeight * 0.8f)), paint);
223
224 paint.setColor(0xbfffffff);
225
226 if (_bShowProgress) {
227 double progressCX = (
width() - padding) * 2 / 3;
228 double progressCY = progressCX / 12.f;
229 if (progressCY == 0) {
231 }
232 double progressX = subCenterX - (
width() - padding) / 3;
233 double progressY = ((textY) + ((
height() - padding) - (textY)) / 2.f) - (progressCY / 2.f);
234 drawProgress(canvas,padding,paint,progressX,progressY,progressCX,progressCY);
235 }
236 }
void calcTitlePosition(@NotNilptr QPainter canvas,double padding,@NotNilptr QPainter.Paint paint)
void DrawWaiting(@NotNilptr QPainter canvas,double padding,@NotNilptr QPainter.Paint paint,double subCenterX, double subCenterY,double minCenterY,double subwidth,double subheight)
void DrawFatal(@NotNilptr QPainter canvas,double padding,@NotNilptr QPainter.Paint paint,double subCenterX, double subCenterY,double minCenterY,double subwidth,double subheight)
void onDrawBackground(@NotNilptr QPainter canvas, double padding, @NotNilptr QPainter.Paint paint)
void drawProgress(@NotNilptr QPainter canvas,double padding, @NotNilptr QPainter.Paint paint,double progressX,double progressY, double progressCX,double progressCY)
void DrawComplete(@NotNilptr QPainter canvas,double padding,@NotNilptr QPainter.Paint paint,double subCenterX, double subCenterY,double minCenterY,double subwidth,double subheight)