@@ -22,6 +22,7 @@ ChartsWidget::ChartsWidget(QWidget *parent) : QWidget(parent) {
22
22
// toolbar
23
23
QToolBar *toolbar = new QToolBar (tr (" Charts" ), this );
24
24
toolbar->setIconSize ({16 , 16 });
25
+ toolbar->setToolButtonStyle (Qt::ToolButtonTextBesideIcon);
25
26
26
27
QAction *new_plot_btn = toolbar->addAction (utils::icon (" file-plus" ), " " );
27
28
new_plot_btn->setToolTip (tr (" New Plot" ));
@@ -45,7 +46,7 @@ ChartsWidget::ChartsWidget(QWidget *parent) : QWidget(parent) {
45
46
range_slider_action = toolbar->addWidget (range_slider);
46
47
47
48
reset_zoom_btn = toolbar->addAction (utils::icon (" zoom-out" ), " " );
48
- reset_zoom_btn->setToolTip (tr (" Reset zoom (drag on chart to zoom X-Axis) " ));
49
+ reset_zoom_btn->setToolTip (tr (" Reset zoom" ));
49
50
remove_all_btn = toolbar->addAction (utils::icon (" x" ), " " );
50
51
remove_all_btn->setToolTip (tr (" Remove all charts" ));
51
52
dock_btn = toolbar->addAction (" " );
@@ -161,9 +162,10 @@ void ChartsWidget::setMaxChartRange(int value) {
161
162
void ChartsWidget::updateToolBar () {
162
163
title_label->setText (tr (" Charts: %1" ).arg (charts.size ()));
163
164
range_lb->setText (QString (" Range: %1:%2 " ).arg (max_chart_range / 60 , 2 , 10 , QLatin1Char (' 0' )).arg (max_chart_range % 60 , 2 , 10 , QLatin1Char (' 0' )));
164
- reset_zoom_btn->setVisible (is_zoomed);
165
165
range_lb_action->setVisible (!is_zoomed);
166
166
range_slider_action->setVisible (!is_zoomed);
167
+ reset_zoom_btn->setVisible (is_zoomed);
168
+ reset_zoom_btn->setText (is_zoomed ? tr (" Zoomin: %1-%2" ).arg (zoomed_range.first , 0 , ' f' , 2 ).arg (zoomed_range.second , 0 , ' f' , 2 ) : " " );
167
169
remove_all_btn->setEnabled (!charts.isEmpty ());
168
170
dock_btn->setIcon (utils::icon (docking ? " arrow-up-right-square" : " arrow-down-left-square" ));
169
171
dock_btn->setToolTip (docking ? tr (" Undock charts" ) : tr (" Dock charts" ));
0 commit comments