From 74f976317cb8c289e4efae8e227b738eacfea5b4 Mon Sep 17 00:00:00 2001 From: Martin Schirrmacher Date: Sun, 8 Feb 2015 11:53:32 +0100 Subject: [add] provide support for new SetMenuSortMode function, to show sort in menus --- HISTORY | 1 + baserender.c | 7 +++++-- baserender.h | 1 + displaymenu.c | 34 ++++++++++++++++++++++++++++++++++ displaymenu.h | 2 ++ icons/default/SortDate.png | Bin 0 -> 3010 bytes icons/default/SortName.png | Bin 0 -> 2664 bytes icons/default/SortNumber.png | Bin 0 -> 2767 bytes icons/default/SortProvider.png | Bin 0 -> 3812 bytes icons/default/SortUnknown.png | Bin 0 -> 3043 bytes 10 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 icons/default/SortDate.png create mode 100644 icons/default/SortName.png create mode 100644 icons/default/SortNumber.png create mode 100644 icons/default/SortProvider.png create mode 100644 icons/default/SortUnknown.png diff --git a/HISTORY b/HISTORY index 7101962a..f5540771 100644 --- a/HISTORY +++ b/HISTORY @@ -16,6 +16,7 @@ VDR Plugin 'skinflatplus' Revision History - [update] widgets: system_information.g2v, temperatures.g2v, temperatures.default - [update] widgets: weather text size of temperature in long view - [add] support for message text with parse tilde and extra text color +- [add] provide support for new SetMenuSortMode function, to show sort in menus 2014-12-04: Version 0.5.0 - [fix] femon receiver - do not get data from previous channel diff --git a/baserender.c b/baserender.c index a60bcbc7..667f8371 100644 --- a/baserender.c +++ b/baserender.c @@ -147,8 +147,6 @@ void cFlatBaseRender::TopBarSetTitle(cString title) { tobBarTitleExtra2 = ""; topBarExtraIcon = ""; topBarMenuIcon = ""; - topBarMenuIconRight = ""; - topBarMenuIconRightSet = false; topBarUpdateTitle = true; topBarExtraIconSet = false; topBarMenuIconSet = false; @@ -195,6 +193,11 @@ void cFlatBaseRender::TopBarSetMenuIconRight(cString icon) { topBarUpdateTitle = true; } +void cFlatBaseRender::TopBarClearMenuIconRight(void) { + topBarMenuIconRight = ""; + topBarMenuIconRightSet = false; +} + void cFlatBaseRender::TopBarSetMenuLogo(cString icon) { if( !strcmp(*icon, "") ) return; diff --git a/baserender.h b/baserender.h index 9a63f731..aef2b2f8 100644 --- a/baserender.h +++ b/baserender.h @@ -150,6 +150,7 @@ class cFlatBaseRender void TopBarSetTitleExtra(cString extra1, cString extra2); void TopBarSetMenuIcon(cString icon); void TopBarSetMenuIconRight(cString icon); + void TopBarClearMenuIconRight(void); void TopBarSetMenuLogo(cString icon); void TopBarSetExtraIcon(cString icon); void TopBarUpdate(void); diff --git a/displaymenu.c b/displaymenu.c index 6e6ff386..957b0f1b 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -224,6 +224,8 @@ void cFlatDisplayMenu::Clear(void) { contentWidget.Clear(); + TopBarClearMenuIconRight(); + ShowRecording = ShowEvent = ShowText = false; } @@ -301,10 +303,12 @@ void cFlatDisplayMenu::SetTitle(const char *Title) { } TopBarSetTitle(*newTitle); } + /* if( RecordingsSortMode == rsmName ) TopBarSetMenuIconRight("menuIcons/RecsSortName"); else if( RecordingsSortMode == rsmTime ) TopBarSetMenuIconRight("menuIcons/RecsSortDate"); + */ icon = "menuIcons/Recordings"; break; case mcSetup: @@ -3612,6 +3616,36 @@ const cFont *cFlatDisplayMenu::GetTextAreaFont(bool FixedFont) const { return rfont; } +void cFlatDisplayMenu::SetMenuSortMode(eMenuSortMode MenuSortMode) { + + cString sortIcon; + switch( MenuSortMode ) { + case msmUnknown: + sortIcon = "SortUnknown"; + // do not set search icon if it is unknown + return; + break; + case msmNumber: + sortIcon = "SortNumber"; + break; + case msmName: + sortIcon = "SortName"; + break; + case msmTime: + sortIcon = "SortDate"; + break; + case msmProvider: + sortIcon = "SortProvider"; + break; + default: + sortIcon = "SortUnknown"; + // do not set search icon if it is unknown + return; + } + + TopBarSetMenuIconRight(sortIcon); +} + void cFlatDisplayMenu::Flush(void) { TopBarUpdate(); diff --git a/displaymenu.h b/displaymenu.h index ef0257c5..721617c0 100644 --- a/displaymenu.h +++ b/displaymenu.h @@ -122,6 +122,8 @@ class cFlatDisplayMenu : public cFlatBaseRender, public cSkinDisplayMenu { virtual bool SetItemChannel(const cChannel *Channel, int Index, bool Current, bool Selectable, bool WithProvider); virtual bool SetItemRecording(const cRecording *Recording, int Index, bool Current, bool Selectable, int Level, int Total, int New); + virtual void SetMenuSortMode(eMenuSortMode MenuSortMode); + virtual void SetScrollbar(int Total, int Offset); virtual void SetEvent(const cEvent *Event); virtual void SetRecording(const cRecording *Recording); diff --git a/icons/default/SortDate.png b/icons/default/SortDate.png new file mode 100644 index 00000000..d563cd9d Binary files /dev/null and b/icons/default/SortDate.png differ diff --git a/icons/default/SortName.png b/icons/default/SortName.png new file mode 100644 index 00000000..daaf4258 Binary files /dev/null and b/icons/default/SortName.png differ diff --git a/icons/default/SortNumber.png b/icons/default/SortNumber.png new file mode 100644 index 00000000..4c1b354d Binary files /dev/null and b/icons/default/SortNumber.png differ diff --git a/icons/default/SortProvider.png b/icons/default/SortProvider.png new file mode 100644 index 00000000..d9c5be27 Binary files /dev/null and b/icons/default/SortProvider.png differ diff --git a/icons/default/SortUnknown.png b/icons/default/SortUnknown.png new file mode 100644 index 00000000..18546cec Binary files /dev/null and b/icons/default/SortUnknown.png differ -- cgit v1.2.3