ENH: hide resolution with only one choice supported

Change-Id: I7ede604fd95e3e11af34ca8465f391e86b1c0c8f
This commit is contained in:
tao.jin 2022-12-10 10:57:41 +08:00 committed by Lane.Wei
parent 6c04bebc3d
commit 61aa0ddada
1 changed files with 6 additions and 3 deletions

View File

@ -259,14 +259,17 @@ void CameraPopup::check_func_supported()
//resolution supported
std::vector<std::string> resolution_supported = m_obj->get_resolution_supported();
auto support_count = resolution_supported.size();
for (int i = 0; i < (int)RESOLUTION_OPTIONS_NUM; ++i){
auto curr_res = to_resolution_msg_string(CameraResolution(i));
std::vector <std::string> ::iterator it = std::find(resolution_supported.begin(), resolution_supported.end(), curr_res);
if (it!= resolution_supported.end())
m_resolution_options[i] -> Show();
else
if ((it == resolution_supported.end())||(support_count <= 1))
m_resolution_options[i] -> Hide();
}
//hide resolution if there is only one choice
if (support_count <= 1) {
m_text_resolution->Hide();
}
}
void CameraPopup::update(bool vcamera_streaming)