Commit 3e1680dc authored by Henrik Fehlauer's avatar Henrik Fehlauer

Hide fullscreen thumbnailbar when on-canvas image tools are in use

In fullscreen mode the thumbnailbar will slide in once the cursor moves
near the top. As this covers parts of the image, it makes the upper
handles of the {nav Crop} tool inaccessible and prevents the user from
applying the {nav Red Eye Reduction} tool on every part of the image.

`setDistractionFreeMode` already provides the necessary wiring which was
supposed to prevent the hot edge from triggering, however it only
disabled the auto-hiding. This is fixed by adding a function and a
variable which disables auto-showing.

Test Plan:
Open image in fullscreen {nav View} mode, press {key Shift C} to trigger
{nav Crop} and move cursor to the top. The thumbnailbar does not
reappear again. Stop the tool, now triggering should resume.

Switching to fullscreen should show the thumbnailbar initially without
the cursor triggering, as before.

Reviewers: #gwenview, huoni

Reviewed By: huoni

Subscribers: ngraham

Differential Revision:
parent a4b8511d
......@@ -466,7 +466,7 @@ void FullScreenContent::setFullScreenMode(bool fullScreenMode)
void FullScreenContent::setDistractionFreeMode(bool distractionFreeMode)
void FullScreenContent::slotImageMetaInfoDialogClosed()
......@@ -57,6 +57,7 @@ struct FullScreenBarPrivate
QTimeLine* mTimeLine;
QTimer* mAutoHideCursorTimer;
bool mAutoHidingEnabled;
bool mEdgeTriggerEnabled;
QTimer* mInitialHideTimer;
void startTimeLine()
......@@ -116,6 +117,7 @@ FullScreenBar::FullScreenBar(QWidget* parent)
d->q = this;
d->mAutoHidingEnabled = true;
d->mEdgeTriggerEnabled = true;
d->mTimeLine = new QTimeLine(SLIDE_DURATION, this);
......@@ -227,7 +229,7 @@ bool FullScreenBar::eventFilter(QObject* object, QEvent* event)
} else {
QMouseEvent* mouseEvent = static_cast<QMouseEvent *>(event);
if (mouseEvent->buttons() == 0 && d->slideInTriggerRect().contains(QCursor::pos())) {
if (d->mEdgeTriggerEnabled && mouseEvent->buttons() == 0 && d->slideInTriggerRect().contains(QCursor::pos())) {
......@@ -269,4 +271,9 @@ void FullScreenBar::setAutoHidingEnabled(bool value)
d->mAutoHidingEnabled = value;
void FullScreenBar::setEdgeTriggerEnabled(bool value)
d->mEdgeTriggerEnabled = value;
} // namespace
......@@ -46,6 +46,7 @@ public:
void setActivated(bool);
void setAutoHidingEnabled(bool);
void setEdgeTriggerEnabled(bool);
QSize sizeHint() const Q_DECL_OVERRIDE;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment