mirror of
https://projects.vdr-developer.org/git/vdr-plugin-skindesigner.git
synced 2023-10-19 17:58:31 +02:00
added possibility to hide root menu from a subview template
This commit is contained in:
parent
b6e6065b0f
commit
19dfd1af7b
2
HISTORY
2
HISTORY
@ -214,4 +214,6 @@ Version 0.3.0
|
||||
- fixed bug detecting menu item numbers in main menu
|
||||
- fixed recording progress bar in nopacity
|
||||
- added <systemmemory> viewelement in main menu
|
||||
- added possibility to hide root menu from a subview template
|
||||
|
||||
|
||||
|
@ -13,6 +13,7 @@
|
||||
scaletvy CDATA #IMPLIED
|
||||
scaletvwidth CDATA #IMPLIED
|
||||
scaletvheight CDATA #IMPLIED
|
||||
hideroot CDATA #IMPLIED
|
||||
>
|
||||
|
||||
<!ELEMENT viewelement (area|areascroll)*>
|
||||
|
@ -125,6 +125,8 @@ void cTemplateFunction::SetParameters(vector<pair<string, string> > params) {
|
||||
p.first = ptScaleTvWidth;
|
||||
} else if (!name.compare("scaletvheight")) {
|
||||
p.first = ptScaleTvHeight;
|
||||
} else if (!name.compare("hideroot")) {
|
||||
p.first = ptHideRoot;
|
||||
} else if (!name.compare("cache")) {
|
||||
p.first = ptCache;
|
||||
} else if (!name.compare("determinatefont")) {
|
||||
@ -260,6 +262,10 @@ bool cTemplateFunction::CalculateParameters(void) {
|
||||
break;
|
||||
case ptOverflow:
|
||||
paramValid = SetOverflow(value);
|
||||
break;
|
||||
case ptHideRoot:
|
||||
paramValid = SetHideRoot(value);
|
||||
break;
|
||||
default:
|
||||
paramValid = true;
|
||||
break;
|
||||
@ -1046,6 +1052,14 @@ bool cTemplateFunction::SetOverflow(string value) {
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool cTemplateFunction::SetHideRoot(string value) {
|
||||
bool hideRoot = 0;
|
||||
if (!value.compare("true"))
|
||||
hideRoot = 1;
|
||||
numericParameters.insert(pair<eParamType, int>(ptHideRoot, hideRoot));
|
||||
return true;
|
||||
}
|
||||
|
||||
void cTemplateFunction::ParseStringParameters(void) {
|
||||
//first replace stringtokens in Text (drawText)
|
||||
stringstream text;
|
||||
|
@ -76,6 +76,7 @@ enum eParamType {
|
||||
ptScaleTvY,
|
||||
ptScaleTvWidth,
|
||||
ptScaleTvHeight,
|
||||
ptHideRoot,
|
||||
ptCache,
|
||||
ptDeterminateFont,
|
||||
ptNone
|
||||
@ -150,6 +151,7 @@ protected:
|
||||
bool SetOrientation(string value);
|
||||
bool SetFloating(string value);
|
||||
bool SetOverflow(string value);
|
||||
bool SetHideRoot(string value);
|
||||
void ParseStringParameters(void);
|
||||
void ParseNumericalParameters(void);
|
||||
void CalculateAlign(int elementWidth, int elementHeight);
|
||||
|
@ -194,6 +194,13 @@ int cTemplateView::GetNumPixmapsViewElement(eViewElement ve) {
|
||||
return viewElement->GetNumPixmaps();
|
||||
}
|
||||
|
||||
bool cTemplateView::HideView(void) {
|
||||
if (!parameters)
|
||||
return false;
|
||||
return parameters->GetNumericParameter(ptHideRoot);
|
||||
}
|
||||
|
||||
|
||||
bool cTemplateView::ExecuteView(eViewElement ve) {
|
||||
map < eViewElement, cTemplateViewElement* >::iterator hit = viewElements.find(ve);
|
||||
if (hit == viewElements.end())
|
||||
@ -1878,6 +1885,7 @@ cTemplateViewPlugin::cTemplateViewPlugin(string pluginName, int viewID) {
|
||||
attributes.insert("scaletvy");
|
||||
attributes.insert("scaletvwidth");
|
||||
attributes.insert("scaletvheight");
|
||||
attributes.insert("hideroot");
|
||||
funcsAllowed.insert(pair< string, set<string> >(viewName, attributes));
|
||||
|
||||
//definition of allowed parameters for viewtab
|
||||
|
@ -109,6 +109,7 @@ public:
|
||||
cRect GetOsdSize(void);
|
||||
int GetNumPixmaps(void);
|
||||
int GetNumPixmapsViewElement(eViewElement ve);
|
||||
bool HideView(void);
|
||||
bool ExecuteView(eViewElement ve);
|
||||
int GetNumListViewMenuItems(void);
|
||||
bool GetScalingWindow(cRect &scalingWindow);
|
||||
|
@ -34,8 +34,12 @@ bool cDisplayPluginView::createOsd(void) {
|
||||
|
||||
void cDisplayPluginView::Deactivate(bool hide) {
|
||||
Stop();
|
||||
if (!hide)
|
||||
return;
|
||||
if (!hide) {
|
||||
bool hideFromTemplate = tmplView->HideView();
|
||||
if (!hideFromTemplate)
|
||||
return;
|
||||
esyslog("skindesigner: hiding from template");
|
||||
}
|
||||
HidePixmaps();
|
||||
for (map< int, cViewGrid* >::iterator it = viewGrids.begin(); it != viewGrids.end(); it++) {
|
||||
cViewGrid *viewGrid = it->second;
|
||||
|
Loading…
Reference in New Issue
Block a user