diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index 89cb65b0..84c52584 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -132,19 +132,15 @@ int main(int argc, char *argv[]) InitScreen("ncmpc++ ver. "VERSION, Config.colors_enabled); - bool real_header_visibility = Config.header_visibility; bool real_statusbar_visibility = Config.statusbar_visibility; if (Config.new_design) - { - Config.header_visibility = 1; Config.statusbar_visibility = 0; - } size_t header_height, footer_start_y, footer_height; SetWindowsDimensions(header_height, footer_start_y, footer_height); - if (Config.header_visibility) + if (Config.header_visibility || Config.new_design) { wHeader = new Window(0, 0, COLS, header_height, "", Config.header_color, brNone); wHeader->Display(); @@ -333,16 +329,7 @@ int main(int argc, char *argv[]) if (Keypressed(input, Key.ToggleInterface)) { Config.new_design = !Config.new_design; - if (Config.new_design) - { - Config.header_visibility = 1; - Config.statusbar_visibility = 0; - } - else - { - Config.header_visibility = real_header_visibility; - Config.statusbar_visibility = real_statusbar_visibility; - } + Config.statusbar_visibility = Config.new_design ? 0 : real_statusbar_visibility; SetWindowsDimensions(header_height, footer_start_y, footer_height); UnlockProgressbar(); UnlockStatusbar(); @@ -452,7 +439,7 @@ int main(int argc, char *argv[]) myScreen->Resize(); - if (Config.header_visibility) + if (Config.header_visibility || Config.new_design) wHeader->Resize(COLS, header_height); footer_start_y = LINES-(Config.statusbar_visibility ? 2 : 1); @@ -468,6 +455,9 @@ int main(int argc, char *argv[]) if (design_changed) changes.Volume = 1; } + // Note: routines for drawing separator if alternative user + // interface is active and header is hidden are placed in + // NcmpcppStatusChanges.StatusFlags changes.StatusFlags = 1; // force status update NcmpcppStatusChanged(&Mpd, changes, 0); if (design_changed) diff --git a/src/status.cpp b/src/status.cpp index 2aeee000..a9855003 100644 --- a/src/status.cpp +++ b/src/status.cpp @@ -554,7 +554,7 @@ void NcmpcppStatusChanged(Connection *, StatusChanges changed, void *) mpd_db_updating = Mpd.GetDBIsUpdating() ? 'U' : 0; ShowMessage(!mpd_db_updating ? "Database update finished!" : "Database update started!"); } - if (changed.StatusFlags && Config.header_visibility) + if (changed.StatusFlags && (Config.header_visibility || Config.new_design)) { std::string switch_state; @@ -569,6 +569,12 @@ void NcmpcppStatusChanged(Connection *, StatusChanges changed, void *) switch_state += mpd_db_updating ? mpd_db_updating : '-'; switch_state += ']'; *wHeader << XY(COLS-switch_state.length(), 1) << fmtBold << Config.state_flags_color << switch_state << clEnd << fmtBoldEnd; + if (Config.new_design && !Config.header_visibility) // in this case also draw separator + { + *wHeader << fmtBold << clBlack; + mvwhline(wHeader->Raw(), 2, 0, 0, COLS); + *wHeader << clEnd << fmtBoldEnd; + } wHeader->Refresh(); } else @@ -603,7 +609,7 @@ void NcmpcppStatusChanged(Connection *, StatusChanges changed, void *) refresh(); } } - if (changed.Volume && Config.header_visibility) + if (changed.Volume && (Config.header_visibility || Config.new_design)) { VolumeState = Config.new_design ? " Vol: " : " Volume: "; int volume = Mpd.GetVolume();