Clean-up uses of statsEnabled()

This commit is contained in:
Jean-Marc Lasgouttes 2024-10-21 15:43:07 +02:00
parent ac018b0304
commit 9bc7d64140

View File

@ -1062,7 +1062,7 @@ bool GuiView::restoreLayout()
word_count_enabled_ = settings.value("word_count_enabled", true).toBool();
char_count_enabled_ = settings.value("char_count_enabled", true).toBool();
char_nb_count_enabled_ = settings.value("char_nb_count_enabled", true).toBool();
stat_counts_->setVisible(word_count_enabled_ || char_count_enabled_ || char_nb_count_enabled_);
stat_counts_->setVisible(statsEnabled());
if (guiApp->platformName() == "xcb") {
QPoint pos = settings.value("pos", QPoint(50, 50)).toPoint();
@ -5176,16 +5176,13 @@ bool GuiView::lfunUiToggle(string const & ui_component)
zoom_widget_->setVisible(!zoom_widget_->isVisible());
} else if (ui_component == "statistics-w") {
word_count_enabled_ = !word_count_enabled_;
if (statsEnabled())
showStats();
showStats();
} else if (ui_component == "statistics-cb") {
char_count_enabled_ = !char_count_enabled_;
if (statsEnabled())
showStats();
showStats();
} else if (ui_component == "statistics-c") {
char_nb_count_enabled_ = !char_nb_count_enabled_;
if (statsEnabled())
showStats();
showStats();
} else if (ui_component == "frame") {
int const l = contentsMargins().left();