From fb080f6fb911b1831c176a06259e384772541dd5 Mon Sep 17 00:00:00 2001 From: HampusM Date: Mon, 2 May 2022 22:36:21 +0200 Subject: refactor: seperate statusline related concerns --- src/commands/toggle_pause.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/commands/toggle_pause.cpp') diff --git a/src/commands/toggle_pause.cpp b/src/commands/toggle_pause.cpp index 434330e..54682c6 100644 --- a/src/commands/toggle_pause.cpp +++ b/src/commands/toggle_pause.cpp @@ -5,10 +5,10 @@ TogglePauseCommand::TogglePauseCommand( std::shared_ptr generation_tracker, - std::shared_ptr statusline + std::shared_ptr status_manager ) noexcept : _generation_tracker(std::move(generation_tracker)), - _statusline(std::move(statusline)) + _status_manager(std::move(status_manager)) { } @@ -18,12 +18,5 @@ void TogglePauseCommand::execute() noexcept _generation_tracker->set_is_paused(onoff); - _statusline->set_status( - StatusLineSection::B, - fmt::format( - "Paused: {} Generation: {}", - _generation_tracker->get_is_paused() ? "yes" : "no", - _generation_tracker->get_current_generation() - ) - ); + _status_manager->set_section_body(StatusLineSection::D, onoff ? "yes" : "no"); } -- cgit v1.2.3-18-g5258