void SNM_SkinToolbarButton(SNM_ToolbarButton* _btn, const char* _text) { static WDL_VirtualIconButton_SkinConfig sSkin; IconTheme* it = SNM_GetIconTheme(true); // true: blank & overlay images are recent (v4) if (it && it->toolbar_blank) { sSkin.image = it->toolbar_blank; #ifdef _SNM_OVERLAYS // looks bad with some themes (e.g. brawn bespoke) + requires the hack below.. sSkin.olimage = it->toolbar_overlay; #else sSkin.olimage = NULL; #endif WDL_VirtualIconButton_PreprocessSkinConfig(&sSkin); #ifdef _SNM_OVERLAYS // hack for (int i=0; i<4; i++) sSkin.image_ltrb_ol[i] = 0; #endif _btn->SetIcon(&sSkin); _btn->SetForceBorder(false); if (ColorTheme* ct = SNM_GetColorTheme()) _btn->SetForceText(true, !!(_btn->GetPressed()&1) ? LICE_RGBA_FROMNATIVE(ct->toolbar_button_text_on,255) : LICE_RGBA_FROMNATIVE(ct->toolbar_button_text,255)); _btn->SetTextLabel(_text, 0, SNM_GetToolbarFont()); } else { _btn->SetIcon(NULL); // important: would crash when switching theme.. _btn->SetTextLabel(_text, 0, SNM_GetThemeFont()); _btn->SetForceBorder(true); } }
void FindWnd::OnInitDlg() { m_resize.init_item(IDC_EDIT, 0.0, 0.0, 1.0, 0.0); SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_EDIT), GWLP_USERDATA, 0xdeadf00b); // load prefs m_type = GetPrivateProfileInt(FIND_INI_SEC, "Type", 0, g_SNM_IniFn.Get()); m_zoomSrollItems = (GetPrivateProfileInt(FIND_INI_SEC, "ZoomScrollToFoundItems", 0, g_SNM_IniFn.Get()) == 1); LICE_CachedFont* font = SNM_GetThemeFont(); m_vwnd_painter.SetGSC(WDL_STYLE_GetSysColor); m_parentVwnd.SetRealParent(m_hwnd); m_txtScope.SetID(TXTID_SCOPE); m_txtScope.SetFont(font); m_txtScope.SetText(__LOCALIZE("Find in:","sws_DLG_154")); m_parentVwnd.AddChild(&m_txtScope); m_btnEnableZommScroll.SetID(BTNID_ZOOM_SCROLL_EN); m_btnEnableZommScroll.SetTextLabel(__LOCALIZE("Zoom/Scroll","sws_DLG_154"), -1, font); m_btnEnableZommScroll.SetCheckState(m_zoomSrollItems); m_parentVwnd.AddChild(&m_btnEnableZommScroll); m_btnFind.SetID(BTNID_FIND); m_parentVwnd.AddChild(&m_btnFind); m_btnPrev.SetID(BTNID_PREV); m_parentVwnd.AddChild(&m_btnPrev); m_btnNext.SetID(BTNID_NEXT); m_parentVwnd.AddChild(&m_btnNext); m_cbType.SetID(CMBID_TYPE); m_cbType.SetFont(font); m_cbType.AddItem(__LOCALIZE("Item names","sws_DLG_154")); m_cbType.AddItem(__LOCALIZE("Item names (all takes)","sws_DLG_154")); m_cbType.AddItem(__LOCALIZE("Media filenames","sws_DLG_154")); m_cbType.AddItem(__LOCALIZE("Media filenames (all takes)","sws_DLG_154")); m_cbType.AddItem(__LOCALIZE("Item notes","sws_DLG_154")); m_cbType.AddItem(__LOCALIZE("Track names","sws_DLG_154")); m_cbType.AddItem(__LOCALIZE("Track notes","sws_DLG_154")); m_cbType.AddItem(__LOCALIZE("Marker/region names","sws_DLG_154")); m_cbType.SetCurSel(m_type); m_parentVwnd.AddChild(&m_cbType); m_txtResult.SetID(TXTID_RESULT); m_txtResult.SetFont(font); m_txtResult.SetColors(LICE_RGBA(170,0,0,255)); m_parentVwnd.AddChild(&m_txtResult); g_notFound = false; // *g_searchStr = 0; SetDlgItemText(m_hwnd, IDC_EDIT, g_searchStr); m_parentVwnd.RequestRedraw(NULL); }
LICE_CachedFont* SNM_KnobCaption::GetFont() { return #ifdef _SNM_SWELL_ISSUES SNM_GetFont(0); // SWELL issue: native font rendering won't draw multiple lines #else SNM_GetThemeFont(); // i.e. SNM_GetFont(1) #endif }
void SNM_SkinButton(WDL_VirtualIconButton* _btn, WDL_VirtualIconButton_SkinConfig* _skin, const char* _text) { if (_skin && _skin->image) { _btn->SetIcon(_skin); _btn->SetForceBorder(false); } else { _btn->SetIcon(NULL); _btn->SetTextLabel(_text, 0, SNM_GetThemeFont()); _btn->SetForceBorder(true); } }