...
 
Commits (3)
mbclient (0.9.1) stable; urgency=low
* fix ^C and connection failed handling
* fix background color setting
-- Alexis Pereda <alexis@pereda.fr> Wed, 13 Dec 2017 21:31:02 +0100
mbclient (0.9.0) stable; urgency=low
* Bug fixes:
......
......@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1)
get_filename_component(project_name ${CMAKE_CURRENT_SOURCE_DIR} NAME)
project(${project_name})
set(MBCLIENT_VERSION "0.9.0")
set(MBCLIENT_VERSION "0.9.1")
set(EXTENSION "cpp")
......
Package: mbclient
Version: 0.9.0
Version: 0.9.1
Architecture:
Installed-Size:
Depends: libncursesw5 (>= 5.9), libtinfo5 (>= 5.9), libc6 (>= 2.19), libstdc++6 (>= 4.9), libgcc1 (>= 1:4.9.2)
......
Package: mbclient
Version: 0.9.0
Version: 0.9.1
Architecture:
Installed-Size:
Depends: libncursesw5 (>= 6.0), libtinfo5 (>= 6.0), libc6 (>= 2.24), libstdc++6 (>= 6.0), libgcc1 (>= 1:6.0)
......
......@@ -64,9 +64,11 @@ void Ncurses::initialize() {
Ncurses::call(start_color);
if(_canChangeColors) {
Ncurses::call(init_color, COLOR_BLACK, 0, 0, 0);
Ncurses::call(init_color, T16, 0, 0, 0);
Ncurses::call(init_color, T28, 0, 527, 0);
Ncurses::call(init_color, T88, 527, 0, 0);
Ncurses::call(init_color, T124, 683, 0, 0);
Ncurses::call(init_color, T231, 1000, 1000, 1000);
Ncurses::call(init_color, T237, 227, 227, 227);
for(int bg = Black; bg < Count; ++bg)
......
......@@ -22,9 +22,9 @@ enum class ColorZone { Border, Title, Text, Global, Count };
enum Color {
Black, Red, Green, Yellow, Blue, Magenta, Cyan, White,
T28,
T88, T124,
T237,
T16, T28, T88,
T124,
T231, T237,
Count
};
......
......@@ -15,13 +15,13 @@ Window::Window():
_redecorateOnRepaint{true},
_colorsTextStep{0},
_colorsText{
{White, Black}
{T231, T16}
},
_colors{
{White, Black},
{White, Black},
{White, Black},
{White, Black},
{T231, T16},
{T231, T16},
{T231, T16},
{T231, T16},
} {
}
......@@ -32,13 +32,13 @@ Window::Window(std::size_t x, std::size_t y, std::size_t w, std::size_t h, std::
_redecorateOnRepaint{true},
_colorsTextStep{0},
_colorsText{
{White, Black}
{T231, T16}
},
_colors{
{White, Black},
{White, Black},
{White, Black},
{White, Black},
{T231, T16},
{T231, T16},
{T231, T16},
{T231, T16},
} {
Ncurses::call(wclear, _winptr);
decorate();
......@@ -91,6 +91,8 @@ void Window::resize(std::size_t x, std::size_t y, std::size_t w, std::size_t h)
void Window::decorate() {
if(!_winptr) return;
Ncurses::call(wbkgd, _winptr, _colors[static_cast<int>(ColorZone::Global)].bg);
Ncurses::call(werase, _winptr);
Ncurses::call(wattron, _winptr, _colors[static_cast<int>(ColorZone::Border)]);
......@@ -198,13 +200,13 @@ void Window::setColor(Color c, ColorZone z, ColorDepth d) {
if(d == ColorDepth::Foreground) _colors[static_cast<int>(z)].fg = c;
else _colors[static_cast<int>(z)].bg = c;
if(_winptr) Ncurses::call(wclear, _winptr);
if(_winptr) decorate();
}
void Window::setColors(ColorPair c, ColorZone z) {
_colors[static_cast<int>(z)] = c;
if(_winptr) Ncurses::call(wclear, _winptr);
if(_winptr) decorate();
}
}
......
......@@ -69,6 +69,7 @@ int MbClient::run() {
if(!connect()) {
running = false;
threadInput.join();
threadUI.join();
return 1;
......
......@@ -107,6 +107,8 @@ void Ui::initializeWindows() {
_windowsMgr.add(_windows.at(WindowId::Volume));
}
windowDo(WindowId::List, &Window::setColors, ColorPair{T231, T16}, ColorZone::Global);
windowDo(WindowId::List, &Window::setTitle, "Music list");
windowDo(WindowId::PlCur, &Window::setTitle, "Current playlist");
windowDo(WindowId::Progress, &Window::setTextColors, 1, ColorPairs{{White, White}});
......