Esempio n. 1
0
void FileTabs::ComposeStackedTab(Tab& tab, const Tab& stacked_tab, const Font &font, Color ink, int style)
{
	tab.AddImage(TabBarImg::STSEP);

	if (stackedicons && tab.HasIcon()) {
		tab.AddImage(style == CTRL_HOT ? stacked_tab.img : (greyedicons ? DisabledImage(stacked_tab.img) : stacked_tab.img))
			.Clickable();
	}
	else {
		WString txt = IsString(stacked_tab.value) ? stacked_tab.value : StdConvert().Format(stacked_tab.value);
		int extpos = txt.ReverseFind('.');
	
		Color c = (style == CTRL_HOT) ? extcolor : SColorDisabled();
		if (extpos >= 0) {
			tab.AddText(
				txt.Mid(extpos + 1),
				font,
				c
			).Clickable();
		}
		else {
			tab.AddText("-", font, c).Clickable();
		}
	}
}
Esempio n. 2
0
Size FileTabs::GetStackedSize(const Tab &t)
{
	if (stackedicons && t.HasIcon())
		return min(t.img.GetSize(), Size(TB_ICON, TB_ICON)) + Size(TB_SPACEICON, 0) + 5;

	WString txt = IsString(t.value) ? t.value : StdConvert().Format(t.value);
	int extpos = txt.ReverseFind('.');
	txt = extpos >= 0 ? txt.Mid(extpos + 1) : "-";
	return GetTextSize(txt, GetStyle().font) + Size(TabBarImg::STSEP().GetSize().cx, 0);
}