Skip to content

Commit

Permalink
Merge pull request #206 from rainemak/currentPageActive
Browse files Browse the repository at this point in the history
Keep current page active
  • Loading branch information
Raine Mäkeläinen committed Oct 20, 2014
2 parents f74bdb9 + 86901ec commit 29ab092
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/declarativewebpage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ int DeclarativeWebPage::tabId() const

void DeclarativeWebPage::setTabId(int tabId)
{
m_tabId = tabId;
if (m_tabId != tabId) {
m_tabId = tabId;
emit tabIdChanged();
}
}

bool DeclarativeWebPage::domContentLoaded() const
Expand Down
3 changes: 2 additions & 1 deletion src/declarativewebpage.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class DeclarativeWebContainer;
class DeclarativeWebPage : public QuickMozView {
Q_OBJECT
Q_PROPERTY(DeclarativeWebContainer* container READ container NOTIFY containerChanged FINAL)
Q_PROPERTY(int tabId READ tabId FINAL)
Q_PROPERTY(int tabId READ tabId NOTIFY tabIdChanged FINAL)
Q_PROPERTY(bool viewReady MEMBER m_viewReady NOTIFY viewReadyChanged FINAL)
Q_PROPERTY(bool loaded MEMBER m_loaded NOTIFY loadedChanged FINAL)
Q_PROPERTY(bool userHasDraggedWhileLoading MEMBER m_userHasDraggedWhileLoading NOTIFY userHasDraggedWhileLoadingChanged FINAL)
Expand Down Expand Up @@ -57,6 +57,7 @@ class DeclarativeWebPage : public QuickMozView {

signals:
void containerChanged();
void tabIdChanged();
void viewReadyChanged();
void loadedChanged();
void userHasDraggedWhileLoadingChanged();
Expand Down
2 changes: 1 addition & 1 deletion src/pages/components/WebView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ WebContainer {
enabled: container.active
// Active could pause e.g. video in cover by anding
// Qt.application.active to visible
active: visible
active: visible || container.tabId == tabId

// There needs to be enough content for enabling chrome gesture
chromeGestureThreshold: container.toolbarHeight / 2
Expand Down

0 comments on commit 29ab092

Please sign in to comment.