refs #855, re-center load indicator when resizing views

This commit is contained in:
Klaus Basan
2017-01-06 20:39:45 +01:00
committed by Mathew Sutcliffe
parent 78c55170d6
commit c2861b792c
2 changed files with 4 additions and 4 deletions

View File

@@ -182,7 +182,7 @@ namespace BlackGui
bool CViewBaseNonTemplate::isShowingLoadIndicator() const bool CViewBaseNonTemplate::isShowingLoadIndicator() const
{ {
return m_enabledLoadIndicator && m_showingLoadIndicator; return m_loadIndicator && m_enabledLoadIndicator && m_showingLoadIndicator;
} }
void CViewBaseNonTemplate::setSelectionModel(QItemSelectionModel *model) void CViewBaseNonTemplate::setSelectionModel(QItemSelectionModel *model)
@@ -378,14 +378,14 @@ namespace BlackGui
menuActions.addAction(CIcons::refresh16(), "Clear highlighting", CMenuAction::pathViewClearHighlighting(), nullptr , { this, &CViewBaseNonTemplate::clearHighlighting }); menuActions.addAction(CIcons::refresh16(), "Clear highlighting", CMenuAction::pathViewClearHighlighting(), nullptr , { this, &CViewBaseNonTemplate::clearHighlighting });
} }
void CViewBaseNonTemplate::showEvent(QShowEvent *event) void CViewBaseNonTemplate::resizeEvent(QResizeEvent *event)
{ {
if (this->isShowingLoadIndicator()) if (this->isShowingLoadIndicator())
{ {
// re-center // re-center
this->centerLoadIndicator(); this->centerLoadIndicator();
} }
QTableView::showEvent(event); QTableView::resizeEvent(event);
} }
int CViewBaseNonTemplate::getHorizontalHeaderFontHeight() const int CViewBaseNonTemplate::getHorizontalHeaderFontHeight() const

View File

@@ -342,7 +342,7 @@ namespace BlackGui
//! \name Functions from QTableView //! \name Functions from QTableView
//! @{ //! @{
virtual void showEvent(QShowEvent *event) override; virtual void resizeEvent(QResizeEvent *event) override;
virtual void dragEnterEvent(QDragEnterEvent *event) override; virtual void dragEnterEvent(QDragEnterEvent *event) override;
virtual void dragMoveEvent(QDragMoveEvent *event) override; virtual void dragMoveEvent(QDragMoveEvent *event) override;
virtual void dragLeaveEvent(QDragLeaveEvent *event) override; virtual void dragLeaveEvent(QDragLeaveEvent *event) override;