Merge pull request #532 from afh/afh-fix-muted-time-tracker-width

Fix width of time tracker when muted
This commit is contained in:
casey langen 2022-07-21 20:00:04 -07:00 committed by GitHub
commit efd3138ef9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -783,8 +783,9 @@ void TransportWindow::Update(TimeMode timeMode) {
const std::string replayGain = replayGainEnabled ? "rg" : "";
int const escapedPercentSignWidth = (muted ? 0 : 1); /* 1 for escaped percent sign when not muted */
int const bottomRowControlsWidth =
displayCache.Columns(volume) - (muted ? 0 : 1) + /* -1 for escaped percent sign when not muted */
displayCache.Columns(volume) - escapedPercentSignWidth +
(replayGainEnabled ? (narrow_cast<int>(u8cols(replayGain)) + 4) : 0) + /* [] brackets */
narrow_cast<int>(u8cols(currentTime)) + 1 + /* +1 for space padding */
/* timer track with thumb */
@ -793,7 +794,8 @@ void TransportWindow::Update(TimeMode timeMode) {
int const timerTrackWidth =
this->GetContentWidth() -
bottomRowControlsWidth - 1; /* this `- 1` is a hack i don't know why we need it please send help */
bottomRowControlsWidth -
escapedPercentSignWidth;
thumbOffset = 0;