first commit

This commit is contained in:
Kivy Signage Player
2025-09-26 17:04:17 +03:00
parent 7bdc706915
commit e052f4d068
2 changed files with 152 additions and 90 deletions

View File

@@ -390,10 +390,16 @@ class SignagePlayer(Widget):
return super(SignagePlayer, self).on_touch_move(touch)
def show_controls(self):
"""Show control buttons"""
"""Show control buttons and cursor"""
if self.controls_timer:
self.controls_timer.cancel()
# Show cursor
try:
Window.show_cursor = True
except:
pass
# Fade in controls
Animation(opacity=1, duration=0.3).start(self.ids.controls_layout)
@@ -408,8 +414,14 @@ class SignagePlayer(Widget):
self.controls_timer = Clock.schedule_once(self.hide_controls, 3)
def hide_controls(self, dt=None):
"""Hide control buttons"""
"""Hide control buttons and cursor"""
Animation(opacity=0, duration=0.5).start(self.ids.controls_layout)
# Hide cursor after controls are hidden
try:
Window.show_cursor = False
except:
pass
def show_settings(self, instance=None):
"""Show settings popup"""
@@ -424,13 +436,30 @@ class SignagePlayer(Widget):
class SignagePlayerApp(App):
def build(self):
# Set window to fullscreen
# Get screen resolution info
Logger.info(f"SignagePlayerApp: Screen size: {Window.size}")
Logger.info(f"SignagePlayerApp: Available screen size: {Window.system_size if hasattr(Window, 'system_size') else 'N/A'}")
# Set window to fullscreen and borderless
Window.fullscreen = 'auto'
Window.borderless = True
# Hide cursor after 3 seconds of inactivity
Clock.schedule_once(self.hide_cursor, 3)
return SignagePlayer()
def hide_cursor(self, dt):
"""Hide the mouse cursor"""
try:
Window.show_cursor = False
except:
pass # Some platforms don't support cursor hiding
def on_start(self):
# Log final window info
Logger.info(f"SignagePlayerApp: Final window size: {Window.size}")
Logger.info(f"SignagePlayerApp: Fullscreen: {Window.fullscreen}")
Logger.info("SignagePlayerApp: Application started")
def on_stop(self):

View File

@@ -8,102 +8,135 @@
size: self.size
pos: self.pos
# Main content area
BoxLayout:
id: main_layout
orientation: 'vertical'
# Content display area (will be dynamically populated)
Widget:
id: content_area
size_hint: 1, 1
# Status label (shown when no content or errors)
Label:
id: status_label
text: 'Loading...'
size_hint: 1, None
height: dp(40)
pos_hint: {'center_x': 0.5}
color: 1, 1, 1, 1
font_size: sp(16)
text_size: self.size
halign: 'center'
valign: 'middle'
# Control panel overlay
FloatLayout:
id: overlay_layout
# Main content area - FULLSCREEN WIDGET
Widget:
id: content_area
size_hint: 1, 1
pos_hint: {'x': 0, 'y': 0}
# Status label overlay (shown when no content or errors)
Label:
id: status_label
text: 'Loading...'
size_hint: None, None
size: dp(400), dp(60)
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
color: 1, 1, 1, 1
font_size: sp(18)
text_size: self.size
halign: 'center'
valign: 'middle'
canvas.before:
Color:
rgba: 0, 0, 0, 0.7
RoundedRectangle:
size: self.size
pos: self.pos
radius: [dp(15)]
# Control panel overlay (always on top)
BoxLayout:
id: controls_layout
orientation: 'horizontal'
size_hint: None, None
size: dp(450), dp(60)
pos_hint: {'right': 0.98, 'top': 0.98}
opacity: 0
spacing: dp(5)
padding: dp(10)
canvas.before:
Color:
rgba: 0.1, 0.1, 0.1, 0.9
RoundedRectangle:
size: self.size
pos: self.pos
radius: [dp(15)]
# Controls container
BoxLayout:
id: controls_layout
orientation: 'horizontal'
# Control buttons
Button:
id: prev_btn
text: '⏮'
size_hint: None, None
size: dp(450), dp(60)
pos_hint: {'right': 0.98, 'top': 0.98}
opacity: 0
spacing: dp(5)
padding: dp(10)
size: dp(60), dp(50)
font_size: sp(18)
background_color: 0.2, 0.2, 0.2, 0.9
color: 1, 1, 1, 1
on_press: root.previous_media()
canvas.before:
Color:
rgba: 0.1, 0.1, 0.1, 0.8
rgba: self.background_color
RoundedRectangle:
size: self.size
pos: self.pos
radius: [dp(10)]
radius: [dp(8)]
# Control buttons
Button:
id: prev_btn
text: '⏮'
size_hint: None, None
size: dp(60), dp(50)
font_size: sp(18)
background_color: 0.2, 0.2, 0.2, 1
color: 1, 1, 1, 1
on_press: root.previous_media()
Button:
id: play_pause_btn
text: '⏸'
size_hint: None, None
size: dp(60), dp(50)
font_size: sp(18)
background_color: 0.2, 0.6, 0.2, 1
color: 1, 1, 1, 1
on_press: root.toggle_pause()
Button:
id: next_btn
text: '⏭'
size_hint: None, None
size: dp(60), dp(50)
font_size: sp(18)
background_color: 0.2, 0.2, 0.2, 1
color: 1, 1, 1, 1
on_press: root.next_media()
Button:
id: settings_btn
text: '⚙'
size_hint: None, None
size: dp(60), dp(50)
font_size: sp(18)
background_color: 0.4, 0.4, 0.2, 1
color: 1, 1, 1, 1
on_press: root.show_settings()
Button:
id: exit_btn
text: '⏻'
size_hint: None, None
size: dp(60), dp(50)
font_size: sp(18)
background_color: 0.6, 0.2, 0.2, 1
color: 1, 1, 1, 1
on_press: root.exit_app()
Button:
id: play_pause_btn
text: '⏸'
size_hint: None, None
size: dp(60), dp(50)
font_size: sp(18)
background_color: 0.2, 0.6, 0.2, 0.9
color: 1, 1, 1, 1
on_press: root.toggle_pause()
canvas.before:
Color:
rgba: self.background_color
RoundedRectangle:
size: self.size
pos: self.pos
radius: [dp(8)]
Button:
id: next_btn
text: '⏭'
size_hint: None, None
size: dp(60), dp(50)
font_size: sp(18)
background_color: 0.2, 0.2, 0.2, 0.9
color: 1, 1, 1, 1
on_press: root.next_media()
canvas.before:
Color:
rgba: self.background_color
RoundedRectangle:
size: self.size
pos: self.pos
radius: [dp(8)]
Button:
id: settings_btn
text: '⚙'
size_hint: None, None
size: dp(60), dp(50)
font_size: sp(18)
background_color: 0.4, 0.4, 0.2, 0.9
color: 1, 1, 1, 1
on_press: root.show_settings()
canvas.before:
Color:
rgba: self.background_color
RoundedRectangle:
size: self.size
pos: self.pos
radius: [dp(8)]
Button:
id: exit_btn
text: '⏻'
size_hint: None, None
size: dp(60), dp(50)
font_size: sp(18)
background_color: 0.6, 0.2, 0.2, 0.9
color: 1, 1, 1, 1
on_press: root.exit_app()
canvas.before:
Color:
rgba: self.background_color
RoundedRectangle:
size: self.size
pos: self.pos
radius: [dp(8)]
# Settings popup content