From 8e9c9b298ea725cad65b95081c52a41c4ec6cc3a Mon Sep 17 00:00:00 2001 From: otakuto Date: Wed, 6 Dec 2017 06:37:32 +0900 Subject: [PATCH] refactoring title --- main.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 1c57558..a4dab7c 100644 --- a/main.cpp +++ b/main.cpp @@ -9,6 +9,9 @@ #include #include +std::string const TITLE = "CrazyDiskInfo"; +std::string const VERSION = "1.0.2"; + constexpr int const STATUS_WIDTH = 80; constexpr int const DEVICE_BAR_HEIGHT = 4; @@ -201,8 +204,10 @@ void drawVersion(WINDOW * window) mvwhline(window, 0, 0, '-', width); wattroff(window, COLOR_PAIR(4)); + auto title = " " + TITLE + "-" + VERSION + " "; + wattrset(window, COLOR_PAIR(8)); - mvwprintw(window, 0, (width - sizeof(" CrazyDiskInfo-1.0.2 ")) / 2, " CrazyDiskInfo-1.0.2 "); + mvwprintw(window, 0, (width - title.length()) / 2, title.c_str()); wattroff(window, COLOR_PAIR(8)); wnoutrefresh(window);