Mercurial > hg > svgui
comparison view/PaneStack.cpp @ 1617:cbbb411da977
Merge
author | Chris Cannam |
---|---|
date | Tue, 21 Jul 2020 14:02:12 +0100 |
parents | 911330a28a7c |
children |
comparison
equal
deleted
inserted
replaced
1616:199dbb3547d4 | 1617:cbbb411da977 |
---|---|
219 av = m_panes[i].alignmentView; | 219 av = m_panes[i].alignmentView; |
220 if (!av) continue; | 220 if (!av) continue; |
221 if (!(m_options & int(Option::ShowAlignmentViews))) { | 221 if (!(m_options & int(Option::ShowAlignmentViews))) { |
222 av->hide(); | 222 av->hide(); |
223 } else { | 223 } else { |
224 av->setViewAbove(m_panes[i-1].pane); | 224 av->setAboveView(m_panes[i-1].pane); |
225 av->setViewBelow(m_panes[i].pane); | 225 av->setBelowView(m_panes[i].pane); |
226 av->setReferenceView(m_panes[0].pane); | |
226 av->show(); | 227 av->show(); |
227 } | 228 } |
228 } | 229 } |
229 | 230 |
230 adjustAlignmentViewHeights(size().height()); | 231 adjustAlignmentViewHeights(size().height()); |
234 PaneStack::unlinkAlignmentViews() | 235 PaneStack::unlinkAlignmentViews() |
235 { | 236 { |
236 for (int i = 0; in_range_for(m_panes, i); ++i) { | 237 for (int i = 0; in_range_for(m_panes, i); ++i) { |
237 auto av = m_panes[i].alignmentView; | 238 auto av = m_panes[i].alignmentView; |
238 if (!av) continue; | 239 if (!av) continue; |
239 av->setViewAbove(nullptr); | 240 av->setAboveView(nullptr); |
240 av->setViewBelow(nullptr); | 241 av->setBelowView(nullptr); |
242 av->setReferenceView(nullptr); | |
241 } | 243 } |
242 } | 244 } |
243 | 245 |
244 void | 246 void |
245 PaneStack::resizeEvent(QResizeEvent *ev) | 247 PaneStack::resizeEvent(QResizeEvent *ev) |
251 PaneStack::adjustAlignmentViewHeights(int forMyHeight) | 253 PaneStack::adjustAlignmentViewHeights(int forMyHeight) |
252 { | 254 { |
253 if (!(m_options & int(Option::ShowAlignmentViews))) return; | 255 if (!(m_options & int(Option::ShowAlignmentViews))) return; |
254 if (!(m_options & int(Option::NoUserResize))) return; | 256 if (!(m_options & int(Option::NoUserResize))) return; |
255 if (!isVisible()) return; | 257 if (!isVisible()) return; |
258 if (m_panes.empty()) return; | |
256 | 259 |
257 int heightPerPane = forMyHeight / int(m_panes.size()); | 260 int heightPerPane = forMyHeight / int(m_panes.size()); |
258 | 261 |
259 SVCERR << "heightPerPane = " << heightPerPane << " (" | 262 SVCERR << "heightPerPane = " << heightPerPane << " (" |
260 << forMyHeight << "/" << m_panes.size() << ")" << endl; | 263 << forMyHeight << "/" << m_panes.size() << ")" << endl; |