FIX: alignment of tabpanel text

Change-Id: I3c653a2100ee0d1911fad727a059c82b5866456f
This commit is contained in:
liz.li 2023-07-05 15:48:26 +08:00 committed by Lane.Wei
parent 0162fceb98
commit 4831506422
6 changed files with 23 additions and 1 deletions

View file

@ -486,6 +486,9 @@ void CalibrationPanel::init_tabpanel() {
for (int i = 0; i < (int)CALI_MODE_COUNT; i++) for (int i = 0; i < (int)CALI_MODE_COUNT; i++)
m_tabpanel->SetPageImage(i, ""); m_tabpanel->SetPageImage(i, "");
auto padding_size = m_tabpanel->GetBtnsListCtrl()->GetPaddingSize(0);
m_tabpanel->GetBtnsListCtrl()->SetPaddingSize({ FromDIP(15), padding_size.y });
m_initialized = true; m_initialized = true;
} }

View file

@ -169,7 +169,7 @@ CaliPageButton::CaliPageButton(wxWindow* parent, CaliPageActionType type, wxStri
this->SetLabel(_L("Manage Result")); this->SetLabel(_L("Manage Result"));
break; break;
case CaliPageActionType::CALI_ACTION_MANUAL_CALI: case CaliPageActionType::CALI_ACTION_MANUAL_CALI:
this->SetLabel(_L("Maual Calibration")); this->SetLabel(_L("Manual Calibration"));
this->SetToolTip(_L("Result can be read by human eyes.")); this->SetToolTip(_L("Result can be read by human eyes."));
break; break;
case CaliPageActionType::CALI_ACTION_AUTO_CALI: case CaliPageActionType::CALI_ACTION_AUTO_CALI:

View file

@ -71,6 +71,11 @@ void TabButton::SetPaddingSize(const wxSize &size)
messureSize(); messureSize();
} }
const wxSize& TabButton::GetPaddingSize()
{
return paddingSize;
}
void TabButton::SetTextColor(StateColor const &color) void TabButton::SetTextColor(StateColor const &color)
{ {
text_color = color; text_color = color;

View file

@ -28,6 +28,8 @@ public:
void SetPaddingSize(const wxSize& size); void SetPaddingSize(const wxSize& size);
const wxSize& GetPaddingSize();
void SetTextColor(StateColor const &color); void SetTextColor(StateColor const &color);
void SetBorderColor(StateColor const &color); void SetBorderColor(StateColor const &color);

View file

@ -176,6 +176,16 @@ wxString TabButtonsListCtrl::GetPageText(size_t n) const
return btn->GetLabel(); return btn->GetLabel();
} }
const wxSize& TabButtonsListCtrl::GetPaddingSize(size_t n) {
return m_pageButtons[n]->GetPaddingSize();
}
void TabButtonsListCtrl::SetPaddingSize(const wxSize& size) {
for (auto& btn : m_pageButtons) {
btn->SetPaddingSize(size);
}
}
//#endif // _WIN32 //#endif // _WIN32

View file

@ -29,6 +29,8 @@ public:
bool SetPageImage(size_t n, const std::string& bmp_name); bool SetPageImage(size_t n, const std::string& bmp_name);
void SetPageText(size_t n, const wxString& strText); void SetPageText(size_t n, const wxString& strText);
wxString GetPageText(size_t n) const; wxString GetPageText(size_t n) const;
const wxSize& GetPaddingSize(size_t n);
void SetPaddingSize(const wxSize& size);
private: private:
wxWindow* m_parent; wxWindow* m_parent;