Toolbar/Menu update when Compare Pane Show/Hide

.. if the compare pane is automatically shown or hidden
   due to the user dragging and dropping the menu and toolbar
   got out of sync with the status of the widget.
This commit is contained in:
Mark Liversedge
2013-12-02 17:48:48 +01:00
parent 6d791f84a8
commit c700d7b3d9
2 changed files with 11 additions and 2 deletions

View File

@@ -26,6 +26,7 @@
#include "GcWindowRegistry.h"
#include "TrainDB.h"
#include "MetricAggregator.h"
#include "MainWindow.h"
#include "Settings.h"
@@ -134,6 +135,13 @@ TabView::setBottom(QWidget *widget)
mainSplitter->setStretchFactor(1,1);
}
void
TabView::dragEvent(bool x)
{
setShowBottom(x);
context->mainWindow->setToolButtons(); // toolbuttons reflect show/hide status
}
// hide and show bottom - but with a little animation ...
void
TabView::setShowBottom(bool x)

View File

@@ -66,6 +66,7 @@ class TabView : public QWidget
bool isTiled() const { return _tiled; }
// bottom
void dragEvent(bool); // showbottom on drag event
void setShowBottom(bool x);
bool isShowBottom() { if (bottom_) return bottom_->isVisible(); return false; }
bool hasBottom() { return (bottom_!=NULL); }
@@ -152,7 +153,7 @@ protected:
if (event->mimeData()->formats().contains("application/x-qabstractitemmodeldatalist")) {
if (tabView->hasBottom() && tabView->isShowBottom() == false) {
showForDrag = true;
tabView->setShowBottom(true);
tabView->dragEvent(true);
}
event->acceptProposedAction(); // always accept for this mimeData type
// so we continue to get the leave events we ignore (!)
@@ -170,7 +171,7 @@ protected:
if (showForDrag == true && !underMouse() && tabView->hasBottom() && tabView->isShowBottom() == true) {
showForDrag = false;
tabView->setShowBottom(false);
tabView->dragEvent(false);
}
}