mirror of
https://github.com/clangen/musikcube.git
synced 2025-04-16 05:42:54 +00:00
Cleaned up Colors.h and made them more symbol and reusable.
This commit is contained in:
parent
b7e6099483
commit
c5656906ae
@ -171,6 +171,10 @@ bool BrowseLayout::KeyPress(const std::string& key) {
|
||||
this->categoryList->SetFieldName(constants::Track::GENRE);
|
||||
return true;
|
||||
}
|
||||
else if (key == "M-m") {
|
||||
this->categoryList->ScrollToPlaying();
|
||||
return true;
|
||||
}
|
||||
|
||||
return LayoutBase::KeyPress(key);
|
||||
}
|
||||
|
@ -72,7 +72,6 @@ ConsoleLayout::ConsoleLayout(ITransport& transport, LibraryPtr library)
|
||||
this->AddWindow(this->output);
|
||||
this->AddWindow(this->resources);
|
||||
|
||||
this->commands->SetContentColor(CURSESPP_WHITE_ON_TRANSPARENT);
|
||||
this->commands->EnterPressed.connect(this, &ConsoleLayout::OnEnterPressed);
|
||||
|
||||
this->Help();
|
||||
|
@ -136,15 +136,13 @@ int64 IndexerLayout::ListItemDecorator(
|
||||
{
|
||||
ListWindow* lw = static_cast<ListWindow*>(scrollable);
|
||||
if (lw->GetSelectedIndex() == index) {
|
||||
return COLOR_PAIR(CURSESPP_BLACK_ON_GREEN);
|
||||
return COLOR_PAIR(CURSESPP_HIGHLIGHTED_LIST_ITEM);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void IndexerLayout::InitializeWindows() {
|
||||
this->SetContentColor(CURSESPP_WHITE_ON_TRANSPARENT);
|
||||
|
||||
this->title.reset(new TextLabel());
|
||||
this->title->SetText("settings", TextLabel::AlignCenter);
|
||||
|
||||
@ -155,9 +153,7 @@ void IndexerLayout::InitializeWindows() {
|
||||
this->addedPathsLabel->SetText("indexed paths (BACKSPACE to remove)", TextLabel::AlignLeft);
|
||||
|
||||
this->addedPathsList.reset(new cursespp::ListWindow(&this->addedPathsAdapter));
|
||||
this->addedPathsList->SetContentColor(CURSESPP_WHITE_ON_TRANSPARENT);
|
||||
this->browseList.reset(new cursespp::ListWindow(&this->browseAdapter));
|
||||
this->browseList->SetContentColor(CURSESPP_WHITE_ON_TRANSPARENT);
|
||||
|
||||
ScrollAdapterBase::ItemDecorator decorator =
|
||||
std::bind(
|
||||
|
@ -105,7 +105,6 @@ void SearchLayout::Layout() {
|
||||
void SearchLayout::InitializeWindows(PlaybackService& playback) {
|
||||
this->input.reset(new cursespp::TextInput());
|
||||
this->input->TextChanged.connect(this, &SearchLayout::OnInputChanged);
|
||||
this->input->SetContentColor(CURSESPP_WHITE_ON_TRANSPARENT);
|
||||
this->input->SetFocusOrder(0);
|
||||
this->AddWindow(this->input);
|
||||
|
||||
@ -128,8 +127,10 @@ void SearchLayout::Requery() {
|
||||
}
|
||||
|
||||
void SearchLayout::OnInputChanged(cursespp::TextInput* sender, std::string value) {
|
||||
if (this->IsVisible()) {
|
||||
this->Requery();
|
||||
}
|
||||
}
|
||||
|
||||
void SearchLayout::OnVisibilityChanged(bool visible) {
|
||||
LayoutBase::OnVisibilityChanged(visible);
|
||||
@ -139,6 +140,7 @@ void SearchLayout::OnVisibilityChanged(bool visible) {
|
||||
this->Requery();
|
||||
}
|
||||
else {
|
||||
this->input->SetText("");
|
||||
this->albums->Reset();
|
||||
this->artists->Reset();
|
||||
this->genres->Reset();
|
||||
|
@ -93,7 +93,6 @@ void TrackSearchLayout::Layout() {
|
||||
void TrackSearchLayout::InitializeWindows() {
|
||||
this->input.reset(new cursespp::TextInput());
|
||||
this->input->TextChanged.connect(this, &TrackSearchLayout::OnInputChanged);
|
||||
this->input->SetContentColor(CURSESPP_WHITE_ON_TRANSPARENT);
|
||||
this->input->SetFocusOrder(0);
|
||||
this->AddWindow(this->input);
|
||||
|
||||
@ -112,6 +111,7 @@ void TrackSearchLayout::OnVisibilityChanged(bool visible) {
|
||||
this->Requery();
|
||||
}
|
||||
else {
|
||||
this->input->SetText("");
|
||||
this->trackList->Clear();
|
||||
}
|
||||
}
|
||||
@ -131,8 +131,10 @@ void TrackSearchLayout::ProcessMessage(IMessage &message) {
|
||||
}
|
||||
|
||||
void TrackSearchLayout::OnInputChanged(cursespp::TextInput* sender, std::string value) {
|
||||
if (this->IsVisible()) {
|
||||
DEBOUNCE_REQUERY(REQUERY_INTERVAL_MS);
|
||||
}
|
||||
}
|
||||
|
||||
bool TrackSearchLayout::KeyPress(const std::string& key) {
|
||||
if (key == "^M") { /* enter. play the selection */
|
||||
|
@ -62,7 +62,6 @@ CategoryListView::CategoryListView(
|
||||
const std::string& fieldName)
|
||||
: ListWindow(NULL)
|
||||
, playback(playback) {
|
||||
this->SetContentColor(CURSESPP_WHITE_ON_TRANSPARENT);
|
||||
this->selectAfterQuery = 0;
|
||||
this->library = library;
|
||||
this->library->QueryCompleted.connect(this, &CategoryListView::OnQueryCompleted);
|
||||
@ -129,12 +128,30 @@ void CategoryListView::SetFieldName(const std::string& fieldName) {
|
||||
|
||||
if (this->metadata) {
|
||||
this->metadata.reset();
|
||||
this->ScrollToTop();
|
||||
}
|
||||
|
||||
this->Requery();
|
||||
}
|
||||
}
|
||||
|
||||
void CategoryListView::ScrollToPlaying() {
|
||||
if (this->playing) {
|
||||
std::string value = this->playing->GetValue(this->fieldName.c_str());
|
||||
if (value.size()) {
|
||||
/* binary search would be better, but need to research if sqlite
|
||||
properly sorts utf8 strings. */
|
||||
for (size_t i = 0; i < this->metadata->size(); i++) {
|
||||
if (this->metadata->at(i)->displayValue == value) {
|
||||
this->SetSelectedIndex(i);
|
||||
this->ScrollTo(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CategoryListView::OnQueryCompleted(IQueryPtr query) {
|
||||
boost::mutex::scoped_lock lock(this->queryMutex);
|
||||
|
||||
@ -207,11 +224,11 @@ IScrollAdapter::EntryPtr CategoryListView::Adapter::GetEntry(size_t index) {
|
||||
|
||||
bool selected = index == parent.GetSelectedIndex();
|
||||
|
||||
int64 attrs = selected ? COLOR_PAIR(CURSESPP_BLACK_ON_GREEN) : -1LL;
|
||||
int64 attrs = selected ? COLOR_PAIR(CURSESPP_HIGHLIGHTED_LIST_ITEM) : -1LL;
|
||||
|
||||
if (playing) {
|
||||
if (selected) {
|
||||
attrs = COLOR_PAIR(CURSESPP_BLACK_ON_YELLOW);
|
||||
attrs = COLOR_PAIR(CURSESPP_HIGHLIGHTED_SELECTED_LIST_ITEM);
|
||||
}
|
||||
else {
|
||||
attrs = COLOR_PAIR(CURSESPP_SELECTED_LIST_ITEM) | A_BOLD;
|
||||
|
@ -86,6 +86,7 @@ namespace musik {
|
||||
DBID GetSelectedId();
|
||||
std::string GetFieldName();
|
||||
void SetFieldName(const std::string& fieldName);
|
||||
void ScrollToPlaying();
|
||||
|
||||
protected:
|
||||
virtual IScrollAdapter& GetScrollAdapter();
|
||||
|
@ -47,8 +47,6 @@ typedef IScrollAdapter::IEntry IEntry;
|
||||
|
||||
LogWindow::LogWindow(IWindow *parent)
|
||||
: ScrollableWindow(parent) {
|
||||
this->SetContentColor(CURSESPP_WHITE_ON_TRANSPARENT);
|
||||
|
||||
this->adapter = new SimpleScrollAdapter();
|
||||
this->adapter->SetMaxEntries(500);
|
||||
|
||||
@ -78,18 +76,18 @@ void LogWindow::Update() {
|
||||
WINDOW* contents = this->GetContent();
|
||||
|
||||
for (size_t i = 0; i < pending.size(); i++) {
|
||||
int64 attrs = COLOR_PAIR(CURSESPP_WHITE_ON_TRANSPARENT);
|
||||
int64 attrs = COLOR_PAIR(CURSESPP_TEXT_DEFAULT);
|
||||
|
||||
LogEntry* entry = pending[i];
|
||||
|
||||
switch (entry->level) {
|
||||
case musik::debug::level_error: {
|
||||
attrs = COLOR_PAIR(CURSESPP_RED_ON_TRANSPARENT) | A_BOLD;
|
||||
attrs = COLOR_PAIR(CURSESPP_TEXT_ERROR) | A_BOLD;
|
||||
break;
|
||||
}
|
||||
|
||||
case musik::debug::level_warning: {
|
||||
attrs = COLOR_PAIR(CURSESPP_YELLOW_ON_TRANSPARENT) | A_BOLD;
|
||||
attrs = COLOR_PAIR(CURSESPP_TEXT_WARNING) | A_BOLD;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -47,7 +47,6 @@ typedef IScrollAdapter::EntryPtr EntryPtr;
|
||||
|
||||
OutputWindow::OutputWindow(IWindow *parent)
|
||||
: ScrollableWindow(parent) {
|
||||
this->SetContentColor(CURSESPP_BLACK_ON_GREY);
|
||||
this->adapter = new SimpleScrollAdapter();
|
||||
this->adapter->SetDisplaySize(this->GetContentWidth(), this->GetContentHeight());
|
||||
this->adapter->SetMaxEntries(500);
|
||||
|
@ -70,7 +70,6 @@ TrackListView::TrackListView(
|
||||
RowFormatter formatter)
|
||||
: ListWindow(NULL)
|
||||
, playback(playback) {
|
||||
this->SetContentColor(CURSESPP_WHITE_ON_TRANSPARENT);
|
||||
this->library = library;
|
||||
this->library->QueryCompleted.connect(this, &TrackListView::OnQueryCompleted);
|
||||
this->playback.TrackChanged.connect(this, &TrackListView::OnTrackChanged);
|
||||
@ -188,7 +187,7 @@ static std::string formatWithoutAlbum(TrackPtr track, size_t width) {
|
||||
|
||||
IScrollAdapter::EntryPtr TrackListView::Adapter::GetEntry(size_t index) {
|
||||
bool selected = index == parent.GetSelectedIndex();
|
||||
int64 attrs = selected ? COLOR_PAIR(CURSESPP_BLACK_ON_GREEN) : -1LL;
|
||||
int64 attrs = selected ? COLOR_PAIR(CURSESPP_HIGHLIGHTED_LIST_ITEM) : -1LL;
|
||||
|
||||
TrackPtr track = parent.metadata->Get(index);
|
||||
|
||||
@ -198,7 +197,7 @@ IScrollAdapter::EntryPtr TrackListView::Adapter::GetEntry(size_t index) {
|
||||
playing->LibraryId() == track->LibraryId())
|
||||
{
|
||||
if (selected) {
|
||||
attrs = COLOR_PAIR(CURSESPP_BLACK_ON_YELLOW);
|
||||
attrs = COLOR_PAIR(CURSESPP_HIGHLIGHTED_SELECTED_LIST_ITEM);
|
||||
}
|
||||
else {
|
||||
attrs = COLOR_PAIR(CURSESPP_SELECTED_LIST_ITEM) | A_BOLD;
|
||||
@ -212,7 +211,7 @@ IScrollAdapter::EntryPtr TrackListView::Adapter::GetEntry(size_t index) {
|
||||
if (this->parent.headers->find(index) != this->parent.headers->end()) {
|
||||
std::string album = track->GetValue(constants::Track::ALBUM);
|
||||
std::shared_ptr<EntryWithHeader> entry(new EntryWithHeader(album, text));
|
||||
entry->SetAttrs(COLOR_PAIR(CURSESPP_GREEN_ON_TRANSPARENT), attrs);
|
||||
entry->SetAttrs(COLOR_PAIR(CURSESPP_LIST_ITEM_HEADER), attrs);
|
||||
return entry;
|
||||
}
|
||||
else {
|
||||
|
@ -136,7 +136,7 @@ size_t writePlayingFormat(
|
||||
TokenList tokens;
|
||||
tokenize(playingFormat, tokens);
|
||||
|
||||
int64 gb = COLOR_PAIR(CURSESPP_GREEN_ON_TRANSPARENT);
|
||||
int64 gb = COLOR_PAIR(CURSESPP_TEXT_ACTIVE);
|
||||
size_t remaining = width;
|
||||
|
||||
auto it = tokens.begin();
|
||||
@ -188,7 +188,6 @@ TransportWindow::TransportWindow(musik::box::PlaybackService& playback)
|
||||
, playback(playback)
|
||||
, transport(playback.GetTransport())
|
||||
{
|
||||
this->SetContentColor(CURSESPP_WHITE_ON_TRANSPARENT);
|
||||
this->SetFrameVisible(false);
|
||||
this->playback.TrackChanged.connect(this, &TransportWindow::OnPlaybackServiceTrackChanged);
|
||||
this->playback.ModeChanged.connect(this, &TransportWindow::OnPlaybackModeChanged);
|
||||
@ -249,7 +248,8 @@ void TransportWindow::Update() {
|
||||
bool paused = (transport.GetPlaybackState() == ITransport::PlaybackPaused);
|
||||
bool stopped = (transport.GetPlaybackState() == ITransport::PlaybackStopped);
|
||||
|
||||
int64 gb = COLOR_PAIR(CURSESPP_GREEN_ON_TRANSPARENT);
|
||||
int64 gb = COLOR_PAIR(CURSESPP_TEXT_ACTIVE);
|
||||
int64 disabled = COLOR_PAIR(CURSESPP_TEXT_DISABLED);
|
||||
|
||||
/* prepare the "shuffle" label */
|
||||
|
||||
@ -261,9 +261,9 @@ void TransportWindow::Update() {
|
||||
std::string duration = "0";
|
||||
|
||||
if (stopped) {
|
||||
wattron(c, A_DIM);
|
||||
ON(c, disabled);
|
||||
wprintw(c, "playback is stopped");
|
||||
wattroff(c, A_DIM);
|
||||
OFF(c, disabled);
|
||||
}
|
||||
else {
|
||||
std::string title, album;
|
||||
@ -286,7 +286,7 @@ void TransportWindow::Update() {
|
||||
}
|
||||
|
||||
wmove(c, 0, cx - shuffleLabelLen);
|
||||
int64 shuffleAttrs = this->playback.IsShuffled() ? gb : A_DIM;
|
||||
int64 shuffleAttrs = this->playback.IsShuffled() ? gb : disabled;
|
||||
ON(c, shuffleAttrs);
|
||||
wprintw(c, shuffleLabel.c_str());
|
||||
OFF(c, shuffleAttrs);
|
||||
@ -325,7 +325,7 @@ void TransportWindow::Update() {
|
||||
break;
|
||||
default:
|
||||
repeatModeLabel = "off";
|
||||
repeatAttrs = A_DIM;
|
||||
repeatAttrs = disabled;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ void Checkbox::Redraw() {
|
||||
std::string ellipsized = symbol + " " + this->buffer;
|
||||
text::Ellipsize(ellipsized, cx);
|
||||
|
||||
int64 attrs = this->focused ? CURSESPP_RED_ON_TRANSPARENT : -1LL;
|
||||
int64 attrs = this->focused ? CURSESPP_TEXT_FOCUSED : -1LL;
|
||||
|
||||
if (attrs != -1) {
|
||||
wattron(c, COLOR_PAIR(attrs));
|
||||
|
@ -44,17 +44,19 @@ static int yellow = COLOR_YELLOW;
|
||||
static int green = COLOR_GREEN;
|
||||
static int black = COLOR_BLACK;
|
||||
|
||||
|
||||
#define COLOR_CUSTOM_WHITE 16
|
||||
#define COLOR_CUSTOM_BLUE 17
|
||||
#define COLOR_CUSTOM_RED 18
|
||||
#define COLOR_CUSTOM_YELLOW 19
|
||||
#define COLOR_CUSTOM_GREEN 20
|
||||
#define COLOR_CUSTOM_BLACK 21
|
||||
#define COLOR_SELECTED_LIST_ITEM_BG 22
|
||||
#define COLOR_CUSTOM_GREY 22
|
||||
#define COLOR_CUSTOM_SELECTED_LIST_ITEM_BG 23
|
||||
|
||||
static int foreground = COLOR_WHITE;
|
||||
static int background = -1;
|
||||
static int selected = -1;
|
||||
static int grey = COLOR_WHITE;
|
||||
|
||||
#define SCALE(x) ((x * 1000) / 255)
|
||||
|
||||
@ -77,21 +79,28 @@ void Colors::Init() {
|
||||
red = initColor(COLOR_CUSTOM_RED, 220, 82, 86);
|
||||
green = initColor(COLOR_CUSTOM_GREEN, 166, 226, 46);
|
||||
yellow = initColor(COLOR_CUSTOM_YELLOW, 230, 220, 116);
|
||||
selected = initColor(COLOR_SELECTED_LIST_ITEM_BG, 66, 66, 56);
|
||||
selected = initColor(COLOR_CUSTOM_SELECTED_LIST_ITEM_BG, 66, 66, 56);
|
||||
grey = initColor(COLOR_CUSTOM_GREY, 128, 128, 128);
|
||||
}
|
||||
|
||||
init_pair(CURSESPP_WHITE_ON_BLUE, white, blue);
|
||||
init_pair(CURSESPP_RED_ON_BLUE, red, blue);
|
||||
init_pair(CURSESPP_YELLOW_ON_BLUE, yellow, blue);
|
||||
init_pair(CURSESPP_BLACK_ON_GREY, black, white);
|
||||
init_pair(CURSESPP_BLACK_ON_GREEN, black, green);
|
||||
init_pair(CURSESPP_YELLOW_ON_TRANSPARENT, yellow, background);
|
||||
init_pair(CURSESPP_WHITE_ON_TRANSPARENT, white, background);
|
||||
init_pair(CURSESPP_RED_ON_TRANSPARENT, red, background);
|
||||
init_pair(CURSESPP_RED_ON_GREY, red, white);
|
||||
init_pair(CURSESPP_GREEN_ON_TRANSPARENT, green, background);
|
||||
init_pair(CURSESPP_BLACK_ON_TRANSPARENT, black, background);
|
||||
init_pair(CURSESPP_RED_ON_GREEN, red, green);
|
||||
init_pair(CURSESPP_BLACK_ON_YELLOW, black, yellow);
|
||||
init_pair(CURSESPP_RED_ON_BLUE, red, blue);
|
||||
init_pair(CURSESPP_BLACK_ON_GREY, black, white);
|
||||
init_pair(CURSESPP_RED_ON_GREY, red, white);
|
||||
|
||||
init_pair(CURSESPP_SELECTED_LIST_ITEM, yellow, selected);
|
||||
init_pair(CURSESPP_HIGHLIGHTED_LIST_ITEM, black, green);
|
||||
init_pair(CURSESPP_HIGHLIGHTED_SELECTED_LIST_ITEM, black, yellow);
|
||||
init_pair(CURSESPP_LIST_ITEM_HEADER, green, background);
|
||||
|
||||
init_pair(CURSESPP_DEFAULT_CONTENT_COLOR, foreground, background);
|
||||
init_pair(CURSESPP_DEFAULT_FRAME_COLOR, foreground, background);
|
||||
init_pair(CURSESPP_FOCUSED_FRAME_COLOR, red, background);
|
||||
|
||||
init_pair(CURSESPP_TEXT_DEFAULT, white, background);
|
||||
init_pair(CURSESPP_TEXT_DISABLED, grey, background);
|
||||
init_pair(CURSESPP_TEXT_FOCUSED, red, background);
|
||||
init_pair(CURSESPP_TEXT_ACTIVE, green, background);
|
||||
init_pair(CURSESPP_TEXT_WARNING, yellow, background);
|
||||
init_pair(CURSESPP_TEXT_ERROR, red, background);
|
||||
}
|
||||
|
@ -36,20 +36,26 @@
|
||||
|
||||
#include "curses_config.h"
|
||||
|
||||
#define CURSESPP_WHITE_ON_BLUE 1
|
||||
#define CURSESPP_BLACK_ON_TRANSPARENT 1
|
||||
#define CURSESPP_RED_ON_BLUE 2
|
||||
#define CURSESPP_YELLOW_ON_BLUE 3
|
||||
#define CURSESPP_BLACK_ON_GREY 4
|
||||
#define CURSESPP_BLACK_ON_GREEN 5
|
||||
#define CURSESPP_YELLOW_ON_TRANSPARENT 6
|
||||
#define CURSESPP_WHITE_ON_TRANSPARENT 7
|
||||
#define CURSESPP_RED_ON_TRANSPARENT 8
|
||||
#define CURSESPP_RED_ON_GREY 9
|
||||
#define CURSESPP_GREEN_ON_TRANSPARENT 10
|
||||
#define CURSESPP_BLACK_ON_TRANSPARENT 11
|
||||
#define CURSESPP_RED_ON_GREEN 12
|
||||
#define CURSESPP_BLACK_ON_YELLOW 13
|
||||
#define CURSESPP_SELECTED_LIST_ITEM 14
|
||||
#define CURSESPP_BLACK_ON_GREY 3
|
||||
#define CURSESPP_RED_ON_GREY 4
|
||||
|
||||
#define CURSESPP_SELECTED_LIST_ITEM 5
|
||||
#define CURSESPP_HIGHLIGHTED_LIST_ITEM 6
|
||||
#define CURSESPP_HIGHLIGHTED_SELECTED_LIST_ITEM 7
|
||||
#define CURSESPP_LIST_ITEM_HEADER 8
|
||||
|
||||
#define CURSESPP_DEFAULT_CONTENT_COLOR 9
|
||||
#define CURSESPP_DEFAULT_FRAME_COLOR 10
|
||||
#define CURSESPP_FOCUSED_FRAME_COLOR 11
|
||||
|
||||
#define CURSESPP_TEXT_DEFAULT 12
|
||||
#define CURSESPP_TEXT_DISABLED 13
|
||||
#define CURSESPP_TEXT_FOCUSED 14
|
||||
#define CURSESPP_TEXT_ACTIVE 15
|
||||
#define CURSESPP_TEXT_WARNING 16
|
||||
#define CURSESPP_TEXT_ERROR 17
|
||||
|
||||
namespace cursespp {
|
||||
class Colors {
|
||||
|
@ -64,12 +64,12 @@ bool sortByFocusOrder(IWindowPtr a, IWindowPtr b) {
|
||||
|
||||
static inline IWindowPtr adjustFocus(IWindowPtr oldFocus, IWindowPtr newFocus) {
|
||||
if (oldFocus) {
|
||||
oldFocus->SetFrameColor(CURSESPP_WHITE_ON_TRANSPARENT);
|
||||
oldFocus->SetFrameColor(CURSESPP_DEFAULT_FRAME_COLOR);
|
||||
oldFocus->Blur();
|
||||
}
|
||||
|
||||
if (newFocus) {
|
||||
newFocus->SetFrameColor(CURSESPP_RED_ON_TRANSPARENT);
|
||||
newFocus->SetFrameColor(CURSESPP_FOCUSED_FRAME_COLOR);
|
||||
newFocus->Focus();
|
||||
}
|
||||
|
||||
|
@ -38,6 +38,7 @@
|
||||
#include "IInput.h"
|
||||
#include "Message.h"
|
||||
#include "MessageQueue.h"
|
||||
#include "Colors.h"
|
||||
|
||||
using namespace cursespp;
|
||||
|
||||
@ -79,8 +80,8 @@ Window::Window(IWindow *parent) {
|
||||
this->width = 0;
|
||||
this->x = 0;
|
||||
this->y = 0;
|
||||
this->contentColor = -1;
|
||||
this->frameColor = -1;
|
||||
this->contentColor = CURSESPP_DEFAULT_CONTENT_COLOR;
|
||||
this->frameColor = CURSESPP_DEFAULT_FRAME_COLOR;
|
||||
this->drawFrame = true;
|
||||
this->isVisible = false;
|
||||
this->focusOrder = -1;
|
||||
@ -254,7 +255,7 @@ int Window::GetY() const {
|
||||
}
|
||||
|
||||
void Window::SetContentColor(int64 color) {
|
||||
this->contentColor = color;
|
||||
this->contentColor = (color == -1 ? CURSESPP_DEFAULT_CONTENT_COLOR : color);
|
||||
|
||||
if (this->contentColor != -1 && this->content) {
|
||||
wbkgd(this->frame, COLOR_PAIR(this->frameColor));
|
||||
@ -268,7 +269,7 @@ void Window::SetContentColor(int64 color) {
|
||||
}
|
||||
|
||||
void Window::SetFrameColor(int64 color) {
|
||||
this->frameColor = color;
|
||||
this->frameColor = (color == -1 ? CURSESPP_DEFAULT_FRAME_COLOR : color);
|
||||
|
||||
if (this->drawFrame && this->frameColor != -1 && this->frame) {
|
||||
wbkgd(this->frame, COLOR_PAIR(this->frameColor));
|
||||
|
Loading…
x
Reference in New Issue
Block a user