KivyMD: MDRaisedButton - Elevation
Description of the Bug
MDRaisedButton still showing an elevation (when the button is clicked), even I set the elevation to 0.
Code and Logs
from kivy.lang import Builder
from kivymd.app import MDApp
KV = '''
<RaisedBtn@MDRaisedButton>
elevation: 0
shadow_offset: (0,0)
shadow_radius: 0
shadow_softness: 0
ripple_scale: .1
MDScreen:
MDBoxLayout:
md_bg_color: 1, 1, 0, 1
size_hint: 0.9, 0.7
orientation: "vertical"
pos_hint: {'center_x':.5, 'y':0.1}
ScreenManager:
MiniScreen:
name: "one"
MiniScreen2:
name: "two"
<MiniScreen@MDScreen>:
MDBoxLayout:
orientation: "vertical"
MDWidget:
MDBoxLayout:
orientation: "vertical"
spacing: dp(10)
adaptive_height: True
RaisedBtn:
size_hint_x: 1
text: "Login"
on_press:
root.parent.current = 'two'
MDWidget:
<MiniScreen2@MDScreen>:
MDBoxLayout:
orientation: "vertical"
MDWidget:
MDBoxLayout:
orientation: "vertical"
spacing: dp(10)
adaptive_height: True
RaisedBtn:
size_hint_x: 1
text: "Register"
# on_press: print(f"{self.text}")
on_press: root.parent.current = 'one'
MDWidget:
'''
class Test(MDApp):
def build(self):
return Builder.load_string(KV)
Test().run()
Video
Versions
- OS: Windows
- Python: v3.7.6
- Kivy: v2.1.0
- KivyMD: 1.1.0.dev0, git-Unknown, 2022-08-28
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 25 (17 by maintainers)
Commits related to this issue
- Update elevation.py possible fix for issue #1327 — committed to mp-007/KivyMD by mp-007 2 years ago
I think this function is Ok when shadow is correctly rendering. I’m not an expert in Shader, but I hope someone will find a way to make shader compatible for all opengl version.