first commit
This commit is contained in:
35
src/main.py
35
src/main.py
@@ -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):
|
||||||
|
|||||||
@@ -8,102 +8,135 @@
|
|||||||
size: self.size
|
size: self.size
|
||||||
pos: self.pos
|
pos: self.pos
|
||||||
|
|
||||||
# Main content area
|
# Main content area - FULLSCREEN WIDGET
|
||||||
BoxLayout:
|
Widget:
|
||||||
id: main_layout
|
id: content_area
|
||||||
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
|
|
||||||
size_hint: 1, 1
|
size_hint: 1, 1
|
||||||
|
pos_hint: {'x': 0, 'y': 0}
|
||||||
|
|
||||||
# Controls container
|
# Status label overlay (shown when no content or errors)
|
||||||
BoxLayout:
|
Label:
|
||||||
id: controls_layout
|
id: status_label
|
||||||
orientation: 'horizontal'
|
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)]
|
||||||
|
|
||||||
|
# Control buttons
|
||||||
|
Button:
|
||||||
|
id: prev_btn
|
||||||
|
text: '⏮'
|
||||||
size_hint: None, None
|
size_hint: None, None
|
||||||
size: dp(450), dp(60)
|
size: dp(60), dp(50)
|
||||||
pos_hint: {'right': 0.98, 'top': 0.98}
|
font_size: sp(18)
|
||||||
opacity: 0
|
background_color: 0.2, 0.2, 0.2, 0.9
|
||||||
spacing: dp(5)
|
color: 1, 1, 1, 1
|
||||||
padding: dp(10)
|
on_press: root.previous_media()
|
||||||
canvas.before:
|
canvas.before:
|
||||||
Color:
|
Color:
|
||||||
rgba: 0.1, 0.1, 0.1, 0.8
|
rgba: self.background_color
|
||||||
RoundedRectangle:
|
RoundedRectangle:
|
||||||
size: self.size
|
size: self.size
|
||||||
pos: self.pos
|
pos: self.pos
|
||||||
radius: [dp(10)]
|
radius: [dp(8)]
|
||||||
|
|
||||||
# Control buttons
|
Button:
|
||||||
Button:
|
id: play_pause_btn
|
||||||
id: prev_btn
|
text: '⏸'
|
||||||
text: '⏮'
|
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, 0.9
|
||||||
background_color: 0.2, 0.2, 0.2, 1
|
color: 1, 1, 1, 1
|
||||||
color: 1, 1, 1, 1
|
on_press: root.toggle_pause()
|
||||||
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: next_btn
|
||||||
text: '⏸'
|
text: '⏭'
|
||||||
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.2, 0.2, 0.9
|
||||||
color: 1, 1, 1, 1
|
color: 1, 1, 1, 1
|
||||||
on_press: root.toggle_pause()
|
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: next_btn
|
id: settings_btn
|
||||||
text: '⏭'
|
text: '⚙'
|
||||||
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.4, 0.4, 0.2, 0.9
|
||||||
color: 1, 1, 1, 1
|
color: 1, 1, 1, 1
|
||||||
on_press: root.next_media()
|
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: settings_btn
|
id: exit_btn
|
||||||
text: '⚙'
|
text: '⏻'
|
||||||
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.6, 0.2, 0.2, 0.9
|
||||||
color: 1, 1, 1, 1
|
color: 1, 1, 1, 1
|
||||||
on_press: root.show_settings()
|
on_press: root.exit_app()
|
||||||
|
canvas.before:
|
||||||
Button:
|
Color:
|
||||||
id: exit_btn
|
rgba: self.background_color
|
||||||
text: '⏻'
|
RoundedRectangle:
|
||||||
size_hint: None, None
|
size: self.size
|
||||||
size: dp(60), dp(50)
|
pos: self.pos
|
||||||
font_size: sp(18)
|
radius: [dp(8)]
|
||||||
background_color: 0.6, 0.2, 0.2, 1
|
|
||||||
color: 1, 1, 1, 1
|
|
||||||
on_press: root.exit_app()
|
|
||||||
|
|
||||||
|
|
||||||
# Settings popup content
|
# Settings popup content
|
||||||
|
|||||||
Reference in New Issue
Block a user