Added some missing frame titles to console, filter, and search layouts.

This commit is contained in:
casey langen 2017-06-28 02:25:11 -07:00
parent 8a2acda512
commit 81d38a9688
5 changed files with 19 additions and 25 deletions

View File

@ -73,8 +73,11 @@ ConsoleLayout::ConsoleLayout(ITransport& transport, ILibraryPtr library)
this->outputAdapter->SetMaxEntries(500);
this->logs.reset(new LogWindow(this));
this->logs->SetFrameTitle(_TSTR("console_debug_logs_title"));
this->output.reset(new ScrollableWindow(this->outputAdapter, this));
this->output->SetFrameTitle(_TSTR("console_command_output_title"));
this->commands.reset(new cursespp::TextInput());
this->commands->SetFrameTitle(_TSTR("console_command_title"));
this->commands->SetFocusOrder(0);
this->output->SetFocusOrder(1);

View File

@ -49,7 +49,6 @@ using namespace musik::box;
using namespace cursespp;
#define SEARCH_HEIGHT 3
#define LABEL_HEIGHT 1
#define IS_CATEGORY(x) \
x == this->albums || \
@ -76,31 +75,22 @@ void SearchLayout::OnLayout() {
size_t labelY = SEARCH_HEIGHT;
size_t categoryWidth = cx / 3;
size_t categoryY = labelY + LABEL_HEIGHT;
size_t categoryHeight = cy - SEARCH_HEIGHT - 1;
size_t categoryY = labelY;
size_t categoryHeight = cy - SEARCH_HEIGHT;
size_t lastCategoryWidth = cx - (categoryWidth * 2);
this->albumsLabel->MoveAndResize(0, labelY, categoryWidth, 1);
this->albums->MoveAndResize(0, categoryY, categoryWidth, categoryHeight);
this->artistsLabel->MoveAndResize(categoryWidth, labelY, categoryWidth, 1);
this->artists->MoveAndResize(categoryWidth, categoryY, categoryWidth, categoryHeight);
this->genresLabel->MoveAndResize(categoryWidth * 2, labelY, lastCategoryWidth, 1);
this->genres->MoveAndResize(categoryWidth * 2, categoryY, lastCategoryWidth, categoryHeight);
}
#define CREATE_CATEGORY(view, type, order) \
#define CREATE_CATEGORY(view, title, type, order) \
view.reset(new CategoryListView(playback, this->library, type)); \
view->SetFrameTitle(title); \
view->SetAllowArrowKeyPropagation(); \
this->AddWindow(view); \
view->SetFocusOrder(order);
#define CREATE_LABEL(view, value) \
view.reset(new cursespp::TextLabel()); \
view->SetText(value, cursespp::text::AlignCenter); \
this->AddWindow(view);
void SearchLayout::InitializeWindows(musik::core::audio::PlaybackService& playback) {
this->input.reset(new cursespp::TextInput());
this->input->TextChanged.connect(this, &SearchLayout::OnInputChanged);
@ -109,13 +99,9 @@ void SearchLayout::InitializeWindows(musik::core::audio::PlaybackService& playba
this->AddWindow(this->input);
CREATE_CATEGORY(this->albums, constants::Track::ALBUM, 1);
CREATE_CATEGORY(this->artists, constants::Track::ARTIST, 2);
CREATE_CATEGORY(this->genres, constants::Track::GENRE, 3);
CREATE_LABEL(this->albumsLabel, "albums");
CREATE_LABEL(this->artistsLabel, "artists");
CREATE_LABEL(this->genresLabel, "genres");
CREATE_CATEGORY(this->albums, _TSTR("browse_title_albums"), constants::Track::ALBUM, 1);
CREATE_CATEGORY(this->artists, _TSTR("browse_title_artists"), constants::Track::ARTIST, 2);
CREATE_CATEGORY(this->genres, _TSTR("browse_title_genres"), constants::Track::GENRE, 3);
}
void SearchLayout::Requery() {

View File

@ -84,11 +84,8 @@ namespace musik {
std::string value);
musik::core::ILibraryPtr library;
std::shared_ptr<cursespp::TextLabel> albumsLabel;
std::shared_ptr<CategoryListView> albums;
std::shared_ptr<cursespp::TextLabel> artistsLabel;
std::shared_ptr<CategoryListView> artists;
std::shared_ptr<cursespp::TextLabel> genresLabel;
std::shared_ptr<CategoryListView> genres;
std::shared_ptr<cursespp::TextInput> input;
};

View File

@ -82,6 +82,8 @@ void TrackSearchLayout::OnLayout() {
y + SEARCH_HEIGHT,
this->GetWidth(),
this->GetHeight() - SEARCH_HEIGHT);
this->trackList->SetFrameTitle(_TSTR("track_filter_title"));
}
void TrackSearchLayout::InitializeWindows() {
@ -90,7 +92,7 @@ void TrackSearchLayout::InitializeWindows() {
this->input->EnterPressed.connect(this, &TrackSearchLayout::OnEnterPressed);
this->input->SetFocusOrder(0);
this->AddWindow(this->input);
this->trackList.reset(new TrackListView(this->playback, this->library));
this->trackList->SetFocusOrder(1);
this->trackList->SetAllowArrowKeyPropagation();

View File

@ -21,6 +21,10 @@
"browse_title_playlists": "playlists",
"browse_playlist_modified": "playlist modified. press '%s' to save.",
"console_command_output_title": "command output",
"console_debug_logs_title": "debug logs",
"console_command_title": "command",
"settings_space_to_add": "browse (SPACE to add)",
"settings_backspace_to_remove": "indexed paths (BACKSPACE to remove)",
"settings_enable_disable_plugins": "enable/disable plugins",
@ -55,6 +59,8 @@
"settings_server_invalid_settings_title": "invalid settings",
"settings_server_invalid_settings_message": "invalid or missing settings. please check the values and try again.",
"track_filter_title": "track filter results",
"locale_overlay_select_title": "select locale",
"color_theme_list_overlay_title": "color themes",