mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 15:58:31 +00:00
left / right keys in zappilot configurable in skin
This commit is contained in:
@@ -339,6 +339,14 @@ void cAttributes::SetDirection(int id, const char *val) {
|
||||
attribs[id] = (int)direction;
|
||||
}
|
||||
|
||||
void cAttributes::SetButton(int id, const char *val) {
|
||||
eButtonType button = eButtonType::none;
|
||||
if (!strcmp(val, "left"))
|
||||
button = eButtonType::left;
|
||||
else if (!strcmp(val, "right"))
|
||||
button = eButtonType::right;
|
||||
attribs[id] = (int)button;
|
||||
}
|
||||
/***************************************************************************
|
||||
* Private Functions
|
||||
***************************************************************************/
|
||||
|
@@ -46,6 +46,7 @@ protected:
|
||||
void SetOrientation(int id, const char *val);
|
||||
void SetDirection(int id, const char *val);
|
||||
void SetAlign(int id, const char *val);
|
||||
void SetButton(int id, const char *val);
|
||||
public:
|
||||
cAttributes(int numAttributes);
|
||||
cAttributes(const cAttributes &other);
|
||||
|
@@ -244,6 +244,8 @@ void cViewListAttribs::Set(vector<stringpair> &attributes) {
|
||||
SetShiftType(id, attVal);
|
||||
} else if (IdEqual(id, (int)eViewListAttribs::shiftmode)) {
|
||||
SetShiftMode(id, attVal);
|
||||
} else if (IdEqual(id, (int)eViewListAttribs::button)) {
|
||||
SetButton(id, attVal);
|
||||
} else {
|
||||
attribCtors[id] = new cNumericExpr(attVal);
|
||||
}
|
||||
@@ -289,6 +291,7 @@ void cViewListAttribs::SetAttributesDefs(void) {
|
||||
attribIDs.insert(pair<string, int>("startx", (int)eViewListAttribs::startx));
|
||||
attribIDs.insert(pair<string, int>("starty", (int)eViewListAttribs::starty));
|
||||
attribIDs.insert(pair<string, int>("condition", (int)eViewListAttribs::condition));
|
||||
attribIDs.insert(pair<string, int>("button", (int)eViewListAttribs::button));
|
||||
attribNames.insert(pair<int, string>((int)eViewListAttribs::align, "align"));
|
||||
attribNames.insert(pair<int, string>((int)eViewListAttribs::menuitemwidth, "menuitemwidth"));
|
||||
attribNames.insert(pair<int, string>((int)eViewListAttribs::determinatefont, "determinatefont"));
|
||||
@@ -301,6 +304,7 @@ void cViewListAttribs::SetAttributesDefs(void) {
|
||||
attribNames.insert(pair<int, string>((int)eViewListAttribs::startx, "startx"));
|
||||
attribNames.insert(pair<int, string>((int)eViewListAttribs::starty, "starty"));
|
||||
attribNames.insert(pair<int, string>((int)eViewListAttribs::condition, "condition"));
|
||||
attribNames.insert(pair<int, string>((int)eViewListAttribs::button, "button"));
|
||||
}
|
||||
|
||||
void cViewListAttribs::Debug(void) {
|
||||
|
@@ -70,6 +70,7 @@ public:
|
||||
cPoint ShiftStartpoint(void) { return cPoint(GetValue((int)eViewListAttribs::startx), GetValue((int)eViewListAttribs::starty)); };
|
||||
int ShiftType(void) { return GetValue((int)eViewListAttribs::shifttype); };
|
||||
int ShiftMode(void) { return GetValue((int)eViewListAttribs::shiftmode); };
|
||||
eButtonType Button(void) { return (eButtonType)GetValue((int)eViewListAttribs::button); }
|
||||
void Debug(void);
|
||||
};
|
||||
/******************************************************************
|
||||
|
@@ -1664,6 +1664,7 @@ enum class eViewListAttribs {
|
||||
startx,
|
||||
starty,
|
||||
condition,
|
||||
button,
|
||||
count
|
||||
};
|
||||
|
||||
@@ -1871,5 +1872,10 @@ enum class eDirection {
|
||||
topdown
|
||||
};
|
||||
|
||||
enum class eButtonType {
|
||||
none = -1,
|
||||
left,
|
||||
right
|
||||
};
|
||||
|
||||
#endif //__DEFINITIONS_H
|
||||
|
@@ -292,6 +292,22 @@ int cViewChannel::MaxItems(void) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool cViewChannel::KeyRightOpensChannellist(void) {
|
||||
if (channelList) {
|
||||
if (channelList->Button() == eButtonType::left)
|
||||
return false;
|
||||
else if (channelList->Button() == eButtonType::right)
|
||||
return true;
|
||||
}
|
||||
if (groupList) {
|
||||
if (groupList->Button() == eButtonType::left)
|
||||
return true;
|
||||
else if (groupList->Button() == eButtonType::right)
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void cViewChannel::SetChannelInfo(const cChannel *channel) {
|
||||
if (!channel)
|
||||
return;
|
||||
@@ -329,6 +345,8 @@ void cViewChannel::ClearList(void) {
|
||||
channelList->Clear();
|
||||
if (viewType == dcGroupsList && groupList)
|
||||
groupList->Clear();
|
||||
if (viewType == dcGroupsChannelList && groupChannelList)
|
||||
groupChannelList->Clear();
|
||||
}
|
||||
|
||||
void cViewChannel::SetNumChannelHints(int num) {
|
||||
@@ -349,7 +367,7 @@ void cViewChannel::Close(void) {
|
||||
fader = NULL;
|
||||
delete shifter;
|
||||
shifter = NULL;
|
||||
if (initFinished && ShiftTime() > 0) {
|
||||
if (initFinished && viewType == dcDefault && ShiftTime() > 0) {
|
||||
cRect shiftbox = CoveredArea();
|
||||
cPoint ref = cPoint(shiftbox.X(), shiftbox.Y());
|
||||
cPoint end = ShiftStart(shiftbox);
|
||||
@@ -357,7 +375,7 @@ void cViewChannel::Close(void) {
|
||||
shifter->Shift();
|
||||
delete shifter;
|
||||
shifter = NULL;
|
||||
} else if (initFinished && FadeTime() > 0) {
|
||||
} else if (initFinished && viewType == dcDefault && FadeTime() > 0) {
|
||||
fader = new cAnimation((cFadable*)this, false);
|
||||
fader->Fade();
|
||||
delete fader;
|
||||
|
@@ -62,6 +62,7 @@ public:
|
||||
#ifdef USE_ZAPCOCKPIT
|
||||
void SetViewType(eDisplaychannelView viewType);
|
||||
int MaxItems(void);
|
||||
bool KeyRightOpensChannellist(void);
|
||||
void SetChannelInfo(const cChannel *channel);
|
||||
void SetChannelList(const cChannel *channel, int index, bool current);
|
||||
void SetGroupList(const char *group, int numChannels, int index, bool current);
|
||||
|
@@ -43,6 +43,7 @@ public:
|
||||
void Draw(eMenuCategory menuCat);
|
||||
void Clear(void);
|
||||
virtual void Close(void);
|
||||
eButtonType Button(void) { return attribs->Button(); };
|
||||
//Fadable
|
||||
bool Detached(void) { return false; };
|
||||
int Delay(void) { return 0; };
|
||||
|
Reference in New Issue
Block a user