2
0
forked from Ivasoft/DSView

fix: The toolbar text unable to fully display

This commit is contained in:
dreamsourcelabTAI
2023-05-08 18:56:44 +08:00
parent 5c286c09d7
commit abe91bcaac
6 changed files with 51 additions and 0 deletions

View File

@@ -214,6 +214,8 @@ namespace pv
_action_single->setText(L_S(STR_PAGE_TOOLBAR, S_ID(IDS_TOOLBAR_CAPTURE_MODE_SINGLE), "&Single"));
_action_repeat->setText(L_S(STR_PAGE_TOOLBAR, S_ID(IDS_TOOLBAR_CAPTURE_MODE_REPEAT), "&Repetitive"));
_action_loop->setText(L_S(STR_PAGE_TOOLBAR, S_ID(IDS_TOOLBAR_CAPTURE_MODE_LOOP), "&Loop"));
auto_resize();
}
void SamplingBar::reStyle()
@@ -1293,5 +1295,19 @@ namespace pv
on_instant_stop();
}
void SamplingBar::auto_resize()
{
std::vector<QToolButton*> wids;
wids.push_back(&_configure_button);
wids.push_back(&_mode_button);
wids.push_back(&_run_stop_button);
wids.push_back(&_instant_button);
for(auto bt : wids){
int w = bt->fontMetrics().boundingRect(bt->text()).width();
bt->setMinimumWidth(w+5);
}
}
} // namespace toolbars
} // namespace pv