From 1e340211beb0b9d7cec7a8e4282a2f2ab5d4e29f Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Thu, 4 Jun 2009 12:13:49 +0200 Subject: [PATCH] add config option to disable text scrolling in header window --- doc/config | 2 ++ doc/ncmpcpp.1 | 3 +++ src/helpers.cpp | 2 ++ src/settings.cpp | 5 +++++ src/settings.h | 1 + 5 files changed, 13 insertions(+) diff --git a/doc/config b/doc/config index e13a0377..8f8d5e59 100644 --- a/doc/config +++ b/doc/config @@ -147,6 +147,8 @@ # #statusbar_visibility = "yes" # +#header_text_scrolling = "yes" +# #fancy_scrolling = "yes" # #cyclic_scrolling = "no" diff --git a/doc/ncmpcpp.1 b/doc/ncmpcpp.1 index 917208ee..bce84126 100644 --- a/doc/ncmpcpp.1 +++ b/doc/ncmpcpp.1 @@ -120,6 +120,9 @@ One of colors used in Song info, Tiny tag editor and Search engine. .B colors_enabled = yes/no No need to describe it, huh? .TP +.B header_text_scrolling = yes/no +If enabled, text in header window will scroll if its length is longer then actual screen width, otherwise it won't. +.TP .B fancy_scrolling = yes/no If enabled, content of other columns will be updated immediately while scrolling, otherwise only after you stop scrolling. .TP diff --git a/src/helpers.cpp b/src/helpers.cpp index 363a3e65..fa31b03e 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -333,6 +333,8 @@ const std::basic_string &Scroller(const string &str, size_t width, si static std::basic_string result; result.clear(); std::basic_string s = TO_WSTRING(str); + if (!Config.header_text_scrolling) + return (result = s); size_t len; # ifdef _UTF8 len = Window::Length(s); diff --git a/src/settings.cpp b/src/settings.cpp index fe91ac22..3e2650d9 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -263,6 +263,7 @@ void DefaultConfiguration(ncmpcpp_config &conf) conf.columns_in_browser = false; conf.columns_in_search_engine = false; conf.header_visibility = true; + conf.header_text_scrolling = true; conf.statusbar_visibility = true; conf.autocenter_mode = false; conf.wrapped_search = true; @@ -616,6 +617,10 @@ void ReadConfiguration(ncmpcpp_config &conf) { conf.header_visibility = v == "yes"; } + else if (cl.find("header_text_scrolling") != string::npos) + { + conf.header_text_scrolling = v == "yes"; + } else if (cl.find("statusbar_visibility") != string::npos) { conf.statusbar_visibility = v == "yes"; diff --git a/src/settings.h b/src/settings.h index dc6d279e..6798c385 100644 --- a/src/settings.h +++ b/src/settings.h @@ -154,6 +154,7 @@ struct ncmpcpp_config bool columns_in_search_engine; bool set_window_title; bool header_visibility; + bool header_text_scrolling; bool statusbar_visibility; bool autocenter_mode; bool wrapped_search;