6663b6c9
adorian
projet complet av...
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
#include "lock_view.h"
const uint8_t lockMask[LockView::k_lockHeight][LockView::k_lockWidth] = {
{0xFF, 0xE1, 0x0C, 0x00, 0x0C, 0xE1, 0xFF},
{0xFF, 0x0C, 0xE1, 0xFF, 0xE1, 0x0C, 0xFF},
{0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0x00, 0xFF},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00},
};
KDColor s_lockWorkingBuffer[LockView::k_lockHeight*LockView::k_lockWidth];
void LockView::drawRect(KDContext * ctx, KDRect rect) const {
KDRect frame((bounds().width() - k_lockWidth)/2, (bounds().height()-k_lockHeight)/2, k_lockWidth, k_lockHeight);
ctx->blendRectWithMask(frame, KDColorWhite, (const uint8_t *)lockMask, s_lockWorkingBuffer);
}
KDSize LockView::minimalSizeForOptimalDisplay() const {
return KDSize(k_lockWidth, k_lockHeight);
}
|