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) return super(SignagePlayer, self).on_touch_move(touch)
def show_controls(self): def show_controls(self):
"""Show control buttons""" """Show control buttons and cursor"""
if self.controls_timer: if self.controls_timer:
self.controls_timer.cancel() self.controls_timer.cancel()
# Show cursor
try:
Window.show_cursor = True
except:
pass
# Fade in controls # Fade in controls
Animation(opacity=1, duration=0.3).start(self.ids.controls_layout) Animation(opacity=1, duration=0.3).start(self.ids.controls_layout)
@@ -408,9 +414,15 @@ class SignagePlayer(Widget):
self.controls_timer = Clock.schedule_once(self.hide_controls, 3) self.controls_timer = Clock.schedule_once(self.hide_controls, 3)
def hide_controls(self, dt=None): 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) 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): def show_settings(self, instance=None):
"""Show settings popup""" """Show settings popup"""
popup = SettingsPopup(player_instance=self) popup = SettingsPopup(player_instance=self)
@@ -424,13 +436,30 @@ class SignagePlayer(Widget):
class SignagePlayerApp(App): class SignagePlayerApp(App):
def build(self): 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.fullscreen = 'auto'
Window.borderless = True Window.borderless = True
# Hide cursor after 3 seconds of inactivity
Clock.schedule_once(self.hide_cursor, 3)
return SignagePlayer() 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): 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") Logger.info("SignagePlayerApp: Application started")
def on_stop(self): def on_stop(self):

View File

@@ -8,35 +8,33 @@
size: self.size size: self.size
pos: self.pos pos: self.pos
# Main content area # Main content area - FULLSCREEN WIDGET
BoxLayout:
id: main_layout
orientation: 'vertical'
# Content display area (will be dynamically populated)
Widget: Widget:
id: content_area id: content_area
size_hint: 1, 1 size_hint: 1, 1
pos_hint: {'x': 0, 'y': 0}
# Status label (shown when no content or errors) # Status label overlay (shown when no content or errors)
Label: Label:
id: status_label id: status_label
text: 'Loading...' text: 'Loading...'
size_hint: 1, None size_hint: None, None
height: dp(40) size: dp(400), dp(60)
pos_hint: {'center_x': 0.5} pos_hint: {'center_x': 0.5, 'center_y': 0.5}
color: 1, 1, 1, 1 color: 1, 1, 1, 1
font_size: sp(16) font_size: sp(18)
text_size: self.size text_size: self.size
halign: 'center' halign: 'center'
valign: 'middle' valign: 'middle'
canvas.before:
Color:
rgba: 0, 0, 0, 0.7
RoundedRectangle:
size: self.size
pos: self.pos
radius: [dp(15)]
# Control panel overlay # Control panel overlay (always on top)
FloatLayout:
id: overlay_layout
size_hint: 1, 1
# Controls container
BoxLayout: BoxLayout:
id: controls_layout id: controls_layout
orientation: 'horizontal' orientation: 'horizontal'
@@ -48,11 +46,11 @@
padding: dp(10) padding: dp(10)
canvas.before: canvas.before:
Color: Color:
rgba: 0.1, 0.1, 0.1, 0.8 rgba: 0.1, 0.1, 0.1, 0.9
RoundedRectangle: RoundedRectangle:
size: self.size size: self.size
pos: self.pos pos: self.pos
radius: [dp(10)] radius: [dp(15)]
# Control buttons # Control buttons
Button: Button:
@@ -61,9 +59,16 @@
size_hint: None, None size_hint: None, None
size: dp(60), dp(50) size: dp(60), dp(50)
font_size: sp(18) font_size: sp(18)
background_color: 0.2, 0.2, 0.2, 1 background_color: 0.2, 0.2, 0.2, 0.9
color: 1, 1, 1, 1 color: 1, 1, 1, 1
on_press: root.previous_media() on_press: root.previous_media()
canvas.before:
Color:
rgba: self.background_color
RoundedRectangle:
size: self.size
pos: self.pos
radius: [dp(8)]
Button: Button:
id: play_pause_btn id: play_pause_btn
@@ -71,9 +76,16 @@
size_hint: None, None size_hint: None, None
size: dp(60), dp(50) size: dp(60), dp(50)
font_size: sp(18) font_size: sp(18)
background_color: 0.2, 0.6, 0.2, 1 background_color: 0.2, 0.6, 0.2, 0.9
color: 1, 1, 1, 1 color: 1, 1, 1, 1
on_press: root.toggle_pause() on_press: root.toggle_pause()
canvas.before:
Color:
rgba: self.background_color
RoundedRectangle:
size: self.size
pos: self.pos
radius: [dp(8)]
Button: Button:
id: next_btn id: next_btn
@@ -81,9 +93,16 @@
size_hint: None, None size_hint: None, None
size: dp(60), dp(50) size: dp(60), dp(50)
font_size: sp(18) font_size: sp(18)
background_color: 0.2, 0.2, 0.2, 1 background_color: 0.2, 0.2, 0.2, 0.9
color: 1, 1, 1, 1 color: 1, 1, 1, 1
on_press: root.next_media() on_press: root.next_media()
canvas.before:
Color:
rgba: self.background_color
RoundedRectangle:
size: self.size
pos: self.pos
radius: [dp(8)]
Button: Button:
id: settings_btn id: settings_btn
@@ -91,9 +110,16 @@
size_hint: None, None size_hint: None, None
size: dp(60), dp(50) size: dp(60), dp(50)
font_size: sp(18) font_size: sp(18)
background_color: 0.4, 0.4, 0.2, 1 background_color: 0.4, 0.4, 0.2, 0.9
color: 1, 1, 1, 1 color: 1, 1, 1, 1
on_press: root.show_settings() on_press: root.show_settings()
canvas.before:
Color:
rgba: self.background_color
RoundedRectangle:
size: self.size
pos: self.pos
radius: [dp(8)]
Button: Button:
id: exit_btn id: exit_btn
@@ -101,9 +127,16 @@
size_hint: None, None size_hint: None, None
size: dp(60), dp(50) size: dp(60), dp(50)
font_size: sp(18) font_size: sp(18)
background_color: 0.6, 0.2, 0.2, 1 background_color: 0.6, 0.2, 0.2, 0.9
color: 1, 1, 1, 1 color: 1, 1, 1, 1
on_press: root.exit_app() 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 # Settings popup content