diff view/ViewManager.cpp @ 373:0895517bb2d1 1.2-stable

* merge from trunk (1.2 ended up being tracked from trunk, but we may want this branch for fixes later)
author Chris Cannam
date Wed, 27 Feb 2008 10:32:45 +0000
parents e74b56f07c73
children
line wrap: on
line diff
--- a/view/ViewManager.cpp	Thu Nov 29 10:43:54 2007 +0000
+++ b/view/ViewManager.cpp	Wed Feb 27 10:32:45 2008 +0000
@@ -57,7 +57,7 @@
     settings.endGroup();
 
     if (getGlobalDarkBackground()) {
-
+/*
         std::cerr << "dark palette:" << std::endl;
         std::cerr << "window = " << QApplication::palette().color(QPalette::Window).name().toStdString() << std::endl;
         std::cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name().toStdString() << std::endl;
@@ -70,7 +70,7 @@
         std::cerr << "light = " << QApplication::palette().color(QPalette::Light).name().toStdString() << std::endl;
         std::cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name().toStdString() << std::endl;
         std::cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name().toStdString() << std::endl;
-
+*/
         m_lightPalette = QPalette(QColor("#000000"),  // WindowText
                                   QColor("#dddfe4"),  // Button
                                   QColor("#ffffff"),  // Light
@@ -83,6 +83,7 @@
                                   
 
     } else {
+/*
         std::cerr << "light palette:" << std::endl;
         std::cerr << "window = " << QApplication::palette().color(QPalette::Window).name().toStdString() << std::endl;
         std::cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name().toStdString() << std::endl;
@@ -95,7 +96,7 @@
         std::cerr << "light = " << QApplication::palette().color(QPalette::Light).name().toStdString() << std::endl;
         std::cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name().toStdString() << std::endl;
         std::cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name().toStdString() << std::endl;
-
+*/
         m_darkPalette = QPalette(QColor("#ffffff"),  // WindowText
                                  QColor("#3e3e3e"),  // Button
                                  QColor("#808080"),  // Light
@@ -274,18 +275,19 @@
     MultiSelection::SelectionList sl = getSelections();
     if (sl.empty()) return frame;
 
-    size_t selectionStartFrame = sl.begin()->getStartFrame();
-    if (frame < selectionStartFrame) {
-        frame = selectionStartFrame;
-        return frame;
+    for (MultiSelection::SelectionList::const_iterator i = sl.begin();
+         i != sl.end(); ++i) {
+
+        if (frame < i->getEndFrame()) {
+            if (frame < i->getStartFrame()) {
+                return i->getStartFrame();
+            } else {
+                return frame;
+            }
+        }
     }
 
-    MultiSelection::SelectionList::iterator i = sl.end();
-    --i;
-    size_t selectionEndFrame = i->getEndFrame();
-    if (frame > selectionEndFrame) frame = selectionEndFrame;
-
-    return frame;
+    return sl.begin()->getStartFrame();
 }
 
 void