mirror of
https://github.com/DYefremov/DemonEditor.git
synced 2026-01-30 03:10:09 +01:00
fix playback from the start screen
This commit is contained in:
@@ -2055,8 +2055,7 @@ class Application(Gtk.Application):
|
||||
self.set_playback_elms_active()
|
||||
else:
|
||||
if not self._player_box.get_visible():
|
||||
w, h = self._main_window.get_size()
|
||||
self._player_box.set_size_request(w * 0.6, -1)
|
||||
self.set_player_area_size(self._player_box)
|
||||
self._current_mrl = url
|
||||
self._player_box.set_visible(True)
|
||||
|
||||
@@ -2126,14 +2125,13 @@ class Application(Gtk.Application):
|
||||
self._fav_view.do_grab_focus(self._fav_view)
|
||||
|
||||
def get_time_str(self, duration):
|
||||
""" returns a string representation of time from duration in milliseconds """
|
||||
""" Returns a string representation of time from duration in milliseconds """
|
||||
m, s = divmod(duration // 1000, 60)
|
||||
h, m = divmod(m, 60)
|
||||
return "{}{:02d}:{:02d}".format(str(h) + ":" if h else "", m, s)
|
||||
|
||||
def on_drawing_area_realize(self, widget):
|
||||
w, h = self._main_window.get_size()
|
||||
widget.set_size_request(w * 0.6, -1)
|
||||
self.set_player_area_size(widget)
|
||||
|
||||
if not self._player:
|
||||
try:
|
||||
@@ -2153,6 +2151,10 @@ class Application(Gtk.Application):
|
||||
finally:
|
||||
self.set_playback_elms_active()
|
||||
|
||||
def set_player_area_size(self, widget):
|
||||
w, h = self._main_window.get_size()
|
||||
widget.set_size_request(w * 0.6, -1)
|
||||
|
||||
def on_player_drawing_area_draw(self, widget, cr):
|
||||
""" Used for black background drawing in the player drawing area.
|
||||
|
||||
@@ -2272,6 +2274,11 @@ class Application(Gtk.Application):
|
||||
|
||||
def on_watch(self, item=None):
|
||||
""" Switch to the channel and watch in the player """
|
||||
if self._app_info_box.get_visible() and self._settings.play_streams_mode is PlayStreamsMode.BUILT_IN:
|
||||
self.set_player_area_size(self._player_box)
|
||||
self._player_box.set_visible(True)
|
||||
GLib.idle_add(self._app_info_box.set_visible, False)
|
||||
|
||||
self._http_api.send(HttpRequestType.STREAM_CURRENT, None, self.watch)
|
||||
|
||||
def watch(self, data):
|
||||
|
||||
Reference in New Issue
Block a user