Skip to content

Commit

Permalink
Main menu improvements
Browse files Browse the repository at this point in the history
- changed icons colors to match Kodi color pattern
- applied icons to "Tags", "Years", "Seasons" main menu list items
- improved readability which arts are being applied to main menu list item
- disabled set_content (because of hits - was unable to set custom icons)
  • Loading branch information
SteveMavic committed Nov 1, 2023
1 parent bf07e38 commit b84550d
Show file tree
Hide file tree
Showing 12 changed files with 64 additions and 14 deletions.
56 changes: 43 additions & 13 deletions models/kodi_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -851,24 +851,34 @@ def main_menu_items() -> List[ListItem]:
# 'Unsort': 5, 'Settings' (both): 7, 'Shoko Menu': 8, 'Search': 9, Experiment: 99}

items: List[ListItem] = []
img = plugin_img_path + '/%s/%s'
# img = plugin_img_path + '/%s/%s'

if plugin_addon.getSettingBool('show_favorites'):
name = color(plugin_addon.getLocalizedString(30211), plugin_addon.getSetting('color_favorites'))
if plugin_addon.getSettingBool('bold_favorites'):
name = bold(name)
item = ListItem(name, path='plugin://plugin.video.nakamori/favorites')
img_name = 'airing.png'
item.setArt({'fanart': img % ('backgrounds', img_name), 'banners': img % ('banners', img_name), 'poster': img % ('icons', img_name)})
# img_name = 'airing.png'
item.setArt({
'fanart': f'{plugin_img_path}/backgrounds/airing.png',
'banners': f'{plugin_img_path}/banners/airing.png',
'poster': f'{plugin_img_path}/icons/airing.png',
'icon': f'{plugin_img_path}/icons/airing.png'
})
items.append(item)

if plugin_addon.getSettingBool('show_recent2'):
name = color(plugin_addon.getLocalizedString(30170), plugin_addon.getSetting('color_recent2'))
if plugin_addon.getSettingBool('bold_recent2'):
name = bold(name)
item = ListItem(name, path='plugin://plugin.video.nakamori/recent')
img_name = '/airing.png'
item.setArt({'fanart': img % ('backgrounds', img_name), 'banners': img % ('banners', img_name), 'poster': img % ('icons', img_name)})
# img_name = 'airing.png'
item.setArt({
'fanart': f'{plugin_img_path}/backgrounds/airing.png',
'banners': f'{plugin_img_path}/banners/airing.png',
'poster': f'{plugin_img_path}/icons/airing.png',
'icon': f'{plugin_img_path}/icons/airing.png'
})
items.append(item)

# TODO airing today
Expand All @@ -888,35 +898,55 @@ def main_menu_items() -> List[ListItem]:
# isfolter
else:
item = ListItem(name, path='plugin://plugin.video.nakamori/calendar')
img_name = 'calendar.png'
item.setArt({'fanart': img % ('backgrounds', img_name), 'banners': img % ('banners', img_name), 'poster': img % ('icons', img_name)})
# img_name = 'calendar.png'
item.setArt({
'fanart': f'{plugin_img_path}/backgrounds/calendar.png',
'banners': f'{plugin_img_path}/banners/calendar.png',
'poster': f'{plugin_img_path}/icons/calendar.png',
'icon': f'{plugin_img_path}/icons/calendar.png'
})
items.append(item)

if plugin_addon.getSettingBool('show_settings'):
name = color(plugin_addon.getLocalizedString(30107), plugin_addon.getSetting('color_settings'))
if plugin_addon.getSettingBool('bold_settings'):
name = bold(name)
item = ListItem(name, path='plugin://plugin.video.nakamori/settings')
img_name = 'settings.png'
item.setArt({'fanart': img % ('backgrounds', img_name), 'banners': img % ('banners', img_name), 'poster': img % ('icons', img_name)})
# img_name = 'settings.png'
item.setArt({
'fanart': f'{plugin_img_path}/backgrounds/settings.png',
'banners': f'{plugin_img_path}/banners/settings.png',
'poster': f'{plugin_img_path}/icons/settings.png',
'icon': f'{plugin_img_path}/icons/settings.png'
})
items.append(item)

