Skip to content

Commit 4d762f5

Browse files
committed
The Show Title and Show Subtitle options off the View item now work correctly. (#267)
1 parent da7c83b commit 4d762f5

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

FEBioStudio/GLDocument.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,10 @@ class CGLDocument : public CGLSceneDocument
162162

163163
public:
164164
bool ShowTitle() const { return m_showTitle; }
165+
void ShowTitle(bool b) { m_showTitle = b; }
166+
165167
bool ShowSubtitle() const { return m_showSubtitle; }
168+
void ShowSubtitle(bool b) { m_showSubtitle = b; }
166169

167170
public:
168171
void setModelInfo(const std::string& s) { m_info = s; }

FEBioStudio/GLView.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,11 +1407,11 @@ bool CGLView::isTitleVisible() const
14071407

14081408
void CGLView::showTitle(bool b)
14091409
{
1410-
if (m_ptitle)
1411-
{
1412-
if (b) m_ptitle->show(); else m_ptitle->hide();
1413-
repaint();
1414-
}
1410+
CGLDocument* doc = m_pWnd->GetGLDocument();
1411+
if (doc == nullptr) return;
1412+
1413+
doc->ShowTitle(b);
1414+
repaint();
14151415
}
14161416

14171417
bool CGLView::isSubtitleVisible() const
@@ -1421,11 +1421,10 @@ bool CGLView::isSubtitleVisible() const
14211421

14221422
void CGLView::showSubtitle(bool b)
14231423
{
1424-
if (m_psubtitle)
1425-
{
1426-
if (b) m_psubtitle->show(); else m_psubtitle->hide();
1427-
repaint();
1428-
}
1424+
CGLDocument* doc = m_pWnd->GetGLDocument();
1425+
if (doc == nullptr) return;
1426+
doc->ShowSubtitle(b);
1427+
repaint();
14291428
}
14301429

14311430
QImage correct_premultiplied_image(const QImage& image)

0 commit comments

Comments
 (0)