amwebexpert / poc-mobile-python

Python multi-platform app using the KivyMD framework, integrating Artificial Intelligence features.
MIT License
8 stars 3 forks source link

fix: navigation menu image for iOS - new clean branch #14

Closed costa-rica closed 9 months ago

costa-rica commented 9 months ago

This pull request fixes the issue for the image in the navigation menu being too large in iOS devices. *This branch is branched from the master after pull request #11 was accepted.

Description

The issue was with the MDNavigationDrawerHeader class's handling of the source image. MDNavigationDrawerHeader has a property FitImage that takes the source and places the image in the MDNavigationDrawerHeader. This works well in wide screens but for some reason when the screens shrink or are in the iPhone the image enlarges to a size unrecognizable and distorts the navigation menu.

Solution

Created another class MDNavigationDrawerHeaderOM and replaced FitImage with a BoxLayout that does the same thing. However this BoxLayout and Image (child of BoxLayout that replaced FitImage) do not blow up in size when the screen gets small or on the iPhone.

The new class is in /libs/theme/MDNavigationDrawerHeaderOM.