@
目录获取MMITHEME_GetSoftkeyStyle 样式
样式都是从这个地方获取的,在这函数里面 可以直接对背景图片,字体颜色等统一进行修订,根据不同的情况进行使用
PUBLIC BOOLEAN MMITHEME_GetSoftkeyStyle(MMI_SOFTKEY_STYLE_T* softkey_style_ptr)
{
if (PNULL == softkey_style_ptr) {
return FALSE;
}
SCI_MEMSET(softkey_style_ptr, 0x00, sizeof(MMI_SOFTKEY_STYLE_T));
softkey_style_ptr->bg_type = GUI_SOFTKEY_BG_IMAGE_ONLY;
#ifdef MONOCHROME_LCD_SUPPORT
softkey_style_ptr->bg_image = 0; //背景图片
softkey_style_ptr->bg_color = MMI_WHITE_COLOR;
#else
softkey_style_ptr->bg_image = IMAGE_SOFTKEY_BG; //背景图片
softkey_style_ptr->bg_color = MMI_BACKGROUND_COLOR;
#endif // syy modify 2010.11.30 -end
softkey_style_ptr->font_color = MMITHEME_GetCurThemeFontColor(MMI_THEME_SOFTKEY_FONT); //字体颜色
softkey_style_ptr->pressed_font_color = MMITHEME_GetCurThemeFontColor(MMI_THEME_SOFTKEY_PRESSED); //字体颜色
#ifdef HX_MMI_IDLE_SOFTKEY_FONT_BLACK_COLOR
softkey_style_ptr->font_color = MMI_BACKGROUND_COLOR;
softkey_style_ptr->pressed_font_color = MMI_BACKGROUND_COLOR;
#endif
softkey_style_ptr->font = MMI_FULLSCREEN_SOFTKEY_TEXT_FONT; //字体,这个参加暂时没用上,softkey实时去取
softkey_style_ptr->first_icon_offset = MMI_SOFTKEYBAR_FIRST_ICON_POS; // 第一个图标的偏移量
softkey_style_ptr->second_icon_offset = MMI_SOFTKEYBAR_SECOND_ICON_POS; // 第二个图标的偏移量
softkey_style_ptr->third_icon_offset = MMI_SOFTKEYBAR_THIRD_ICON_POS; // 第三个图标的偏移量
#ifdef MONOCHROME_LCD_SUPPORT
#else
#ifndef GUIF_SOFTKEY_PDASTYLE
softkey_style_ptr->skb_button[LEFT_BUTTON].icon_up_id = IMAGE_SOFTKEY_BG;
softkey_style_ptr->skb_button[MIDDLE_BUTTON].icon_up_id = IMAGE_SOFTKEY_BG;
softkey_style_ptr->skb_button[RIGHT_BUTTON].icon_up_id = IMAGE_SOFTKEY_BG;
softkey_style_ptr->skb_button[LEFT_BUTTON].icon_down_id = IMAGE_SOFTKEY_BG_DOWN;
softkey_style_ptr->skb_button[MIDDLE_BUTTON].icon_down_id = IMAGE_SOFTKEY_BG_DOWN;
softkey_style_ptr->skb_button[RIGHT_BUTTON].icon_down_id = IMAGE_SOFTKEY_BG_DOWN;
#endif
#endif // syy modify 2010.11.30 -end
softkey_style_ptr->skb_button[LEFT_BUTTON].rect = MMITHEME_GetSoftkeyRect(LEFT_BUTTON);
softkey_style_ptr->skb_button[MIDDLE_BUTTON].rect = MMITHEME_GetSoftkeyRect(MIDDLE_BUTTON);
softkey_style_ptr->skb_button[RIGHT_BUTTON].rect = MMITHEME_GetSoftkeyRect(RIGHT_BUTTON);
softkey_style_ptr->skb_button[LEFT_BUTTON].is_show = TRUE;
softkey_style_ptr->skb_button[MIDDLE_BUTTON].is_show = TRUE;
softkey_style_ptr->skb_button[RIGHT_BUTTON].is_show = TRUE;
return (TRUE);
}
Softkey 图标显示
这两个函数决定界面上是否进行图标的显示
PUBLIC BOOLEAN MMIIDLE_NotificationUpdateSoftkey(void)
{
BOOLEAN is_notification_softkey_focus = FALSE;
MMI_HANDLE_T idle_win_handle = MMK_ConvertIdToHandle(MAIN_IDLE_WIN_ID);
MMI_CTRL_ID_T ctrl_id = MMK_GetActiveCtrlId(idle_win_handle);
MMI_SOFTKEY_STYLE_T softkey_style = {0};
GUIFORM_CHILD_DISPLAY_E child_list_display_type = GUIFORM_CHILD_DISP_MAX;
GUIFORM_CHILD_DISPLAY_E child_music_display_type = GUIFORM_CHILD_DISP_MAX;
GUIFORM_CHILD_DISPLAY_E child_fm_display_type = GUIFORM_CHILD_DISP_MAX;
GUIFORM_GetChildDisplay(MMIIDLE_NOTI_PARENT_FORM_CTRL_ID, MMIIDLE_PUSH_MSG_LIST_CTRL_ID, &child_list_display_type);
GUIFORM_GetChildDisplay(MMIIDLE_NOTI_PARENT_FORM_CTRL_ID, MMIIDLE_FM_FORM_CTRL_ID, &child_fm_display_type);
GUIFORM_GetChildDisplay(MMIIDLE_NOTI_PARENT_FORM_CTRL_ID, MMIIDLE_MUSIC_FORM_CTRL_ID, &child_music_display_type);
MMITHEME_GetSoftkeyStyle(&softkey_style);
GUIWIN_SetSoftkeyStyle(idle_win_handle,
softkey_style.font_color,
softkey_style.bg_type,
softkey_style.bg_color,
IMAGE_NULL);
if(GUIFORM_CHILD_DISP_HIDE == child_list_display_type
&& GUIFORM_CHILD_DISP_HIDE == child_music_display_type
&& GUIFORM_CHILD_DISP_HIDE == child_fm_display_type
)
{
MMK_WinInactiveCtrl(MAIN_IDLE_WIN_ID, FALSE);
if((MMIIDLE_IsUnlockedIn30s() || (IDLE_UNLOCKED == MMIIDLE_GetLockStatus())) && (FALSE == MMIDEFAULT_IsKeylockByStarKey()))
{
GUIWIN_SeSoftkeytButtonTextId(idle_win_handle, TXT_IDLE_MAINMENU, MIDDLE_BUTTON, TRUE);
DisplaySoftkeyShortcut();
}
else
{
#ifndef HX_MMI_IDLE_STYLE_CUST_6872
DisplaySoftkeyShortcut(); //在这个函数里面决定否显示图标
GUIWIN_SeSoftkeytButtonTextId(idle_win_handle, TXT_IDLE_UNLOCK, MIDDLE_BUTTON, TRUE);
#else
GUIWIN_SetSoftkeyTextId(idle_win_handle,TXT_IDLE_UNLOCK,TXT_NULL,TXT_NULL,TRUE);
#endif
}
//显示shortcut
is_notification_softkey_focus = FALSE;
}
else if(!IsNotificationFocus())
{
if((MMIIDLE_IsUnlockedIn30s() || (IDLE_UNLOCKED == MMIIDLE_GetLockStatus())) && (FALSE == MMIDEFAULT_IsKeylockByStarKey()))
{
// 这里的 MIDDLE_BUTTON 可以设置 按钮显示的位置 当前显示在中间
GUIWIN_SeSoftkeytButtonTextId(idle_win_handle, TXT_IDLE_MAINMENU, MIDDLE_BUTTON, TRUE);
DisplaySoftkeyShortcut();
}
else
{
#ifndef HX_MMI_IDLE_STYLE_CUST_6872
DisplaySoftkeyShortcut();
GUIWIN_SeSoftkeytButtonTextId(idle_win_handle, TXT_IDLE_UNLOCK, MIDDLE_BUTTON, TRUE);
#else
GUIWIN_SetSoftkeyTextId(idle_win_handle,TXT_IDLE_UNLOCK,TXT_NULL,TXT_NULL,TRUE);
#endif
}
is_notification_softkey_focus = FALSE;
}
else if((GUIFORM_CHILD_DISP_HIDE != child_music_display_type && MMIIDLE_MUSIC_PALY_OWNDRAW_CTRL_ID == ctrl_id)
||(GUIFORM_CHILD_DISP_HIDE != child_music_display_type && MMIIDLE_MUSIC_FORM_CTRL_ID == ctrl_id)
|| (GUIFORM_CHILD_DISP_HIDE != child_fm_display_type && MMIIDLE_FM_PALY_ANIM_CTRL_ID == ctrl_id)
||(GUIFORM_CHILD_DISP_HIDE != child_fm_display_type && MMIIDLE_FM_FORM_CTRL_ID == ctrl_id)
)
{
GUIWIN_SeSoftkeytButtonTextId(idle_win_handle, TXT_OPEN_COMN, MIDDLE_BUTTON, TRUE);
GUIWIN_SeSoftkeytButtonTextId(idle_win_handle, TXT_NULL, LEFT_BUTTON, TRUE);
GUIWIN_SeSoftkeytButtonTextId(idle_win_handle, TXT_NULL, RIGHT_BUTTON, TRUE);
is_notification_softkey_focus = TRUE;
}
return is_notification_softkey_focus;
}
LOCAL void DisplaySoftkeyShortcut(void)
{
MMI_HANDLE_T idle_win_handle = MMK_ConvertIdToHandle(MAIN_IDLE_WIN_ID);
MMI_IMAGE_ID_T idle_softkey_icon[2] = {0};
//在这里我们可以发现 从这个地方获取左右图标
idle_softkey_icon[0] = GetSoftkeyIcon(MMISET_FUNCKEY_LEFT);
idle_softkey_icon[1] = GetSoftkeyIcon(MMISET_FUNCKEY_RIGHT);
GUIWIN_SeSoftkeytButtonIconId(idle_win_handle, idle_softkey_icon[0], 0, TRUE);
GUIWIN_SeSoftkeytButtonIconId(idle_win_handle, idle_softkey_icon[1], 2, TRUE);
}
标签:style,BUTTON,40,idle,MMI,softkey,分享,ptr
From: https://www.cnblogs.com/Wei-Ting/p/16741396.html