Example #1
0
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);
	}
}
Example #2
0
void SNM_SkinKnob(SNM_Knob* _knob)
{
	static WDL_VirtualSlider_SkinConfig sSkin;
	IconTheme* it = SNM_GetIconTheme(true); // true: knobs are ~recent (v4)
	if (it && it->knob.bgimage)
	{
		WDL_VirtualSlider_PreprocessSkinConfig(&sSkin);
		_knob->SetSkinImageInfo(&sSkin, &it->knob, &it->knob_sm);
	}
	else 
		_knob->SetSkinImageInfo(NULL); // important: would crash when switching theme..
}
Example #3
0
///////////////////////////////////////////////////////////////////////////////////////////////////
/// Arrange/TCP
///////////////////////////////////////////////////////////////////////////////////////////////////
int GetTcpEnvMinHeight()
{
	if (IconTheme* it = SNM_GetIconTheme())
		return it->envcp_min_height;
	return 0;
}
Example #4
0
int GetTcpTrackMinHeight()
{
	if (IconTheme* it = SNM_GetIconTheme())
		return it->tcp_small_height;
	return 0;
}