PaneStack.cpp
Go to the documentation of this file.
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Sonic Visualiser
5  An audio file viewer and annotation editor.
6  Centre for Digital Music, Queen Mary, University of London.
7  This file copyright 2006 Chris Cannam and QMUL.
8 
9  This program is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License as
11  published by the Free Software Foundation; either version 2 of the
12  License, or (at your option) any later version. See the file
13  COPYING included with this distribution for more information.
14 */
15 
16 #include "PaneStack.h"
17 
18 #include "Pane.h"
19 #include "widgets/PropertyStack.h"
20 #include "widgets/IconLoader.h"
21 #include "widgets/ClickableLabel.h"
22 #include "layer/Layer.h"
23 #include "ViewManager.h"
24 #include "AlignmentView.h"
25 
26 #include <QApplication>
27 #include <QHBoxLayout>
28 #include <QVBoxLayout>
29 #include <QPainter>
30 #include <QPalette>
31 #include <QLabel>
32 #include <QPushButton>
33 #include <QSplitter>
34 #include <QStackedWidget>
35 #include <QResizeEvent>
36 
37 #include <iostream>
38 
39 //#define DEBUG_PANE_STACK 1
40 
41 PaneStack::PaneStack(QWidget *parent,
42  ViewManager *viewManager,
43  int options) :
44  QFrame(parent),
45  m_currentPane(nullptr),
46  m_options(options),
47  m_splitter(nullptr),
48  m_autoResizeStack(nullptr),
49  m_propertyStackStack(new QStackedWidget),
50  m_viewManager(viewManager),
51  m_propertyStackMinWidth(100),
52  m_layoutStyle(PropertyStackPerPaneLayout)
53 {
54  QHBoxLayout *layout = new QHBoxLayout;
55  layout->setMargin(0);
56  layout->setSpacing(0);
57 
58  if (m_options & int(Option::NoUserResize)) {
59 
60  m_autoResizeStack = new QWidget;
61  m_autoResizeLayout = new QVBoxLayout;
62  m_autoResizeLayout->setMargin(0);
63  m_autoResizeLayout->setSpacing(0);
65  layout->addWidget(m_autoResizeStack);
66  layout->setStretchFactor(m_autoResizeStack, 1);
67 
68  } else {
69 
70  m_splitter = new QSplitter;
71  m_splitter->setOrientation(Qt::Vertical);
72  m_splitter->setOpaqueResize(false);
73  layout->addWidget(m_splitter);
74  layout->setStretchFactor(m_splitter, 1);
75  }
76 
79  }
80 
81  m_propertyStackStack->hide();
82  layout->addWidget(m_propertyStackStack);
83 
84  setLayout(layout);
85 }
86 
87 Pane *
89 {
90  QFrame *frame = new QFrame;
91 
92  QGridLayout *layout = new QGridLayout;
93  layout->setMargin(0);
94  layout->setHorizontalSpacing(m_viewManager->scalePixelSize(2));
95 
96  AlignmentView *av = nullptr;
97 
99  layout->setVerticalSpacing(0);
100  av = new AlignmentView(frame);
101  av->setFixedHeight(ViewManager::scalePixelSize(20));
103  av->setVisible(false); // for now
104  layout->addWidget(av, 0, 1);
105  } else {
106  layout->setVerticalSpacing(m_viewManager->scalePixelSize(2));
107  }
108 
109  QPushButton *xButton = new QPushButton(frame);
110  xButton->setIcon(IconLoader().load("cross"));
111  xButton->setFixedSize(QSize(16, 16));
112  xButton->setFlat(true);
113  xButton->setVisible(!(m_options & int(Option::NoPaneAccessories)));
114  if (m_panes.empty() && (m_options & int(Option::NoCloseOnFirstPane))) {
115  xButton->setVisible(false);
116  }
117  layout->addWidget(xButton, 1, 0);
118  connect(xButton, SIGNAL(clicked()), this, SLOT(paneDeleteButtonClicked()));
119 
120  ClickableLabel *currentIndicator = new ClickableLabel(frame);
121  connect(currentIndicator, SIGNAL(clicked()), this, SLOT(indicatorClicked()));
122  layout->addWidget(currentIndicator, 2, 0);
123  layout->setRowStretch(2, 20);
124  currentIndicator->setMinimumWidth(16);
125  currentIndicator->setMinimumHeight(16);
126  currentIndicator->setScaledContents(true);
127  currentIndicator->setVisible(!(m_options & int(Option::NoPaneAccessories)));
128 
129  sv_frame_t initialCentreFrame = -1;
130  if (!m_panes.empty()) {
131  initialCentreFrame = m_panes[0].pane->getCentreFrame();
132  }
133 
134  Pane *pane = new Pane(frame);
135  if (initialCentreFrame >= 0) {
136  pane->setViewManager(m_viewManager, initialCentreFrame);
137  } else {
139  }
140  layout->addWidget(pane, 1, 1, 2, 1);
141  layout->setColumnStretch(1, 20);
142 
143  QWidget *properties = nullptr;
144  if (m_options & int(Option::NoPropertyStacks)) {
145  properties = new QFrame();
146  } else {
147  properties = new PropertyStack(frame, pane);
148  connect(properties, SIGNAL(propertyContainerSelected(View *, PropertyContainer *)),
149  this, SLOT(propertyContainerSelected(View *, PropertyContainer *)));
150  connect(properties, SIGNAL(propertyContainerContextMenuRequested(View *, PropertyContainer *, QPoint)),
151  this, SLOT(propertyContainerContextMenuRequested(View *, PropertyContainer *, QPoint)));
152  connect(properties, SIGNAL(viewSelected(View *)),
153  this, SLOT(viewSelected(View *)));
154  connect(properties, SIGNAL(contextHelpChanged(const QString &)),
155  this, SIGNAL(contextHelpChanged(const QString &)));
156  }
158  layout->addWidget(properties, 1, 2, 2, 1);
159  } else {
160  properties->setParent(m_propertyStackStack);
161  m_propertyStackStack->addWidget(properties);
162  }
163  layout->setColumnStretch(2, 0);
164 
165  PaneRec rec;
166  rec.pane = pane;
167  rec.propertyStack = properties;
168  rec.xButton = xButton;
169  rec.currentIndicator = currentIndicator;
170  rec.frame = frame;
171  rec.layout = layout;
172  rec.alignmentView = av;
173  m_panes.push_back(rec);
174 
175  frame->setLayout(layout);
176 
177  if (m_options & int(Option::NoUserResize)) {
178  m_autoResizeLayout->addWidget(frame);
179  frame->adjustSize();
180  } else {
181  m_splitter->addWidget(frame);
182  }
183 
184  connect(pane, SIGNAL(propertyContainerAdded(PropertyContainer *)),
185  this, SLOT(propertyContainerAdded(PropertyContainer *)));
186  connect(pane, SIGNAL(propertyContainerRemoved(PropertyContainer *)),
187  this, SLOT(propertyContainerRemoved(PropertyContainer *)));
188  connect(pane, SIGNAL(paneInteractedWith()),
189  this, SLOT(paneInteractedWith()));
190  connect(pane, SIGNAL(rightButtonMenuRequested(QPoint)),
191  this, SLOT(rightButtonMenuRequested(QPoint)));
192  connect(pane, SIGNAL(dropAccepted(QStringList)),
193  this, SLOT(paneDropAccepted(QStringList)));
194  connect(pane, SIGNAL(dropAccepted(QString)),
195  this, SLOT(paneDropAccepted(QString)));
196  connect(pane, SIGNAL(doubleClickSelectInvoked(sv_frame_t)),
197  this, SIGNAL(doubleClickSelectInvoked(sv_frame_t)));
198 
199  emit paneAdded(pane);
200  emit paneAdded();
201 
202  if (!m_currentPane) {
203  setCurrentPane(pane);
204  }
205 
208 
209  return pane;
210 }
211 
212 void
214 {
215  if (m_panes.empty()) return;
216  auto av = m_panes[0].alignmentView;
217  if (av) av->hide();
218  for (int i = 1; in_range_for(m_panes, i); ++i) {
219  av = m_panes[i].alignmentView;
220  if (!av) continue;
221  if (!(m_options & int(Option::ShowAlignmentViews))) {
222  av->hide();
223  } else {
224  av->setAboveView(m_panes[i-1].pane);
225  av->setBelowView(m_panes[i].pane);
226  av->setReferenceView(m_panes[0].pane);
227  av->show();
228  }
229  }
230 
231  adjustAlignmentViewHeights(size().height());
232 }
233 
234 void
236 {
237  for (int i = 0; in_range_for(m_panes, i); ++i) {
238  auto av = m_panes[i].alignmentView;
239  if (!av) continue;
240  av->setAboveView(nullptr);
241  av->setBelowView(nullptr);
242  av->setReferenceView(nullptr);
243  }
244 }
245 
246 void
247 PaneStack::resizeEvent(QResizeEvent *ev)
248 {
249  adjustAlignmentViewHeights(ev->size().height());
250 }
251 
252 void
254 {
255  if (!(m_options & int(Option::ShowAlignmentViews))) return;
256  if (!(m_options & int(Option::NoUserResize))) return;
257  if (!isVisible()) return;
258  if (m_panes.empty()) return;
259 
260  int heightPerPane = forMyHeight / int(m_panes.size());
261 
262  SVCERR << "heightPerPane = " << heightPerPane << " ("
263  << forMyHeight << "/" << m_panes.size() << ")" << endl;
264 
265  int roomForAlignmentView = heightPerPane / 4;
266  int min = ViewManager::scalePixelSize(6);
267  int max = ViewManager::scalePixelSize(25);
268  int alignmentHeight = roomForAlignmentView;
269  if (alignmentHeight < min) {
270  alignmentHeight = min;
271  }
272  if (alignmentHeight > max) {
273  alignmentHeight = max;
274  }
275 
276  SVCERR << "alignmentHeight = " << alignmentHeight << endl;
277 
278  for (int i = 0; in_range_for(m_panes, i); ++i) {
279  auto av = m_panes[i].alignmentView;
280  if (!av) continue;
281  av->setFixedHeight(alignmentHeight);
282  }
283 }
284 
285 void
287 {
288  for (std::vector<PaneRec>::iterator i = m_panes.begin();
289  i != m_panes.end(); ++i) {
290  i->propertyStack->setMinimumWidth(mw);
291  }
293 }
294 
295 void
297 {
298  if (m_options & int(Option::NoPropertyStacks)) {
299  SVCERR << "NOTE: PaneStack::setLayoutStyle called on PaneStack with NoPropertyStacks option set - this does nothing, its style is always equivalent to HiddenPropertyStacksLayout" << endl;
300  return;
301  }
302 
303  if (style == m_layoutStyle) return;
304  m_layoutStyle = style;
305 
306  std::vector<PaneRec>::iterator i;
307 
308  switch (style) {
309 
312 
313  for (i = m_panes.begin(); i != m_panes.end(); ++i) {
314  i->layout->removeWidget(i->propertyStack);
315  i->propertyStack->setParent(m_propertyStackStack);
316  m_propertyStackStack->addWidget(i->propertyStack);
317  }
318  m_propertyStackStack->setVisible(style != HiddenPropertyStacksLayout);
319  break;
320 
322 
323  for (i = m_panes.begin(); i != m_panes.end(); ++i) {
324  m_propertyStackStack->removeWidget(i->propertyStack);
325  i->propertyStack->setParent(i->frame);
326  i->layout->addWidget(i->propertyStack, 1, 2, 2, 1);
327  i->propertyStack->show();
328  }
329  m_propertyStackStack->hide();
330  break;
331  }
332 }
333 
334 Pane *
336 {
337  if (n < (int)m_panes.size()) {
338  return m_panes[n].pane;
339  } else {
340  return nullptr;
341  }
342 }
343 
344 int
346 {
347  for (int i = 0; i < getPaneCount(); ++i) {
348  if (pane == getPane(i)) {
349  return i;
350  }
351  }
352  return -1;
353 }
354 
355 Pane *
357 {
358  return m_hiddenPanes[n].pane;
359 }
360 
361 void
363 {
364 #ifdef DEBUG_PANE_STACK
365  SVCERR << "PaneStack::deletePane(" << pane << ")" << endl;
366 #endif
367 
368  std::vector<PaneRec>::iterator i;
369  bool found = false;
370 
371  QWidget *stack = nullptr;
372 
373  for (i = m_panes.begin(); i != m_panes.end(); ++i) {
374  if (i->pane == pane) {
375  stack = i->propertyStack;
376  m_panes.erase(i);
377  found = true;
378  break;
379  }
380  }
381 
382  if (!found) {
383 
384  for (i = m_hiddenPanes.begin(); i != m_hiddenPanes.end(); ++i) {
385  if (i->pane == pane) {
386  stack = i->propertyStack;
387  m_hiddenPanes.erase(i);
388  found = true;
389  break;
390  }
391  }
392 
393  if (!found) {
394  cerr << "WARNING: PaneStack::deletePane(" << pane << "): Pane not found in visible or hidden panes, not deleting" << endl;
395  return;
396  }
397  }
398 
399  emit paneAboutToBeDeleted(pane);
401 
402 #ifdef DEBUG_PANE_STACK
403  SVCERR << "PaneStack::deletePane: about to delete parent " << pane->parent() << " of pane " << pane << endl;
404 #endif
405 
406  // The property stack associated with the parent was initially
407  // created with the same parent as it, so it would be deleted when
408  // we delete the pane's parent in a moment -- but it may have been
409  // reparented depending on the layout. We'd better delete it
410  // separately first. (This fixes a crash on opening a new layer
411  // with a new unit type in it, when a long-defunct property box
412  // could be signalled from the unit database to tell it that a new
413  // unit had appeared.)
414  delete stack;
415 
416  delete pane->parent();
417 
418  if (m_currentPane == pane) {
419  if (m_panes.size() > 0) {
420  setCurrentPane(m_panes[0].pane);
421  } else {
422  setCurrentPane(nullptr);
423  }
424  }
425 
428 
429  emit paneDeleted();
430 }
431 
432 void
434 {
435 #ifdef DEBUG_PANE_STACK
436  SVCERR << "PaneStack::showOrHidePaneAccessories: count == " << getPaneCount() << endl;
437 #endif
438 
439  bool multi = (getPaneCount() > 1);
440  for (std::vector<PaneRec>::iterator i = m_panes.begin();
441  i != m_panes.end(); ++i) {
442  bool visible = (multi && !(m_options & int(Option::NoPaneAccessories)));
443  bool xvisible = visible;
444  if (i == m_panes.begin()) {
446  xvisible = false;
447  }
448  }
449  i->xButton->setVisible(xvisible);
450  i->currentIndicator->setVisible(visible);
451  }
452 }
453 
454 int
456 {
457  return int(m_panes.size());
458 }
459 
460 int
462 {
463  return int(m_hiddenPanes.size());
464 }
465 
466 void
468 {
469  std::vector<PaneRec>::iterator i = m_panes.begin();
470 
471  while (i != m_panes.end()) {
472  if (i->pane == pane) {
473 
474  m_hiddenPanes.push_back(*i);
475  m_panes.erase(i);
476 
477  QWidget *pw = dynamic_cast<QWidget *>(pane->parent());
478  if (pw) pw->hide();
479 
480  if (m_currentPane == pane) {
481  if (m_panes.size() > 0) {
482  setCurrentPane(m_panes[0].pane);
483  } else {
484  setCurrentPane(nullptr);
485  }
486  }
487 
489  emit paneHidden(pane);
490  emit paneHidden();
492  return;
493  }
494  ++i;
495  }
496 
497  SVCERR << "WARNING: PaneStack::hidePane(" << pane << "): Pane not found in visible panes" << endl;
498 }
499 
500 void
502 {
503  std::vector<PaneRec>::iterator i = m_hiddenPanes.begin();
504 
505  while (i != m_hiddenPanes.end()) {
506  if (i->pane == pane) {
507  m_panes.push_back(*i);
508  m_hiddenPanes.erase(i);
509  QWidget *pw = dynamic_cast<QWidget *>(pane->parent());
510  if (pw) pw->show();
511 
513 
516 
517  return;
518  }
519  ++i;
520  }
521 
522  SVCERR << "WARNING: PaneStack::showPane(" << pane << "): Pane not found in hidden panes" << endl;
523 }
524 
525 void
526 PaneStack::setCurrentPane(Pane *pane) // may be null
527 {
528  if (m_currentPane == pane) return;
529 
530  std::vector<PaneRec>::iterator i = m_panes.begin();
531 
532  // We used to do this by setting the foreground and background
533  // role, but it seems the background role is ignored and the
534  // background drawn transparent in Qt 4.1 -- I can't quite see why
535 
536  QPixmap selectedMap(1, 1);
537  selectedMap.fill(QApplication::palette().color(QPalette::Foreground));
538 
539  QPixmap unselectedMap(1, 1);
540  unselectedMap.fill(QApplication::palette().color(QPalette::Background));
541 
542  bool found = false;
543 
544  while (i != m_panes.end()) {
545  if (i->pane == pane) {
546  i->currentIndicator->setPixmap(selectedMap);
548  m_propertyStackStack->setCurrentWidget(i->propertyStack);
549  }
550  found = true;
551  } else {
552  i->currentIndicator->setPixmap(unselectedMap);
553  }
554  ++i;
555  }
556 
557  if (found || pane == nullptr) {
558  m_currentPane = pane;
560  } else {
561  SVCERR << "WARNING: PaneStack::setCurrentPane(" << pane << "): pane is not a visible pane in this stack" << endl;
562  }
563 }
564 
565 void
566 PaneStack::setCurrentLayer(Pane *pane, Layer *layer) // may be null
567 {
568  setCurrentPane(pane);
569 
570  if (m_currentPane) {
571 
572  std::vector<PaneRec>::iterator i = m_panes.begin();
573 
574  while (i != m_panes.end()) {
575 
576  if (i->pane == pane) {
577  PropertyStack *stack = dynamic_cast<PropertyStack *>
578  (i->propertyStack);
579  if (stack) {
580  if (stack->containsContainer(layer)) {
581  stack->setCurrentIndex(stack->getContainerIndex(layer));
582  emit currentLayerChanged(pane, layer);
583  } else {
584  stack->setCurrentIndex
585  (stack->getContainerIndex
586  (pane->getPropertyContainer(0)));
587  emit currentLayerChanged(pane, nullptr);
588  }
589  }
590  break;
591  }
592  ++i;
593  }
594  }
595 }
596 
597 Pane *
599 {
600  return m_currentPane;
601 }
602 
603 void
605 {
607 }
608 
609 void
611 {
613 }
614 
615 void
616 PaneStack::propertyContainerSelected(View *client, PropertyContainer *pc)
617 {
618  std::vector<PaneRec>::iterator i = m_panes.begin();
619 
620  while (i != m_panes.end()) {
621  PropertyStack *stack = dynamic_cast<PropertyStack *>(i->propertyStack);
622  if (stack &&
623  stack->getClient() == client &&
624  stack->containsContainer(pc)) {
625  setCurrentPane(i->pane);
626  break;
627  }
628  ++i;
629  }
630 
631  Layer *layer = dynamic_cast<Layer *>(pc);
632  if (layer) emit currentLayerChanged(m_currentPane, layer);
633  else emit currentLayerChanged(m_currentPane, nullptr);
634 }
635 
636 void
638  PropertyContainer *pc,
639  QPoint pos)
640 {
641  Pane *pane = dynamic_cast<Pane *>(client);
642  Layer *layer = dynamic_cast<Layer *>(pc);
643 
644  if (pane) {
645  if (layer) {
646  emit layerPropertiesRightButtonMenuRequested(pane, layer, pos);
647  } else {
649  }
650  }
651 }
652 
653 void
655 {
656  Pane *p = dynamic_cast<Pane *>(v);
657  if (p) setCurrentPane(p);
658 }
659 
660 void
662 {
663  Pane *pane = dynamic_cast<Pane *>(sender());
664  if (!pane) return;
665  setCurrentPane(pane);
666 }
667 
668 void
670 {
671  Pane *pane = dynamic_cast<Pane *>(sender());
672  if (!pane) return;
673  emit paneRightButtonMenuRequested(pane, position);
674 }
675 
676 void
678 {
679  int maxMinWidth = 0;
680 
681  if (m_propertyStackMinWidth > 0) maxMinWidth = m_propertyStackMinWidth;
682 
683  for (int i = 0; i < (int)m_panes.size(); ++i) {
684  if (!m_panes[i].propertyStack) continue;
685 #ifdef DEBUG_PANE_STACK
686  SVDEBUG << "PaneStack::sizePropertyStacks: " << i << ": min "
687  << m_panes[i].propertyStack->minimumSizeHint().width() << ", hint "
688  << m_panes[i].propertyStack->sizeHint().width() << ", current "
689  << m_panes[i].propertyStack->width() << endl;
690 #endif
691 
692  if (m_panes[i].propertyStack->sizeHint().width() > maxMinWidth) {
693  maxMinWidth = m_panes[i].propertyStack->sizeHint().width();
694  }
695  }
696 
697 #ifdef DEBUG_PANE_STACK
698  SVDEBUG << "PaneStack::sizePropertyStacks: max min width " << maxMinWidth << endl;
699 #endif
700 
701  int setWidth = maxMinWidth;
702 
703  m_propertyStackStack->setMaximumWidth(setWidth + 10);
704 
705  for (int i = 0; i < (int)m_panes.size(); ++i) {
706  if (!m_panes[i].propertyStack) continue;
707  m_panes[i].propertyStack->setMinimumWidth(setWidth);
708  }
709 
710  emit propertyStacksResized(setWidth);
711  emit propertyStacksResized();
712 }
713 
714 void
715 PaneStack::paneDropAccepted(QStringList uriList)
716 {
717  Pane *pane = dynamic_cast<Pane *>(sender());
718  emit dropAccepted(pane, uriList);
719 }
720 
721 void
723 {
724  Pane *pane = dynamic_cast<Pane *>(sender());
725  emit dropAccepted(pane, text);
726 }
727 
728 void
730 {
731  QObject *s = sender();
732  for (int i = 0; i < (int)m_panes.size(); ++i) {
733  if (m_panes[i].xButton == s) {
734  emit paneDeleteButtonClicked(m_panes[i].pane);
735  }
736  }
737 }
738 
739 void
741 {
742  QObject *s = sender();
743 
744  for (int i = 0; i < (int)m_panes.size(); ++i) {
745  if (m_panes[i].currentIndicator == s) {
746  setCurrentPane(m_panes[i].pane);
747  return;
748  }
749  }
750 }
751 
752 void
754 {
755  if (m_options & int(Option::NoUserResize)) {
756  return;
757  }
758 
759  QList<int> sizes = m_splitter->sizes();
760  if (sizes.empty()) return;
761 
762  int count = sizes.size();
763 
764  int fixed = 0, variable = 0, total = 0;
765  int varicount = 0;
766 
767  for (int i = 0; i < count; ++i) {
768  total += sizes[i];
769  }
770 
771  variable = total;
772 
773  for (int i = 0; i < count; ++i) {
774  int minh = m_panes[i].pane->minimumSize().height();
775  if (minh == m_panes[i].pane->maximumSize().height()) {
776  fixed += minh;
777  variable -= minh;
778  } else {
779  varicount++;
780  }
781  }
782 
783  if (total == 0) return;
784 
785  sizes.clear();
786 
787  int each = (varicount > 0 ? (variable / varicount) : 0);
788  int remaining = total;
789 
790  for (int i = 0; i < count; ++i) {
791  if (i == count - 1) {
792  sizes.push_back(remaining);
793  } else {
794  int minh = m_panes[i].pane->minimumSize().height();
795  if (minh == m_panes[i].pane->maximumSize().height()) {
796  sizes.push_back(minh);
797  remaining -= minh;
798  } else {
799  sizes.push_back(each);
800  remaining -= each;
801  }
802  }
803  }
804 
805 /*
806  cerr << "sizes: ";
807  for (int i = 0; i < sizes.size(); ++i) {
808  cerr << sizes[i] << " ";
809  }
810  cerr << endl;
811 */
812 
813  m_splitter->setSizes(sizes);
814 }
815 
Pane * getHiddenPane(int n)
Definition: PaneStack.cpp:356
Pane * getPane(int n)
Definition: PaneStack.cpp:335
LayoutStyle
Runtime-switchable layout style for property stacks.
Definition: PaneStack.h:79
PaneStack(QWidget *parent, ViewManager *viewManager, Options options=0)
Definition: PaneStack.cpp:41
Definition: Pane.h:35
virtual const PropertyContainer * getPropertyContainer(int i) const
Definition: View.cpp:183
The base class for visual representations of the data found in a Model.
Definition: Layer.h:54
void adjustAlignmentViewHeights(int forMyHeight)
Definition: PaneStack.cpp:253
void hidePane(Pane *pane)
Definition: PaneStack.cpp:467
void propertyStacksResized()
void doubleClickSelectInvoked(sv_frame_t frame)
int m_propertyStackMinWidth
Definition: PaneStack.h:155
void dropAccepted(Pane *pane, QStringList uriList)
AlignmentView * alignmentView
Definition: PaneStack.h:141
void paneHidden()
ViewManager * m_viewManager
Definition: PaneStack.h:154
static int scalePixelSize(int pixels)
Take a "design pixel" size and scale it for the actual display.
int getContainerIndex(PropertyContainer *container) const
void sizePanesEqually()
Definition: PaneStack.cpp:753
void paneDeleteButtonClicked()
Definition: PaneStack.cpp:729
void paneRightButtonMenuRequested(Pane *pane, QPoint position)
void layerPropertiesRightButtonMenuRequested(Pane *, Layer *, QPoint)
std::vector< PaneRec > m_panes
Definition: PaneStack.h:144
QLabel * currentIndicator
Definition: PaneStack.h:138
int getPaneCount() const
Definition: PaneStack.cpp:455
void paneAdded()
QPushButton * xButton
Definition: PaneStack.h:137
void paneAboutToBeDeleted(Pane *pane)
void rightButtonMenuRequested(QPoint)
Definition: PaneStack.cpp:669
void propertyContainerAdded(PropertyContainer *)
Definition: PaneStack.cpp:604
void resizeEvent(QResizeEvent *) override
Definition: PaneStack.cpp:247
virtual void setViewManager(ViewManager *m)
Definition: View.cpp:1002
QSplitter * m_splitter
Definition: PaneStack.h:148
LayoutStyle m_layoutStyle
Definition: PaneStack.h:166
bool containsContainer(PropertyContainer *container) const
void propertyContainerRemoved(PropertyContainer *)
Definition: PaneStack.cpp:610
Pane * addPane()
Definition: PaneStack.cpp:88
View * getClient()
Definition: PropertyStack.h:36
QWidget * propertyStack
Definition: PaneStack.h:136
int getPaneIndex(Pane *pane)
Definition: PaneStack.cpp:345
Pane * getCurrentPane()
Definition: PaneStack.cpp:598
void indicatorClicked()
Definition: PaneStack.cpp:740
QWidget * m_autoResizeStack
Definition: PaneStack.h:149
void relinkAlignmentViews()
Definition: PaneStack.cpp:213
void showOrHidePaneAccessories()
Definition: PaneStack.cpp:433
void propertyContainerContextMenuRequested(View *, PropertyContainer *, QPoint)
Definition: PaneStack.cpp:637
void propertyContainerSelected(View *client, PropertyContainer *)
Definition: PaneStack.cpp:616
void deletePane(Pane *pane)
Definition: PaneStack.cpp:362
QVBoxLayout * m_autoResizeLayout
Definition: PaneStack.h:150
void setLayoutStyle(LayoutStyle style)
Definition: PaneStack.cpp:296
int getHiddenPaneCount() const
Definition: PaneStack.cpp:461
void contextHelpChanged(const QString &)
void paneDeleted()
void panePropertiesRightButtonMenuRequested(Pane *, QPoint)
void setCurrentLayer(Pane *pane, Layer *layer)
Definition: PaneStack.cpp:566
int m_options
Definition: PaneStack.h:147
void setPropertyStackMinWidth(int mw)
Definition: PaneStack.cpp:286
void currentPaneChanged(Pane *pane)
QGridLayout * layout
Definition: PaneStack.h:140
QStackedWidget * m_propertyStackStack
Definition: PaneStack.h:152
View is the base class of widgets that display one or more overlaid views of data against a horizonta...
Definition: View.h:55
void unlinkAlignmentViews()
Definition: PaneStack.cpp:235
Pane * m_currentPane
Definition: PaneStack.h:131
void setCurrentPane(Pane *pane)
Definition: PaneStack.cpp:526
The ViewManager manages properties that may need to be synchronised between separate Views...
Definition: ViewManager.h:78
void showPane(Pane *pane)
Definition: PaneStack.cpp:501
void viewSelected(View *v)
Definition: PaneStack.cpp:654
void sizePropertyStacks()
Definition: PaneStack.cpp:677
void paneInteractedWith()
Definition: PaneStack.cpp:661
std::vector< PaneRec > m_hiddenPanes
Definition: PaneStack.h:145
void paneDropAccepted(QStringList)
Definition: PaneStack.cpp:715
void currentLayerChanged(Pane *pane, Layer *layer)