kivymd / KivyMD

KivyMD is a collection of Material Design compliant widgets for use with Kivy, a framework for cross-platform, touch-enabled graphical applications. https://youtube.com/c/KivyMD https://twitter.com/KivyMD https://habr.com/ru/users/kivymd https://stackoverflow.com/tags/kivymd
https://kivymd.readthedocs.io
MIT License
2.21k stars 665 forks source link

Scrollview Interaction with Children Using RGBA Background Color #1635

Open ShazwanX9 opened 7 months ago

ShazwanX9 commented 7 months ago

Steps to Reproduce:

1. Open the application.
2. Navigate to a screen containing a ScrollView with children that have RGBA background colors.
3. Interact with the ScrollView, such as scrolling up or down.

Description of the Bug

An outline of the children appears beyond the designated ScrollView area during interaction, disrupting the expected layout. I experimented with identical code on two distinct KivyMD versions, and the outcomes varied. This discrepancy could be attributed to potential changes in the newer theming, although I am uncertain about the exact cause.

Code and Logs

from kivymd.app import MDApp
from kivy.core.window import Window
from kivy.lang.builder import Builder
from kivymd.uix.boxlayout import MDBoxLayout

Window.size = (375, 667)

Builder.load_string("""

<SomeCard@MDCard>:
    size_hint_y: None
    height: dp(160)
    md_bg_color: "green"

    MDBoxLayout:
        orientation: "vertical"
        size_hint_y: .45
        padding: dp(16)
        md_bg_color: 0,0,0,.45
        radius: 0, 0, dp(24), dp(24)

<UserInterfaceApp>:
    orientation: 'vertical'
    md_bg_color: "red"

    MDRelativeLayout:
        size_hint: 1, .45
        # md_bg_color: "blue"

        MDLabel:
            text: "KivyMD 2.0.0"

    MDScrollView:
        size_hint_y: 1
        MDBoxLayout:
            orientation: "vertical"
            size_hint_y: None
            height: self.minimum_height
            spacing: dp(8)
            SomeCard:
            SomeCard:
            SomeCard:
            SomeCard:
            SomeCard:
            SomeCard:
            SomeCard:
            SomeCard:

    MDRelativeLayout:
        size_hint: 1, .45
        md_bg_color: "blue"
""")

class UserInterfaceApp(MDBoxLayout):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)

    def callback(self, string="Callback"):
        print(string)

class MainApp(MDApp):
    def build(self):
        return UserInterfaceApp()

if __name__ == "__main__":
    MainApp().run()

Screenshots

ss1 ss2

Versions

HeaTTheatR commented 7 months ago

https://kivymd.readthedocs.io/en/latest/components/card/#example https://kivymd.readthedocs.io/en/latest/themes/theming/#kivymd.theming.ThemableBehavior.theme_bg_color

T-Dynamos commented 7 months ago

What happens if you change MDScrollView to ScrollView?

ShazwanX9 commented 7 months ago

What happens if you change MDScrollView to ScrollView?

I tried, the result is the same, the outlined is appearing with both component. The only quick fix I could do for now is alpha=1.