Add filament color next to tab button in filament setting

This commit is contained in:
Lam Wei Lun
2026-08-14 16:50:33 +08:00
parent 76ec2f10c6
commit 92123cdc2c
6 changed files with 79 additions and 9 deletions
+16
View File
@@ -84,6 +84,7 @@ void TabCtrl::Rescale()
{
for (auto & b : btns)
b->Rescale();
relayout();
}
bool TabCtrl::SetFont(wxFont const& font)
@@ -117,6 +118,13 @@ int TabCtrl::AppendItem(const wxString &item,
return btns.size() - 1;
}
int TabCtrl::AppendItem(const wxString& item, const wxBitmap& bitmap, void* clientData)
{
const int index = AppendItem(item, -1, -1, clientData);
SetItemBitmap(index, bitmap);
return index;
}
bool TabCtrl::DeleteItem(int item)
{
if (item < 0 || item >= btns.size()) {
@@ -170,6 +178,14 @@ void TabCtrl::SetItemText(unsigned int item, wxString const &value)
btns[item]->SetLabel(value);
}
void TabCtrl::SetItemBitmap(unsigned int item, const wxBitmap& bitmap)
{
if (item >= btns.size())
return;
btns[item]->SetBitmap(bitmap);
relayout();
}
bool TabCtrl::GetItemBold(unsigned int item) const
{
if (item >= btns.size()) return false;