Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDBadge color, for a MDNavigationItemIcon inside MDNavigationBar creates random red circle in MDNavigationBar #1761

Open
Dragilooping opened this issue Feb 28, 2025 · 2 comments

Comments

@Dragilooping
Copy link

Description of the Bug

When i have a MDBadge, with a defined color set by md_bg_color, for a MDNavigationIcon in a MDNavigationBar, it creates a round red circle in the NavigationBar

Code and Logs

from kivymd.app import MDApp
from kivy.lang import Builder
from kivymd.uix.navigationbar import MDNavigationBar, MDNavigationItem, MDNavigationItemIcon, MDNavigationItemLabel
from kivymd.uix.badge import MDBadge

class MDNavigationBar(MDNavigationBar):
pass

class MDNavigationItem(MDNavigationItem):
pass

class MDNavigationItemIcon(MDNavigationItemIcon):
pass

class MDNavigationItemLabel(MDNavigationItemLabel):
pass

class MDBadge(MDBadge):
pass

KV="""
MDNavigationBar:
MDNavigationItem:
MDNavigationItemIcon:
icon: "scoreboard"
MDBadge:
text: "5"
pos_hint: {"center_x": .5, "center_y": .5}
md_bg_color: "blue"
"""

class Test(MDApp):

def __init__(self, **kwargs):
    super().__init__(**kwargs)

def build(self):
    return Builder.load_string(KV)

Test().run()

Screenshots

Image

Versions

  • OS: Windows 10
  • Python: 3.12
  • Kivy: 2.3.1
  • KivyMD: 2.0.1.dev0
@furas
Copy link

furas commented Mar 6, 2025

Similar problem was mentioned on Stackoverflow:

python - Why do I have 2 red dots on my KivyMD2.0.0 screen. I am using a KV string and I am rendering it. How to correct this? - Stack Overflow

@Dragilooping
Copy link
Author

Great thank you !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants