Mejoras en la gui
This commit is contained in:
parent
c67331539d
commit
b6ebd06342
|
@ -0,0 +1,3 @@
|
||||||
|
[graphics]
|
||||||
|
font_name = CyrBit.ttf
|
||||||
|
|
|
@ -7,6 +7,7 @@ import kivy
|
||||||
kivy.require('1.11.1')
|
kivy.require('1.11.1')
|
||||||
|
|
||||||
from kivy.app import App
|
from kivy.app import App
|
||||||
|
from kivy.config import Config
|
||||||
from kivy.core.window import Window
|
from kivy.core.window import Window
|
||||||
from kivy.properties import StringProperty, ObjectProperty, ListProperty, BooleanProperty
|
from kivy.properties import StringProperty, ObjectProperty, ListProperty, BooleanProperty
|
||||||
from kivy.uix.boxlayout import BoxLayout
|
from kivy.uix.boxlayout import BoxLayout
|
||||||
|
@ -60,7 +61,7 @@ class Song(BoxLayout):
|
||||||
self.ass = str(entry)
|
self.ass = str(entry)
|
||||||
elif entry.name == 'thumb.jpg':
|
elif entry.name == 'thumb.jpg':
|
||||||
self.thumbnail = str(entry)
|
self.thumbnail = str(entry)
|
||||||
elif entry.name.endswith('jpg'):
|
elif entry.name == 'cover.jpg':
|
||||||
self.cover = str(entry)
|
self.cover = str(entry)
|
||||||
elif entry.name == 'index.html':
|
elif entry.name == 'index.html':
|
||||||
continue
|
continue
|
||||||
|
@ -114,7 +115,9 @@ class KaraokeGUI(BoxLayout):
|
||||||
song.active = False
|
song.active = False
|
||||||
value.active = True
|
value.active = True
|
||||||
current_song_image = self.ids['current_song_image']
|
current_song_image = self.ids['current_song_image']
|
||||||
|
current_song_title = self.ids['current_song_title']
|
||||||
current_song_image.source = value.cover
|
current_song_image.source = value.cover
|
||||||
|
current_song_title.text = value.name
|
||||||
|
|
||||||
scrollview = self.ids['songs_scroll']
|
scrollview = self.ids['songs_scroll']
|
||||||
scrollview.scroll_to(value)
|
scrollview.scroll_to(value)
|
||||||
|
@ -175,4 +178,6 @@ class KaraokeApp(App):
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
Window.fullscreen = True
|
Window.fullscreen = True
|
||||||
|
Config.set('graphics', 'font_name', 'CyrBit.ttf')
|
||||||
|
Config.write()
|
||||||
KaraokeApp(Path(sys.argv[1])).run()
|
KaraokeApp(Path(sys.argv[1])).run()
|
||||||
|
|
|
@ -1,57 +1,89 @@
|
||||||
KaraokeGUI:
|
KaraokeGUI:
|
||||||
|
|
||||||
|
<Label>:
|
||||||
|
font_name: 'CyrBit.ttf'
|
||||||
|
font_size: 24
|
||||||
|
|
||||||
|
<Action@Button>:
|
||||||
|
size_hint: 1, None
|
||||||
|
font_size: 32
|
||||||
|
height: 40
|
||||||
|
background_color: 0, 0, 0, 1
|
||||||
|
|
||||||
<Song>:
|
<Song>:
|
||||||
size_hint: None, None
|
size_hint: None, None
|
||||||
size: 200, 200
|
size: 200, 200
|
||||||
orientation: 'vertical'
|
orientation: 'vertical'
|
||||||
padding: 0
|
padding: 3
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
||||||
canvas.before:
|
canvas.before:
|
||||||
Color:
|
Color:
|
||||||
rgb: 0.9, 0.9, 0.9 if self.active else 0.3, 0.3, 0.3
|
rgb: (0.5, 0.1, 0.5) if self.active else (0.3, 0.3, 0.3)
|
||||||
Line:
|
Line:
|
||||||
rectangle: self.pos[0], self.pos[1], self.size[0], self.size[1]
|
rectangle: self.pos[0], self.pos[1], self.size[0], self.size[1]
|
||||||
|
width: 2
|
||||||
|
joint: 'miter'
|
||||||
|
Color:
|
||||||
|
rgb: 0.9, 0.9, 0.9
|
||||||
|
|
||||||
Image:
|
Image:
|
||||||
source: self.parent.thumbnail
|
source: self.parent.thumbnail
|
||||||
size_hint: 1, 0.8
|
size_hint: 1, 0.8
|
||||||
Label:
|
Label:
|
||||||
canvas.before:
|
|
||||||
Color:
|
|
||||||
rgb: 0.3, 0.3, 0.3
|
|
||||||
Rectangle:
|
|
||||||
pos: self.pos
|
|
||||||
size: self.size
|
|
||||||
size_hint: 1, 0.1
|
size_hint: 1, 0.1
|
||||||
text: self.parent.name
|
text: self.parent.name
|
||||||
|
|
||||||
<KaraokeGUI>:
|
<KaraokeGUI>:
|
||||||
orientation: 'vertical'
|
orientation: 'vertical'
|
||||||
|
BoxLayout:
|
||||||
|
canvas.before:
|
||||||
|
Rectangle:
|
||||||
|
source: 'images/fondo_monkey_island_barco.png'
|
||||||
|
pos: self.pos
|
||||||
|
size: self.size
|
||||||
|
canvas.after:
|
||||||
|
Rectangle:
|
||||||
|
source: 'images/fondo_monkey_island_pareja.png'
|
||||||
|
pos: self.pos
|
||||||
|
size: self.size
|
||||||
|
orientation: 'vertical'
|
||||||
|
Label:
|
||||||
|
id: current_song_title
|
||||||
|
color: 0.9, 0.1, 0.3, 1
|
||||||
|
outline_color: 1, 1, 1, 1
|
||||||
|
outline_width: 1
|
||||||
|
size_hint: 1, 0.1
|
||||||
|
text: ''
|
||||||
Image:
|
Image:
|
||||||
id: current_song_image
|
id: current_song_image
|
||||||
source: ''
|
source: ''
|
||||||
Button:
|
|
||||||
text: '>'
|
|
||||||
on_press: root.play()
|
|
||||||
size_hint: 1, 0.1
|
|
||||||
|
|
||||||
BoxLayout:
|
BoxLayout: # Bottom actions and slides
|
||||||
orientation: 'horizontal'
|
orientation: 'horizontal'
|
||||||
height: 220
|
height: 220
|
||||||
size_hint: 1, None
|
size_hint: 1, None
|
||||||
|
|
||||||
Button:
|
BoxLayout:
|
||||||
size_hint: None, None
|
orientation: 'vertical'
|
||||||
size: 20, 220
|
height: 220
|
||||||
text: '<'
|
size_hint: 0.3, None
|
||||||
|
Action:
|
||||||
|
text: 'Play'
|
||||||
|
on_press: root.play()
|
||||||
|
Action:
|
||||||
|
text: 'Previous'
|
||||||
on_press: root.previous()
|
on_press: root.previous()
|
||||||
|
Action:
|
||||||
|
text: 'Next'
|
||||||
|
on_press: root.next()
|
||||||
|
Widget:
|
||||||
|
|
||||||
ScrollView:
|
ScrollView:
|
||||||
id: songs_scroll
|
id: songs_scroll
|
||||||
do_scroll_x: True
|
do_scroll_x: True
|
||||||
do_scroll_y: False
|
do_scroll_y: False
|
||||||
size_hint: 1, None
|
size_hint: 0.7, None
|
||||||
height: 220
|
height: 220
|
||||||
|
|
||||||
GridLayout:
|
GridLayout:
|
||||||
|
@ -61,9 +93,3 @@ KaraokeGUI:
|
||||||
padding: 10
|
padding: 10
|
||||||
spacing: 10
|
spacing: 10
|
||||||
size_hint: None, 1
|
size_hint: None, 1
|
||||||
|
|
||||||
Button:
|
|
||||||
size_hint: None, None
|
|
||||||
size: 20, 220
|
|
||||||
text: '>'
|
|
||||||
on_press: root.next()
|
|
||||||
|
|
Reference in New Issue