Commit ca3d8319 authored by Cédric Bellegarde's avatar Cédric Bellegarde

Keep readability status

parent a216a52c
Pipeline #37454 passed with stage
in 11 minutes and 9 seconds
......@@ -326,6 +326,14 @@ class WebView(WebKit2.WebView):
"""
return self.__content_manager
@property
def readable(self):
"""
True if webview readable
@return bool
"""
return self._readable
@property
def context(self):
"""
......@@ -450,6 +458,7 @@ class WebView(WebKit2.WebView):
# WebKitGTK doesn't provide an API to get selection, so try to guess
# it from clipboard FIXME Get it from extensions
self.__selection = ""
self._readable = False
self.__uri = None
self._title = None
self.__related_view = related_view
......
......@@ -199,6 +199,7 @@ class WebViewSignals(WebViewMenuSignals, WebViewJsSignals,
2000, title_changed_timeout)
self.__cancellable.cancel()
self.__cancellable.reset()
self._readable = False
def __on_title_changed(self, webview, title):
"""
......
......@@ -59,6 +59,7 @@ class WebViewJsSignals:
self.emit("readability-content",
message.replace("@EOLIE_READER@", ""))
elif message.startswith("@EOLIE_READERABLE@"):
self._readable = True
self._window.toolbar.title.show_readable_button(True)
# OpenSearch message
elif message.startswith("@EOLIE_OPENSEARCH@"):
......
......@@ -15,7 +15,7 @@ from gi.repository import Gtk, GLib, Gio, Gdk
from eolie.define import App, Indicator, LoadingType
from eolie.toolbar import Toolbar
from eolie.container import Container
from eolie.utils import get_current_monitor_model, name_from_profile_id
from eolie.utils import get_current_monitor_model
from eolie.helper_task import TaskHelper
from eolie.logger import Logger
......@@ -142,7 +142,9 @@ class Window(Gtk.ApplicationWindow):
else:
self.toolbar.title.progress.hide()
self.toolbar.title.set_loading(False)
profile = name_from_profile_id(webview.profile)
self.toolbar.title.show_readable_button(webview.readable)
# profile = name_from_profile_id(webview.profile)
profile = ""
title = webview.title
if title:
self.toolbar.title.set_title(profile, title)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment