- Fixed focus issues when pressing enter in track and category filter

modes.
- Removed boost::chrono dependency -- just use std::chrono in all cases.
This commit is contained in:
casey langen 2017-01-01 12:09:28 -08:00
parent 6a6b842883
commit 83fc208daf
7 changed files with 13 additions and 5 deletions

View File

@ -57,7 +57,6 @@
#include <boost/filesystem/path.hpp>
#include <boost/filesystem/fstream.hpp>
#include <boost/filesystem/detail/utf8_codecvt_facet.hpp>
#include <boost/chrono.hpp>
#ifdef WIN32
#include <app/util/Win32Util.h>

View File

@ -105,7 +105,9 @@ void SearchLayout::OnLayout() {
void SearchLayout::InitializeWindows(PlaybackService& playback) {
this->input.reset(new cursespp::TextInput());
this->input->TextChanged.connect(this, &SearchLayout::OnInputChanged);
this->input->EnterPressed.connect(this, &SearchLayout::OnEnterPressed);
this->input->SetFocusOrder(0);
this->AddWindow(this->input);
CREATE_CATEGORY(this->albums, constants::Track::ALBUM, 1);
@ -134,6 +136,10 @@ void SearchLayout::OnInputChanged(cursespp::TextInput* sender, std::string value
}
}
void SearchLayout::OnEnterPressed(cursespp::TextInput* sender) {
this->SetFocus(this->albums);
}
void SearchLayout::OnVisibilityChanged(bool visible) {
LayoutBase::OnVisibilityChanged(visible);

View File

@ -77,6 +77,8 @@ namespace musik {
void InitializeWindows(PlaybackService& playback);
void Requery();
void OnEnterPressed(cursespp::TextInput* sender);
void OnInputChanged(
cursespp::TextInput* sender,
std::string value);

View File

@ -141,6 +141,7 @@ void TrackSearchLayout::OnInputChanged(cursespp::TextInput* sender, std::string
void TrackSearchLayout::OnEnterPressed(cursespp::TextInput* sender) {
if (this->trackList->GetTrackList()->Count()) {
playback::Play(this->trackList, this->playback, this->GetFocus());
this->SetFocus(this->trackList);
}
}

View File

@ -57,7 +57,7 @@ using namespace musik::core::runtime;
using namespace musik::box;
using namespace cursespp;
using namespace boost::chrono;
using namespace std::chrono;
/* if the user hasn't changed the selected index in 30 seconds
we assume he's not paying attention, and will automatically scroll

View File

@ -107,7 +107,7 @@ namespace musik {
musik::core::LibraryPtr library;
size_t lastQueryHash;
RowFormatter formatter;
boost::chrono::milliseconds lastChanged;
std::chrono::milliseconds lastChanged;
};
}
}

View File

@ -48,12 +48,12 @@
#include <boost/format.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/chrono.hpp>
#include <boost/lexical_cast.hpp>
#include <algorithm>
#include <memory>
#include <deque>
#include <chrono>
using namespace musik::core;
using namespace musik::core::audio;
@ -62,7 +62,7 @@ using namespace musik::core::db;
using namespace musik::core::sdk;
using namespace musik::core::runtime;
using namespace musik::box;
using namespace boost::chrono;
using namespace std::chrono;
using namespace cursespp;
#define REFRESH_TRANSPORT_READOUT 1001