summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2010-11-12 21:51:43 +0000
committerTim E. Real <termtech@rogers.com>2010-11-12 21:51:43 +0000
commit2bca4ba1f52d73c11abec9c6b3b2e0af21594cf0 (patch)
tree137e8bf1e6fd16b773c93d710b0c5f979b66fba5 /muse2
parent6849e1bf12829d469687bcb5dcba7e6098ad056b (diff)
Just a failed attempt at setting mixer min/max size. This could be tough...
Diffstat (limited to 'muse2')
-rw-r--r--muse2/muse/mixer/amixer.cpp57
-rw-r--r--muse2/muse/mixer/amixer.h3
2 files changed, 49 insertions, 11 deletions
diff --git a/muse2/muse/mixer/amixer.cpp b/muse2/muse/mixer/amixer.cpp
index 140dca3b..ca805f35 100644
--- a/muse2/muse/mixer/amixer.cpp
+++ b/muse2/muse/mixer/amixer.cpp
@@ -166,6 +166,23 @@ void AudioMixerApp::clear()
}
//---------------------------------------------------------
+// computeWidth
+//---------------------------------------------------------
+int AudioMixerApp::computeWidth()
+{
+ int w = 0;
+ StripList::iterator si = stripList.begin();
+ for (; si != stripList.end(); ++si) {
+ //w += (*si)->width();
+ //w += (*si)->frameGeometry().width();
+ Strip* s = *si;
+ //w += s->width() + 2 * (s->frameWidth() + s->lineWidth() + s->midLineWidth());
+ w += s->width() + 2 * s->frameWidth();
+ }
+ return w;
+}
+
+//---------------------------------------------------------
// updateMixer
//---------------------------------------------------------
@@ -210,10 +227,24 @@ void AudioMixerApp::updateMixer(UpdateAction action)
delete *ssi;
stripList.erase(ssi);
}
- ///setMaximumWidth((STRIP_WIDTH + 10) * stripList.size() + __WIDTH_COMPENSATION); // 10 REMOVE Tim
- // Added by Tim. p3.3.7
- ///if (stripList.size() < 8)
- /// view->setMinimumWidth(stripList.size() * (STRIP_WIDTH + 10) + __WIDTH_COMPENSATION); // 10 REMOVE Tim
+
+ // TODO: See help Qt4 "Window Geometry"
+ // "On X11, a window does not have a frame until the window manager decorates it.
+ // This happens asynchronously at some point in time after calling QWidget::show()
+ // and the first paint event the window receives, or it does not happen at all.
+ // " ...you cannot make any safe assumption about the decoration frame your window will get."
+ // "X11 provides no standard or easy way to get the frame geometry once the window is decorated.
+ // Qt solves this problem with nifty heuristics and clever code that works on a wide range of
+ // window managers that exist today..."
+ //
+ // I think I may be seeing these issues here...
+ //
+ //setMaximumWidth(STRIP_WIDTH * stripList.size() + __WIDTH_COMPENSATION);
+/// int w = computeWidth();
+/// setMaximumWidth(w);
+/// if (stripList.size() < 8)
+ // view->setMinimumWidth(stripList.size() * STRIP_WIDTH + __WIDTH_COMPENSATION);
+/// view->setMinimumWidth(w);
return;
}
@@ -257,9 +288,12 @@ void AudioMixerApp::updateMixer(UpdateAction action)
addStrip(*i, idx++);
}
- ///setMaximumWidth((STRIP_WIDTH + 10) * stripList.size() + __WIDTH_COMPENSATION); // 10 REMOVE Tim
- ///if (stripList.size() < 8)
- /// view->setMinimumWidth(stripList.size() * (STRIP_WIDTH + 10) + __WIDTH_COMPENSATION); // 10 REMOVE Tim
+ //setMaximumWidth(STRIP_WIDTH * stripList.size() + __WIDTH_COMPENSATION);
+/// int w = computeWidth();
+/// setMaximumWidth(w);
+/// if (stripList.size() < 8)
+ // view->setMinimumWidth(stripList.size() * STRIP_WIDTH + __WIDTH_COMPENSATION);
+/// view->setMinimumWidth(w);
return;
}
@@ -342,9 +376,12 @@ void AudioMixerApp::updateMixer(UpdateAction action)
addStrip(*i, idx++);
}
- ///setMaximumWidth((STRIP_WIDTH + 10) * idx + __WIDTH_COMPENSATION); // 10 REMOVE Tim
- ///if (idx < 8)
- /// view->setMinimumWidth(idx * (STRIP_WIDTH + 10) + __WIDTH_COMPENSATION); // 10 REMOVE Tim
+ //setMaximumWidth(STRIP_WIDTH * idx + __WIDTH_COMPENSATION);
+/// int w = computeWidth();
+/// setMaximumWidth(w);
+/// if (idx < 8)
+ // view->setMinimumWidth(idx * STRIP_WIDTH + __WIDTH_COMPENSATION);
+/// view->setMinimumWidth(w);
}
//---------------------------------------------------------
diff --git a/muse2/muse/mixer/amixer.h b/muse2/muse/mixer/amixer.h
index 334b7d93..abe38626 100644
--- a/muse2/muse/mixer/amixer.h
+++ b/muse2/muse/mixer/amixer.h
@@ -86,7 +86,8 @@ class AudioMixerApp : public QMainWindow {
NO_UPDATE, UPDATE_ALL, UPDATE_MIDI, STRIP_INSERTED, STRIP_REMOVED
};
void updateMixer(UpdateAction);
-
+ int computeWidth();
+
signals:
void closed();