mirror of
https://github.com/siemens-mobile-hacks/89_theme_engine.git
synced 2026-11-25 21:47:27 +00:00
Inject popup fields
This commit is contained in:
parent
c38e141bb2
commit
7cbdaa2907
3 changed files with 64 additions and 0 deletions
|
|
@ -121,6 +121,15 @@ SKIN_T SKIN = {
|
|||
{CFG_UINT, "Header separator width", 1, 240},
|
||||
226,
|
||||
{CFG_LEVEL, "", 0, 0},
|
||||
}, {
|
||||
{CFG_LEVEL, "Fields", 1, 0},
|
||||
{CFG_COLOR, "Background color", 0, 0},
|
||||
{0x00, 0x00, 0x00, 0x58},
|
||||
{CFG_CHECKBOX, "Border", 0, 1},
|
||||
1,
|
||||
{CFG_COLOR, "Border color", 0, 0},
|
||||
{0xD0, 0x20, 0x20, 0x50},
|
||||
{CFG_LEVEL, "", 0, 0},
|
||||
},
|
||||
{CFG_LEVEL, "", 0, 0},
|
||||
}, {
|
||||
|
|
|
|||
|
|
@ -172,6 +172,20 @@ typedef struct {
|
|||
const CFG_HDR cfghdr_e;
|
||||
} SKIN_POPUP_OPTIONS;
|
||||
|
||||
typedef struct {
|
||||
const CFG_HDR cfghdr_b;
|
||||
const CFG_HDR cfghdr_0;
|
||||
// Background color
|
||||
uint8_t bg_col[4];
|
||||
const CFG_HDR cfghdr_1;
|
||||
// Border
|
||||
int border;
|
||||
const CFG_HDR cfghdr_2;
|
||||
// Border color
|
||||
uint8_t border_col[4];
|
||||
const CFG_HDR cfghdr_e;
|
||||
} SKIN_POPUP_FIELDS;
|
||||
|
||||
typedef struct {
|
||||
const CFG_HDR cfghdr_b;
|
||||
// Blur
|
||||
|
|
@ -194,6 +208,8 @@ typedef struct {
|
|||
uint8_t border_col[4];
|
||||
// Options
|
||||
SKIN_POPUP_OPTIONS options;
|
||||
// Field
|
||||
SKIN_POPUP_FIELDS fields;
|
||||
const CFG_HDR cfghdr_e;
|
||||
} SKIN_POPUP;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@
|
|||
#define POPUP_FEEDBACK_CROP_Y 40
|
||||
#define POPUP_FEEDBACK_CLEAR_W 4
|
||||
#define POPUP_FEEDBACK_CLEAR_H 28
|
||||
#define POPUP_FIELD_CLEAR_H 1
|
||||
#define POPUP_SEARCH_FIELD_CLEAR_W 33
|
||||
|
||||
#define Cs_SetColor(id, rgba) RscMgr_CsSetColor(id - 100, rgba)
|
||||
#define Cs_Update() RscMgr_CsUpdate()
|
||||
|
|
@ -300,6 +302,43 @@ static int ApplyPopups(const IMGHDR* wallpaper) {
|
|||
const int separator_x2 = separator_x + separator_w;
|
||||
IMGHDR_DrawHLine(popup_options, separator_x, POPUP_OPTIONS_SEPARATOR_Y, separator_x2, 0, SKIN.popup.border_col);
|
||||
}
|
||||
// Fields
|
||||
theme_cache_id = TCI_POPUP_SEARCH_FIELD;
|
||||
IMGHDR *popup_search_field = GetIMGHDRFromThemeCache(theme_cache_id);
|
||||
if (!popup_search_field) {
|
||||
return theme_cache_id;
|
||||
}
|
||||
if (!InjectImageSolid(popup_search_field, SKIN.popup.fields.bg_col)) {
|
||||
return theme_cache_id;
|
||||
}
|
||||
const int popup_field_clear_bottom_start = popup_search_field->h - 1 - POPUP_FIELD_CLEAR_H;
|
||||
const int popup_field_clear_bottom_end = popup_search_field->h - 1;
|
||||
IMGHDR_TransparentV(popup_search_field, popup_field_clear_bottom_start, popup_field_clear_bottom_end);
|
||||
if (SKIN.popup.fields.border) {
|
||||
IMGHDR_DrawBorder(popup_search_field,
|
||||
0, 0, popup_search_field->w - 1, popup_field_clear_bottom_start,
|
||||
0, SKIN.popup.fields.border_col);
|
||||
}
|
||||
theme_cache_id = TCI_POPUP_QUICK_ACCESS_FIELD;
|
||||
IMGHDR *popup_quick_access_field = GetIMGHDRFromThemeCache(theme_cache_id);
|
||||
if (!popup_quick_access_field) {
|
||||
return theme_cache_id;
|
||||
}
|
||||
if (!IMGHDR_Clone(popup_quick_access_field, popup_search_field)) {
|
||||
return theme_cache_id;
|
||||
}
|
||||
const int popup_search_field_clear_top_end = 1;
|
||||
const int popup_search_field_clear_left_end = POPUP_SEARCH_FIELD_CLEAR_W;
|
||||
IMGHDR_TransparentV(popup_search_field, 0, popup_search_field_clear_top_end);
|
||||
IMGHDR_TransparentH(popup_search_field, 0, popup_search_field_clear_left_end);
|
||||
if (SKIN.popup.fields.border) {
|
||||
IMGHDR_DrawHLine(popup_search_field,
|
||||
popup_search_field_clear_left_end, popup_search_field_clear_top_end, popup_search_field->w - 1,
|
||||
0, SKIN.popup.fields.border_col);
|
||||
IMGHDR_DrawVLine(popup_search_field,
|
||||
popup_search_field_clear_left_end, popup_search_field_clear_top_end, popup_field_clear_bottom_start,
|
||||
0, SKIN.popup.fields.border_col);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue