forked from Ivasoft/DSView
fix: The toolbar text unable to fully display
This commit is contained in:
@@ -116,6 +116,8 @@ void FileBar::retranslateUi()
|
||||
_action_save->setText(L_S(STR_PAGE_TOOLBAR, S_ID(IDS_TOOLBAR_FILE_SAVE), "&Save..."));
|
||||
_action_export->setText(L_S(STR_PAGE_TOOLBAR, S_ID(IDS_TOOLBAR_FILE_EXPORT), "&Export..."));
|
||||
_action_capture->setText(L_S(STR_PAGE_TOOLBAR, S_ID(IDS_TOOLBAR_FILE_CAPTURE), "&Capture..."));
|
||||
|
||||
auto_resize();
|
||||
}
|
||||
|
||||
void FileBar::reStyle()
|
||||
@@ -253,5 +255,16 @@ void FileBar::update_view_status()
|
||||
_menu_session->setEnabled(bEnable && is_hardware);
|
||||
}
|
||||
|
||||
void FileBar::auto_resize()
|
||||
{
|
||||
std::vector<QToolButton*> wids;
|
||||
wids.push_back(&_file_button);
|
||||
|
||||
for(auto bt : wids){
|
||||
int w = bt->fontMetrics().boundingRect(bt->text()).width();
|
||||
bt->setMinimumWidth(w+5);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace toolbars
|
||||
} // namespace pv
|
||||
|
||||
@@ -46,6 +46,8 @@ public:
|
||||
|
||||
QString genDefaultSessionFile();
|
||||
|
||||
void auto_resize();
|
||||
|
||||
private:
|
||||
void changeEvent(QEvent *event);
|
||||
void retranslateUi();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -100,6 +100,8 @@ namespace pv
|
||||
|
||||
void commit_settings();
|
||||
|
||||
void auto_resize();
|
||||
|
||||
signals:
|
||||
void sig_store_session_data();
|
||||
|
||||
|
||||
@@ -153,6 +153,8 @@ void TrigBar::retranslateUi()
|
||||
_action_math->setText(L_S(STR_PAGE_TOOLBAR, S_ID(IDS_TOOLBAR_FUNCTION_MATH), "Math"));
|
||||
|
||||
_action_dispalyOptions->setText(L_S(STR_PAGE_TOOLBAR, S_ID(IDS_TOOLBAR_DISPLAY_OPTIONS), "Options"));
|
||||
|
||||
auto_resize();
|
||||
}
|
||||
|
||||
void TrigBar::reStyle()
|
||||
@@ -343,5 +345,20 @@ void TrigBar::on_actionLissajous_triggered()
|
||||
}
|
||||
}
|
||||
|
||||
void TrigBar::auto_resize()
|
||||
{
|
||||
std::vector<QToolButton*> wids;
|
||||
wids.push_back(&_trig_button);
|
||||
wids.push_back(&_protocol_button);
|
||||
wids.push_back(&_measure_button);
|
||||
wids.push_back(&_search_button);
|
||||
wids.push_back(&_setting_button);
|
||||
|
||||
for(auto bt : wids){
|
||||
int w = bt->fontMetrics().boundingRect(bt->text()).width();
|
||||
bt->setMinimumWidth(w+5);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace toolbars
|
||||
} // namespace pv
|
||||
|
||||
@@ -46,6 +46,7 @@ public:
|
||||
explicit TrigBar(SigSession *session, QWidget *parent = 0);
|
||||
void reload();
|
||||
void update_view_status();
|
||||
void auto_resize();
|
||||
|
||||
private:
|
||||
void changeEvent(QEvent *event);
|
||||
|
||||
Reference in New Issue
Block a user