mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-04-15 05:32:21 +00:00
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:
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user