mirror of
https://github.com/Benexl/FastAnime.git
synced 2026-01-08 11:21:04 -08:00
fix:Worked around weird behavior of Mdlabel's with a background color
This commit is contained in:
@@ -1,17 +1,5 @@
|
||||
#:import get_hex_from_color kivy.utils.get_hex_from_color
|
||||
|
||||
<CharactersHeaderText@MDLabel>
|
||||
adaptive_height:True
|
||||
# halign:"center"
|
||||
max_lines:0
|
||||
shorten:False
|
||||
md_bg_color:self.theme_cls.secondaryContainerColor
|
||||
bold:True
|
||||
markup:True
|
||||
font_style: "Body"
|
||||
role: "large"
|
||||
padding:"10dp"
|
||||
|
||||
<CharactersContainer@MDBoxLayout>:
|
||||
adaptive_height:True
|
||||
md_bg_color:self.theme_cls.surfaceContainerLowColor
|
||||
@@ -74,8 +62,9 @@
|
||||
adaptive_height:True
|
||||
container:container
|
||||
orientation:"vertical"
|
||||
CharactersHeaderText:
|
||||
HeaderLabel:
|
||||
text:"Characters"
|
||||
halign:"left"
|
||||
CharactersContainer:
|
||||
id:container
|
||||
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
<DescriptionHeader@MDLabel>
|
||||
adaptive_height:True
|
||||
# halign:"center"
|
||||
max_lines:0
|
||||
shorten:False
|
||||
bold:True
|
||||
markup:True
|
||||
font_style: "Body"
|
||||
role: "large"
|
||||
md_bg_color:self.theme_cls.secondaryContainerColor
|
||||
padding:"10dp"
|
||||
# <DescriptionHeader>
|
||||
# adaptive_height:True
|
||||
# md_bg_color:self.theme_cls.secondaryContainerColor
|
||||
# MDLabel:
|
||||
# text:root.text
|
||||
# adaptive_height:True
|
||||
# max_lines:0
|
||||
# shorten:False
|
||||
# bold:True
|
||||
# font_style: "Body"
|
||||
# role: "large"
|
||||
# padding:"10dp"
|
||||
|
||||
<DescriptionContainer@MDBoxLayout>:
|
||||
adaptive_height:True
|
||||
@@ -25,7 +26,8 @@
|
||||
<AnimeDescription>:
|
||||
orientation:"vertical"
|
||||
adaptive_height:True
|
||||
DescriptionHeader:
|
||||
HeaderLabel:
|
||||
halign:"left"
|
||||
text:"Description"
|
||||
DescriptionContainer:
|
||||
DescriptionText:
|
||||
|
||||
@@ -2,16 +2,18 @@
|
||||
adaptive_height:True
|
||||
orientation: 'vertical'
|
||||
# padding:"10dp"
|
||||
MDLabel:
|
||||
text: root.titles
|
||||
MDBoxLayout:
|
||||
adaptive_height:True
|
||||
md_bg_color:self.theme_cls.secondaryContainerColor
|
||||
padding:"5dp"
|
||||
bold:True
|
||||
shorten:False
|
||||
max_lines:2
|
||||
font_style:"Label"
|
||||
role:"large"
|
||||
MDLabel:
|
||||
text: root.titles
|
||||
adaptive_height:True
|
||||
padding:"5dp"
|
||||
bold:True
|
||||
shorten:False
|
||||
max_lines:2
|
||||
font_style:"Label"
|
||||
role:"large"
|
||||
FitImage:
|
||||
size_hint_y: None
|
||||
height: dp(250)
|
||||
|
||||
@@ -3,17 +3,15 @@
|
||||
<RankingsLabel@MDLabel>:
|
||||
max_lines:0
|
||||
shorten:False
|
||||
# padding:"10dp"
|
||||
markup:True
|
||||
font_style: "Label"
|
||||
role: "medium"
|
||||
|
||||
<RankingsHeaderLabel@MDLabel>:
|
||||
color:self.theme_cls.primaryColor
|
||||
bold:True
|
||||
# padding:"10dp"
|
||||
max_lines:0
|
||||
shorten:False
|
||||
markup:True
|
||||
font_style: "Label"
|
||||
role: "large"
|
||||
|
||||
@@ -38,12 +36,15 @@
|
||||
adaptive_width:True
|
||||
MDBoxLayout:
|
||||
adaptive_size:True
|
||||
# spacing:"5dp"
|
||||
pos_hint: {'center_y': .5}
|
||||
MDIcon:
|
||||
icon: "star"
|
||||
color:yellow
|
||||
disabled: not((root.rankings["AverageScore"]/100)*6>=2)
|
||||
disabled: not((root.rankings["AverageScore"]/100)*6>=1)
|
||||
MDIcon:
|
||||
color:yellow
|
||||
disabled: not(root.rankings["AverageScore"]/100*6>=2)
|
||||
icon: "star"
|
||||
MDIcon:
|
||||
color:yellow
|
||||
disabled: not(root.rankings["AverageScore"]/100*6>=3)
|
||||
@@ -54,8 +55,8 @@
|
||||
icon: "star"
|
||||
MDIcon:
|
||||
color:yellow
|
||||
disabled: not(root.rankings["AverageScore"]/100*6>=5)
|
||||
icon: "star"
|
||||
disabled: not(root.rankings["AverageScore"]/100*6>=5)
|
||||
MDIcon:
|
||||
color:yellow
|
||||
icon: "star"
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
#:import get_hex_from_color kivy.utils.get_hex_from_color
|
||||
|
||||
<ReviewHeaderText@MDLabel>
|
||||
adaptive_height:True
|
||||
# halign:"center"
|
||||
max_lines:0
|
||||
shorten:False
|
||||
md_bg_color:self.theme_cls.secondaryContainerColor
|
||||
bold:True
|
||||
markup:True
|
||||
font_style: "Body"
|
||||
role: "large"
|
||||
padding:"10dp"
|
||||
|
||||
<ReviewContainer@MDBoxLayout>:
|
||||
adaptive_height:True
|
||||
@@ -54,7 +43,8 @@
|
||||
container:container
|
||||
adaptive_height:True
|
||||
orientation:"vertical"
|
||||
ReviewHeaderText:
|
||||
HeaderLabel:
|
||||
halign:"left"
|
||||
text:"reviews"
|
||||
ReviewContainer:
|
||||
id:container
|
||||
@@ -16,17 +16,19 @@
|
||||
markup:True
|
||||
font_style: "Label"
|
||||
role: "medium"
|
||||
# pos_hint: {'center_x': 0.5}
|
||||
<SideBarHeaderLabel>:
|
||||
<HeaderLabel>:
|
||||
adaptive_height:True
|
||||
halign:"center"
|
||||
max_lines:0
|
||||
shorten:False
|
||||
bold:True
|
||||
font_style: "Label"
|
||||
role: "large"
|
||||
md_bg_color:self.theme_cls.secondaryContainerColor
|
||||
padding:"10dp"
|
||||
MDLabel:
|
||||
text:root.text
|
||||
adaptive_height:True
|
||||
halign:root.halign
|
||||
max_lines:0
|
||||
shorten:False
|
||||
bold:True
|
||||
font_style: "Label"
|
||||
role: "large"
|
||||
padding:"10dp"
|
||||
|
||||
<AnimeSideBar>:
|
||||
size_hint_x: None
|
||||
@@ -51,7 +53,7 @@
|
||||
MDButtonText:
|
||||
text:"Watch on Animdl"
|
||||
FitBoxLayout:
|
||||
SideBarHeaderLabel:
|
||||
HeaderLabel:
|
||||
text:"Alternative Titles"
|
||||
SideBarLabel:
|
||||
text: "[color={}]Synonyms:[/color] {}".format(get_hex_from_color(self.theme_cls.primaryColor),root.alternative_titles["synonyms"])
|
||||
@@ -60,7 +62,7 @@
|
||||
SideBarLabel:
|
||||
text: "[color={}]Japanese:[/color] {}".format(get_hex_from_color(self.theme_cls.primaryColor),root.alternative_titles["japanese"])
|
||||
FitBoxLayout:
|
||||
SideBarHeaderLabel:
|
||||
HeaderLabel:
|
||||
text:"Information"
|
||||
SideBarLabel:
|
||||
text: "[color={}]Episodes:[/color] {}".format(get_hex_from_color(self.theme_cls.primaryColor),root.information["episodes"])
|
||||
@@ -87,17 +89,17 @@
|
||||
SideBarLabel:
|
||||
text: "[color={}]Genres:[/color] {}".format(get_hex_from_color(self.theme_cls.primaryColor),root.information["genres"])
|
||||
SideBarLabel:
|
||||
text: "[color={}]Duration:[/color] {}".format(get_hex_from_color(self.theme_cls.primaryColor),root.information["duration"])
|
||||
text: "[color={}]Duration:[/color] {} minutes".format(get_hex_from_color(self.theme_cls.primaryColor),root.information["duration"])
|
||||
FitBoxLayout:
|
||||
id:statistics_container
|
||||
SideBarHeaderLabel:
|
||||
HeaderLabel:
|
||||
text:"Rankings"
|
||||
FitBoxLayout:
|
||||
id:tags_container
|
||||
SideBarHeaderLabel:
|
||||
HeaderLabel:
|
||||
text:"Tags"
|
||||
FitBoxLayout:
|
||||
id:external_links_container
|
||||
SideBarHeaderLabel:
|
||||
HeaderLabel:
|
||||
text:"External Links"
|
||||
BoxLayout:
|
||||
@@ -1,13 +1,16 @@
|
||||
from kivy.properties import ObjectProperty,StringProperty,DictProperty,ListProperty
|
||||
from kivy.utils import get_hex_from_color
|
||||
from kivy.factory import Factory
|
||||
|
||||
from kivymd.uix.boxlayout import MDBoxLayout
|
||||
from kivymd.uix.label import MDLabel
|
||||
|
||||
class SideBarHeaderLabel(MDLabel):
|
||||
pass
|
||||
|
||||
class HeaderLabel(MDBoxLayout):
|
||||
text = StringProperty()
|
||||
halign = StringProperty("center")
|
||||
|
||||
Factory.register("HeaderLabel", HeaderLabel)
|
||||
class SideBarLabel(MDLabel):
|
||||
pass
|
||||
|
||||
@@ -44,7 +47,7 @@ class AnimeSideBar(MDBoxLayout):
|
||||
|
||||
def on_statistics(self,instance,value):
|
||||
self.statistics_container.clear_widgets()
|
||||
header = SideBarHeaderLabel()
|
||||
header = HeaderLabel()
|
||||
header.text = "Rankings"
|
||||
self.statistics_container.add_widget(header)
|
||||
for stat in value:
|
||||
@@ -58,7 +61,7 @@ class AnimeSideBar(MDBoxLayout):
|
||||
|
||||
def on_tags(self,instance,value):
|
||||
self.tags_container.clear_widgets()
|
||||
header = SideBarHeaderLabel()
|
||||
header = HeaderLabel()
|
||||
header.text = "Tags"
|
||||
self.tags_container.add_widget(header)
|
||||
for tag in value:
|
||||
@@ -72,7 +75,7 @@ class AnimeSideBar(MDBoxLayout):
|
||||
|
||||
def on_external_links(self,instance,value):
|
||||
self.external_links_container.clear_widgets()
|
||||
header = SideBarHeaderLabel()
|
||||
header = HeaderLabel()
|
||||
header.text = "External Links"
|
||||
self.external_links_container.add_widget(header)
|
||||
for site in value:
|
||||
|
||||
Reference in New Issue
Block a user