Skip to content

Commit

Permalink
When the privacy indicator is visible clicking on it will result in
Browse files Browse the repository at this point in the history
private mode being turned off.
  • Loading branch information
icefox committed Jun 19, 2010
1 parent bac8748 commit 76efe66
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/locationbar/privacyindicator.cpp
@@ -1,5 +1,5 @@
/*
* Copyright 2009 Benjamin C. Meyer <ben@meyerhome.net>
* Copyright 2009-2010 Benjamin C. Meyer <ben@meyerhome.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -27,6 +27,12 @@ PrivacyIndicator::PrivacyIndicator(QWidget *parent)
setPixmap(QPixmap(QLatin1String(":graphics/private.png")));
connect(BrowserApplication::instance(), SIGNAL(privacyChanged(bool)),
this, SLOT(setVisible(bool)));
setCursor(Qt::ArrowCursor);
setVisible(BrowserApplication::isPrivate());
}

void PrivacyIndicator::mousePressEvent(QMouseEvent *event)
{
Q_UNUSED(event)
BrowserApplication::instance()->setPrivate(false);
}
5 changes: 4 additions & 1 deletion src/locationbar/privacyindicator.h
@@ -1,5 +1,5 @@
/*
* Copyright 2009 Benjamin C. Meyer <ben@meyerhome.net>
* Copyright 2009-2010 Benjamin C. Meyer <ben@meyerhome.net>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -29,6 +29,9 @@ class PrivacyIndicator : public QLabel
public:
PrivacyIndicator(QWidget *parent = 0);

protected:
void mousePressEvent(QMouseEvent *event);

};

#endif // PRIVACYINDICATOR_H
Expand Down

0 comments on commit 76efe66

Please sign in to comment.