Replace highlight colors with prefixes and suffixes
This commit is contained in:
@@ -135,7 +135,7 @@ Browser::Browser()
|
||||
, m_current_directory("/")
|
||||
{
|
||||
w = NC::Menu<MPD::Item>(0, MainStartY, COLS, MainHeight, Config.browser_display_mode == DisplayMode::Columns && Config.titles_visibility ? Display::Columns(COLS) : "", Config.main_color, NC::Border());
|
||||
w.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightFixes(w);
|
||||
w.cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
w.centeredCursor(Config.centered_cursor);
|
||||
w.setSelectedPrefix(Config.selected_item_prefix);
|
||||
|
||||
@@ -189,7 +189,7 @@ MediaLibrary::MediaLibrary()
|
||||
itsRightColStartX = itsLeftColWidth+itsMiddleColWidth+2;
|
||||
|
||||
Tags = NC::Menu<PrimaryTag>(0, MainStartY, itsLeftColWidth, MainHeight, Config.titles_visibility ? tagTypeToString(Config.media_lib_primary_tag) + "s" : "", Config.main_color, NC::Border());
|
||||
Tags.setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(Tags);
|
||||
Tags.cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
Tags.centeredCursor(Config.centered_cursor);
|
||||
Tags.setSelectedPrefix(Config.selected_item_prefix);
|
||||
@@ -203,7 +203,7 @@ MediaLibrary::MediaLibrary()
|
||||
});
|
||||
|
||||
Albums = NC::Menu<AlbumEntry>(itsMiddleColStartX, MainStartY, itsMiddleColWidth, MainHeight, Config.titles_visibility ? "Albums" : "", Config.main_color, NC::Border());
|
||||
Albums.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(Albums);
|
||||
Albums.cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
Albums.centeredCursor(Config.centered_cursor);
|
||||
Albums.setSelectedPrefix(Config.selected_item_prefix);
|
||||
@@ -213,7 +213,7 @@ MediaLibrary::MediaLibrary()
|
||||
});
|
||||
|
||||
Songs = NC::Menu<MPD::Song>(itsRightColStartX, MainStartY, itsRightColWidth, MainHeight, Config.titles_visibility ? "Songs" : "", Config.main_color, NC::Border());
|
||||
Songs.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(Songs);
|
||||
Songs.cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
Songs.centeredCursor(Config.centered_cursor);
|
||||
Songs.setSelectedPrefix(Config.selected_item_prefix);
|
||||
@@ -814,17 +814,17 @@ void MediaLibrary::previousColumn()
|
||||
{
|
||||
if (isActiveWindow(Songs))
|
||||
{
|
||||
Songs.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(Songs);
|
||||
w->refresh();
|
||||
w = &Albums;
|
||||
Albums.setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(Albums);
|
||||
}
|
||||
else if (isActiveWindow(Albums) && !hasTwoColumns)
|
||||
{
|
||||
Albums.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(Albums);
|
||||
w->refresh();
|
||||
w = &Tags;
|
||||
Tags.setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(Tags);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -850,17 +850,17 @@ void MediaLibrary::nextColumn()
|
||||
{
|
||||
if (isActiveWindow(Tags))
|
||||
{
|
||||
Tags.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(Tags);
|
||||
w->refresh();
|
||||
w = &Albums;
|
||||
Albums.setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(Albums);
|
||||
}
|
||||
else if (isActiveWindow(Albums))
|
||||
{
|
||||
Albums.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(Albums);
|
||||
w->refresh();
|
||||
w = &Songs;
|
||||
Songs.setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(Songs);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "charset.h"
|
||||
#include "display.h"
|
||||
#include "global.h"
|
||||
#include "helpers.h"
|
||||
#include "settings.h"
|
||||
#include "status.h"
|
||||
#include "statusbar.h"
|
||||
@@ -43,7 +44,7 @@ Outputs::Outputs()
|
||||
{
|
||||
w.cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
w.centeredCursor(Config.centered_cursor);
|
||||
w.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightFixes(w);
|
||||
w.setItemDisplayer([](NC::Menu<MPD::Output> &menu) {
|
||||
auto &output = menu.drawn()->value();
|
||||
if (output.enabled())
|
||||
|
||||
@@ -59,7 +59,7 @@ Playlist::Playlist()
|
||||
w = NC::Menu<MPD::Song>(0, MainStartY, COLS, MainHeight, Config.playlist_display_mode == DisplayMode::Columns && Config.titles_visibility ? Display::Columns(COLS) : "", Config.main_color, NC::Border());
|
||||
w.cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
w.centeredCursor(Config.centered_cursor);
|
||||
w.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightFixes(w);
|
||||
w.setSelectedPrefix(Config.selected_item_prefix);
|
||||
w.setSelectedSuffix(Config.selected_item_suffix);
|
||||
switch (Config.playlist_display_mode)
|
||||
|
||||
@@ -71,7 +71,7 @@ PlaylistEditor::PlaylistEditor()
|
||||
RightColumnWidth = COLS-LeftColumnWidth-1;
|
||||
|
||||
Playlists = NC::Menu<MPD::Playlist>(0, MainStartY, LeftColumnWidth, MainHeight, Config.titles_visibility ? "Playlists" : "", Config.main_color, NC::Border());
|
||||
Playlists.setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(Playlists);
|
||||
Playlists.cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
Playlists.centeredCursor(Config.centered_cursor);
|
||||
Playlists.setSelectedPrefix(Config.selected_item_prefix);
|
||||
@@ -81,7 +81,7 @@ PlaylistEditor::PlaylistEditor()
|
||||
});
|
||||
|
||||
Content = NC::Menu<MPD::Song>(RightColumnStartX, MainStartY, RightColumnWidth, MainHeight, Config.titles_visibility ? "Content" : "", Config.main_color, NC::Border());
|
||||
Content.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(Content);
|
||||
Content.cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
Content.centeredCursor(Config.centered_cursor);
|
||||
Content.setSelectedPrefix(Config.selected_item_prefix);
|
||||
@@ -431,10 +431,10 @@ void PlaylistEditor::previousColumn()
|
||||
{
|
||||
if (isActiveWindow(Content))
|
||||
{
|
||||
Content.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(Content);
|
||||
w->refresh();
|
||||
w = &Playlists;
|
||||
Playlists.setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(Playlists);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -453,10 +453,10 @@ void PlaylistEditor::nextColumn()
|
||||
{
|
||||
if (isActiveWindow(Playlists))
|
||||
{
|
||||
Playlists.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(Playlists);
|
||||
w->refresh();
|
||||
w = &Content;
|
||||
Content.setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(Content);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -175,7 +175,7 @@ size_t SearchEngine::SearchButton = 15;
|
||||
SearchEngine::SearchEngine()
|
||||
: Screen(NC::Menu<SEItem>(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::Border()))
|
||||
{
|
||||
w.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightFixes(w);
|
||||
w.cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
w.centeredCursor(Config.centered_cursor);
|
||||
w.setItemDisplayer(std::bind(Display::SEItems, ph::_1, std::cref(w)));
|
||||
@@ -351,10 +351,10 @@ void SearchEngine::runAction()
|
||||
<< NC::Format::Bold
|
||||
<< Config.color1
|
||||
<< "Search results: "
|
||||
<< NC::FormattedColor::End(Config.color1)
|
||||
<< NC::FormattedColor::End<>(Config.color1)
|
||||
<< Config.color2
|
||||
<< "Found " << found << (found > 1 ? " songs" : " song")
|
||||
<< NC::FormattedColor::End(Config.color2)
|
||||
<< NC::FormattedColor::End<>(Config.color2)
|
||||
<< NC::Format::NoBold;
|
||||
w.insertSeparator(ResetButton+3);
|
||||
Statusbar::print("Searching finished");
|
||||
|
||||
@@ -69,7 +69,7 @@ SelectedItemsAdder::SelectedItemsAdder()
|
||||
);
|
||||
m_playlist_selector.cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
m_playlist_selector.centeredCursor(Config.centered_cursor);
|
||||
m_playlist_selector.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightFixes(m_playlist_selector);
|
||||
m_playlist_selector.setItemDisplayer(DisplayComponent);
|
||||
|
||||
m_position_selector = Component(
|
||||
@@ -83,7 +83,7 @@ SelectedItemsAdder::SelectedItemsAdder()
|
||||
);
|
||||
m_position_selector.cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
m_position_selector.centeredCursor(Config.centered_cursor);
|
||||
m_position_selector.setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightFixes(m_position_selector);
|
||||
m_position_selector.setItemDisplayer(DisplayComponent);
|
||||
|
||||
m_position_selector.addItem(Entry("At the end of playlist",
|
||||
|
||||
@@ -100,12 +100,12 @@ void SongInfo::PrepareSong(const MPD::Song &s)
|
||||
<< Config.color1
|
||||
<< key
|
||||
<< ":"
|
||||
<< NC::FormattedColor::End(Config.color1)
|
||||
<< NC::FormattedColor::End<>(Config.color1)
|
||||
<< NC::Format::NoBold
|
||||
<< " "
|
||||
<< Config.color2
|
||||
<< value
|
||||
<< NC::FormattedColor::End(Config.color2)
|
||||
<< NC::FormattedColor::End<>(Config.color2)
|
||||
<< "\n";
|
||||
};
|
||||
|
||||
|
||||
@@ -133,7 +133,7 @@ TagEditor::TagEditor() : FParser(0), FParserHelper(0), FParserLegend(0), FParser
|
||||
SetDimensions(0, COLS);
|
||||
|
||||
Dirs = new NC::Menu< std::pair<std::string, std::string> >(0, MainStartY, LeftColumnWidth, MainHeight, Config.titles_visibility ? "Directories" : "", Config.main_color, NC::Border());
|
||||
Dirs->setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(*Dirs);
|
||||
Dirs->cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
Dirs->centeredCursor(Config.centered_cursor);
|
||||
Dirs->setItemDisplayer([](NC::Menu<std::pair<std::string, std::string>> &menu) {
|
||||
@@ -141,7 +141,7 @@ TagEditor::TagEditor() : FParser(0), FParserHelper(0), FParserLegend(0), FParser
|
||||
});
|
||||
|
||||
TagTypes = new NC::Menu<std::string>(MiddleColumnStartX, MainStartY, MiddleColumnWidth, MainHeight, Config.titles_visibility ? "Tag types" : "", Config.main_color, NC::Border());
|
||||
TagTypes->setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(*TagTypes);
|
||||
TagTypes->cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
TagTypes->centeredCursor(Config.centered_cursor);
|
||||
TagTypes->setItemDisplayer([](NC::Menu<std::string> &menu) {
|
||||
@@ -165,7 +165,7 @@ TagEditor::TagEditor() : FParser(0), FParserHelper(0), FParserLegend(0), FParser
|
||||
TagTypes->addItem("Save");
|
||||
|
||||
Tags = new TagsWindow(NC::Menu<MPD::MutableSong>(RightColumnStartX, MainStartY, RightColumnWidth, MainHeight, Config.titles_visibility ? "Tags" : "", Config.main_color, NC::Border()));
|
||||
Tags->setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(*Tags);
|
||||
Tags->cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
Tags->centeredCursor(Config.centered_cursor);
|
||||
Tags->setSelectedPrefix(Config.selected_item_prefix);
|
||||
@@ -554,7 +554,7 @@ void TagEditor::runAction()
|
||||
for (auto it = EditedSongs.begin(); it != EditedSongs.end(); ++it)
|
||||
*FParserLegend << Config.color2
|
||||
<< " * "
|
||||
<< NC::FormattedColor::End(Config.color2)
|
||||
<< NC::FormattedColor::End<>(Config.color2)
|
||||
<< (*it)->getName()
|
||||
<< "\n";
|
||||
FParserLegend->flush();
|
||||
@@ -639,11 +639,11 @@ void TagEditor::runAction()
|
||||
*FParserPreview << file
|
||||
<< Config.color2
|
||||
<< " -> "
|
||||
<< NC::FormattedColor::End(Config.color2);
|
||||
<< NC::FormattedColor::End<>(Config.color2);
|
||||
if (new_file.empty())
|
||||
*FParserPreview << Config.empty_tags_color
|
||||
<< Config.empty_tag
|
||||
<< NC::FormattedColor::End(Config.empty_tags_color);
|
||||
<< NC::FormattedColor::End<>(Config.empty_tags_color);
|
||||
else
|
||||
*FParserPreview << new_file << extension;
|
||||
*FParserPreview << "\n\n";
|
||||
@@ -810,11 +810,11 @@ void TagEditor::runAction()
|
||||
if (success)
|
||||
{
|
||||
Statusbar::print("Tags updated");
|
||||
TagTypes->setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(*TagTypes);
|
||||
TagTypes->reset();
|
||||
w->refresh();
|
||||
w = Dirs;
|
||||
Dirs->setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(*Dirs);
|
||||
Mpd.UpdateDirectory(getSharedDirectory(Tags->beginV(), Tags->endV()));
|
||||
}
|
||||
else
|
||||
@@ -878,17 +878,17 @@ void TagEditor::previousColumn()
|
||||
{
|
||||
if (w == Tags)
|
||||
{
|
||||
Tags->setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(*Tags);
|
||||
w->refresh();
|
||||
w = TagTypes;
|
||||
TagTypes->setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(*TagTypes);
|
||||
}
|
||||
else if (w == TagTypes)
|
||||
{
|
||||
TagTypes->setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(*TagTypes);
|
||||
w->refresh();
|
||||
w = Dirs;
|
||||
Dirs->setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(*Dirs);
|
||||
}
|
||||
else if (w == FParserHelper)
|
||||
{
|
||||
@@ -922,17 +922,17 @@ void TagEditor::nextColumn()
|
||||
{
|
||||
if (w == Dirs)
|
||||
{
|
||||
Dirs->setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(*Dirs);
|
||||
w->refresh();
|
||||
w = TagTypes;
|
||||
TagTypes->setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(*TagTypes);
|
||||
}
|
||||
else if (w == TagTypes && TagTypes->choice() < 13 && !Tags->empty())
|
||||
{
|
||||
TagTypes->setHighlightColor(Config.main_highlight_color);
|
||||
setHighlightInactiveColumnFixes(*TagTypes);
|
||||
w->refresh();
|
||||
w = Tags;
|
||||
Tags->setHighlightColor(Config.active_column_color);
|
||||
setHighlightFixes(*Tags);
|
||||
}
|
||||
else if (w == FParser)
|
||||
{
|
||||
|
||||
@@ -52,7 +52,8 @@ TinyTagEditor *myTinyTagEditor;
|
||||
TinyTagEditor::TinyTagEditor()
|
||||
: Screen(NC::Menu<NC::Buffer>(0, MainStartY, COLS, MainHeight, "", Config.main_color, NC::Border()))
|
||||
{
|
||||
w.setHighlightColor(Config.main_highlight_color);
|
||||
w.setHighlightPrefix(Config.current_item_prefix);
|
||||
w.setHighlightSuffix(Config.current_item_suffix);
|
||||
w.cyclicScrolling(Config.use_cyclic_scrolling);
|
||||
w.centeredCursor(Config.centered_cursor);
|
||||
w.setItemDisplayer([](NC::Menu<NC::Buffer> &menu) {
|
||||
@@ -228,12 +229,12 @@ bool TinyTagEditor::getTags()
|
||||
<< Config.color1
|
||||
<< key
|
||||
<< ":"
|
||||
<< NC::FormattedColor::End(Config.color1)
|
||||
<< NC::FormattedColor::End<>(Config.color1)
|
||||
<< NC::Format::NoBold
|
||||
<< " "
|
||||
<< Config.color2
|
||||
<< value
|
||||
<< NC::FormattedColor::End(Config.color2);
|
||||
<< NC::FormattedColor::End<>(Config.color2);
|
||||
};
|
||||
|
||||
print_key_value(w[0].value(), "Filename", itsEdited.getName());
|
||||
|
||||
@@ -221,7 +221,7 @@ void Visualizer::DrawSoundWave(int16_t *buf, ssize_t samples, size_t y_offset, s
|
||||
w << NC::XY(x, base_y+y)
|
||||
<< c
|
||||
<< Config.visualizer_chars[0]
|
||||
<< NC::FormattedColor::End(c);
|
||||
<< NC::FormattedColor::End<>(c);
|
||||
};
|
||||
|
||||
int32_t point_y, prev_point_y = 0;
|
||||
@@ -299,7 +299,7 @@ void Visualizer::DrawSoundWaveFill(int16_t *buf, ssize_t samples, size_t y_offse
|
||||
w << NC::XY(x, y)
|
||||
<< c
|
||||
<< Config.visualizer_chars[1]
|
||||
<< NC::FormattedColor::End(c);
|
||||
<< NC::FormattedColor::End<>(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -342,7 +342,7 @@ void Visualizer::DrawSoundEllipse(int16_t *buf, ssize_t samples, size_t, size_t
|
||||
w << NC::XY(half_width + x, half_height + y)
|
||||
<< c
|
||||
<< Config.visualizer_chars[0]
|
||||
<< NC::FormattedColor::End(c);
|
||||
<< NC::FormattedColor::End<>(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -381,7 +381,7 @@ void Visualizer::DrawSoundEllipseStereo(int16_t *buf_left, int16_t *buf_right, s
|
||||
w << NC::XY(left_half_width + x, top_half_height + y)
|
||||
<< c
|
||||
<< Config.visualizer_chars[1]
|
||||
<< NC::FormattedColor::End(c);
|
||||
<< NC::FormattedColor::End<>(c);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -428,7 +428,7 @@ void Visualizer::DrawFrequencySpectrum(int16_t *buf, ssize_t samples, size_t y_o
|
||||
w << NC::XY(x, y)
|
||||
<< c
|
||||
<< Config.visualizer_chars[1]
|
||||
<< NC::FormattedColor::End(c);
|
||||
<< NC::FormattedColor::End<>(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user