if plugin_addon.getSettingBool('show_shoko'):
name = color(plugin_addon.getLocalizedString(30115), plugin_addon.getSetting('color_shoko'))
if plugin_addon.getSettingBool('bold_shoko'):
name = bold(name)
item = ListItem(name, path='plugin://plugin.video.nakamori/shoko')
img_name = 'settings.png'
item.setArt({'fanart': img % ('backgrounds', img_name), 'banners': img % ('banners', img_name), 'poster': img % ('icons', img_name)})
# img_name = 'settings.png'
item.setArt({
'fanart': f'{plugin_img_path}/backgrounds/settings.png',
'banners': f'{plugin_img_path}/banners/settings.png',
'poster': f'{plugin_img_path}/icons/settings.png',
'icon': f'{plugin_img_path}/icons/settings.png'
})
items.append(item)

if plugin_addon.getSettingBool('show_search'):
name = color(plugin_addon.getLocalizedString(30221), plugin_addon.getSetting('color_search'))
if plugin_addon.getSettingBool('bold_search'):
name = bold(name)
item = ListItem(name, path='plugin://plugin.video.nakamori/search')
img_name = 'search.png'
item.setArt({'fanart': img % ('backgrounds', img_name), 'banners': img % ('banners', img_name), 'poster': img % ('icons', img_name)})
# img_name = 'search.png'
item.setArt({
'fanart': f'{plugin_img_path}/backgrounds/search.png',
'banners': f'{plugin_img_path}/banners/search.png',
'poster': f'{plugin_img_path}/icons/search.png',
'icon': f'{plugin_img_path}/icons/search.png'
})
items.append(item)

return items
Expand Down
22 changes: 21 additions & 1 deletion nakamoriplugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def list_all_filters():
# also let's flag this information in sqlite version, mark
pass

kodi_models.set_content('tvshows')

This comment has been minimized.

Copy link
@bigretromike

bigretromike Jan 9, 2024

Owner

#520
Here. If I recall changing "content" changes views behavior.
Please fix

kodi_models.set_sorting_method(ThisType.filter)
y = kodi_models.list_all_filters()
x = kodi_models.main_menu_items()
Expand All @@ -49,6 +48,27 @@ def list_all_filters():
y.sort(key=itemgetter(3))

for filter_id, f_type, li, label in y:
if label == "Tags":
li.setArt({
'fanart': f'{kodi_models.plugin_img_path}/backgrounds/tags.png',
'banners': f'{kodi_models.plugin_img_path}/banners/tags.png',
'poster': f'{kodi_models.plugin_img_path}/icons/tags.png',
'icon': f'{kodi_models.plugin_img_path}/icons/tags.png'
})
elif label == "Years":
li.setArt({
'fanart': f'{kodi_models.plugin_img_path}/backgrounds/years.png',
'banners': f'{kodi_models.plugin_img_path}/banners/years.png',
'poster': f'{kodi_models.plugin_img_path}/icons/years.png',
'icon': f'{kodi_models.plugin_img_path}/icons/years.png'
})
elif label == "Seasons":
li.setArt({
'fanart': f'{kodi_models.plugin_img_path}/backgrounds/seasons.png',
'banners': f'{kodi_models.plugin_img_path}/banners/seasons.png',
'poster': f'{kodi_models.plugin_img_path}/icons/seasons.png',
'icon': f'{kodi_models.plugin_img_path}/icons/seasons.png'
})
if f_type == ThisType.filter:
addDirectoryItem(plugin.handle, plugin.url_for(list_groups_by_filter_id, filter_id), li, True, totalItems=y_count)
elif f_type == ThisType.filters:
Expand Down
Binary file modified resources/media/icons/airing.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/media/icons/calendar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/media/icons/clear-search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/media/icons/new-search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/media/icons/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/media/icons/seasons.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/media/icons/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/media/icons/tags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/media/icons/unsort.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified resources/media/icons/years.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b84550d

Please sign in to comment.