throw away Menu::GetPosition() as Menu::Choice() does the same
oh cool, I forgot that such function already exists under different name ~~
This commit is contained in:
@@ -276,7 +276,7 @@ void Browser::MouseButtonPressed(MEVENT me)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
size_t pos = w->GetPosition();
|
size_t pos = w->Choice();
|
||||||
SpacePressed();
|
SpacePressed();
|
||||||
if (pos < w->Size()-1)
|
if (pos < w->Size()-1)
|
||||||
w->Scroll(wUp);
|
w->Scroll(wUp);
|
||||||
@@ -286,7 +286,7 @@ void Browser::MouseButtonPressed(MEVENT me)
|
|||||||
case itSong:
|
case itSong:
|
||||||
if (me.bstate & BUTTON1_PRESSED)
|
if (me.bstate & BUTTON1_PRESSED)
|
||||||
{
|
{
|
||||||
size_t pos = w->GetPosition();
|
size_t pos = w->Choice();
|
||||||
SpacePressed();
|
SpacePressed();
|
||||||
if (pos < w->Size()-1)
|
if (pos < w->Size()-1)
|
||||||
w->Scroll(wUp);
|
w->Scroll(wUp);
|
||||||
|
|||||||
@@ -373,7 +373,7 @@ void MediaLibrary::MouseButtonPressed(MEVENT me)
|
|||||||
Songs->Goto(me.y);
|
Songs->Goto(me.y);
|
||||||
if (me.bstate & BUTTON1_PRESSED)
|
if (me.bstate & BUTTON1_PRESSED)
|
||||||
{
|
{
|
||||||
size_t pos = Songs->GetPosition();
|
size_t pos = Songs->Choice();
|
||||||
SpacePressed();
|
SpacePressed();
|
||||||
if (pos < Songs->Size()-1)
|
if (pos < Songs->Size()-1)
|
||||||
Songs->Scroll(wUp);
|
Songs->Scroll(wUp);
|
||||||
|
|||||||
@@ -120,8 +120,6 @@ namespace NCurses
|
|||||||
void Move(size_t from, size_t to);
|
void Move(size_t from, size_t to);
|
||||||
bool Goto(size_t y);
|
bool Goto(size_t y);
|
||||||
|
|
||||||
size_t GetPosition() const { return itsHighlight; }
|
|
||||||
|
|
||||||
bool isBold(int id = -1);
|
bool isBold(int id = -1);
|
||||||
void BoldOption(int index, bool bold);
|
void BoldOption(int index, bool bold);
|
||||||
|
|
||||||
|
|||||||
@@ -69,14 +69,14 @@ void Outputs::EnterPressed()
|
|||||||
{
|
{
|
||||||
if (w->Current().second)
|
if (w->Current().second)
|
||||||
{
|
{
|
||||||
if (Mpd->DisableOutput(w->GetPosition()))
|
if (Mpd->DisableOutput(w->Choice()))
|
||||||
ShowMessage("Output \"%s\" disabled", w->Current().first.c_str());
|
ShowMessage("Output \"%s\" disabled", w->Current().first.c_str());
|
||||||
w->Current().second = 0;
|
w->Current().second = 0;
|
||||||
w->BoldOption(w->Choice(), 0);
|
w->BoldOption(w->Choice(), 0);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (Mpd->EnableOutput(w->GetPosition()))
|
if (Mpd->EnableOutput(w->Choice()))
|
||||||
ShowMessage("Output \"%s\" enabled", w->Current().first.c_str());
|
ShowMessage("Output \"%s\" enabled", w->Current().first.c_str());
|
||||||
w->Current().second = 1;
|
w->Current().second = 1;
|
||||||
w->BoldOption(w->Choice(), 1);
|
w->BoldOption(w->Choice(), 1);
|
||||||
|
|||||||
@@ -306,7 +306,7 @@ void PlaylistEditor::MouseButtonPressed(MEVENT me)
|
|||||||
Content->Goto(me.y);
|
Content->Goto(me.y);
|
||||||
if (me.bstate & BUTTON1_PRESSED)
|
if (me.bstate & BUTTON1_PRESSED)
|
||||||
{
|
{
|
||||||
size_t pos = Content->GetPosition();
|
size_t pos = Content->Choice();
|
||||||
SpacePressed();
|
SpacePressed();
|
||||||
if (pos < Content->Size()-1)
|
if (pos < Content->Size()-1)
|
||||||
Content->Scroll(wUp);
|
Content->Scroll(wUp);
|
||||||
|
|||||||
@@ -304,13 +304,13 @@ void SearchEngine::MouseButtonPressed(MEVENT me)
|
|||||||
if (!w->Goto(me.y))
|
if (!w->Goto(me.y))
|
||||||
return;
|
return;
|
||||||
w->Refresh();
|
w->Refresh();
|
||||||
if ((me.bstate & BUTTON3_PRESSED || w->GetPosition() > 10) && w->GetPosition() < StaticOptions)
|
if ((me.bstate & BUTTON3_PRESSED || w->Choice() > 10) && w->Choice() < StaticOptions)
|
||||||
EnterPressed();
|
EnterPressed();
|
||||||
else if (w->GetPosition() >= StaticOptions)
|
else if (w->Choice() >= StaticOptions)
|
||||||
{
|
{
|
||||||
if (me.bstate & BUTTON1_PRESSED)
|
if (me.bstate & BUTTON1_PRESSED)
|
||||||
{
|
{
|
||||||
size_t pos = w->GetPosition();
|
size_t pos = w->Choice();
|
||||||
SpacePressed();
|
SpacePressed();
|
||||||
if (pos < w->Size()-1)
|
if (pos < w->Size()-1)
|
||||||
w->Scroll(wUp);
|
w->Scroll(wUp);
|
||||||
|
|||||||
Reference in New Issue
Block a user