Mercurial > hg > svgui
comparison 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 |
comparison
equal
deleted
inserted
replaced
337:813170c57b13 | 373:0895517bb2d1 |
---|---|
55 m_zoomWheelsEnabled = | 55 m_zoomWheelsEnabled = |
56 settings.value("zoom-wheels-enabled", m_zoomWheelsEnabled).toBool(); | 56 settings.value("zoom-wheels-enabled", m_zoomWheelsEnabled).toBool(); |
57 settings.endGroup(); | 57 settings.endGroup(); |
58 | 58 |
59 if (getGlobalDarkBackground()) { | 59 if (getGlobalDarkBackground()) { |
60 | 60 /* |
61 std::cerr << "dark palette:" << std::endl; | 61 std::cerr << "dark palette:" << std::endl; |
62 std::cerr << "window = " << QApplication::palette().color(QPalette::Window).name().toStdString() << std::endl; | 62 std::cerr << "window = " << QApplication::palette().color(QPalette::Window).name().toStdString() << std::endl; |
63 std::cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name().toStdString() << std::endl; | 63 std::cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name().toStdString() << std::endl; |
64 std::cerr << "base = " << QApplication::palette().color(QPalette::Base).name().toStdString() << std::endl; | 64 std::cerr << "base = " << QApplication::palette().color(QPalette::Base).name().toStdString() << std::endl; |
65 std::cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name().toStdString() << std::endl; | 65 std::cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name().toStdString() << std::endl; |
68 std::cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name().toStdString() << std::endl; | 68 std::cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name().toStdString() << std::endl; |
69 std::cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name().toStdString() << std::endl; | 69 std::cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name().toStdString() << std::endl; |
70 std::cerr << "light = " << QApplication::palette().color(QPalette::Light).name().toStdString() << std::endl; | 70 std::cerr << "light = " << QApplication::palette().color(QPalette::Light).name().toStdString() << std::endl; |
71 std::cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name().toStdString() << std::endl; | 71 std::cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name().toStdString() << std::endl; |
72 std::cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name().toStdString() << std::endl; | 72 std::cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name().toStdString() << std::endl; |
73 | 73 */ |
74 m_lightPalette = QPalette(QColor("#000000"), // WindowText | 74 m_lightPalette = QPalette(QColor("#000000"), // WindowText |
75 QColor("#dddfe4"), // Button | 75 QColor("#dddfe4"), // Button |
76 QColor("#ffffff"), // Light | 76 QColor("#ffffff"), // Light |
77 QColor("#555555"), // Dark | 77 QColor("#555555"), // Dark |
78 QColor("#c7c7c7"), // Mid | 78 QColor("#c7c7c7"), // Mid |
81 QColor("#ffffff"), // Base | 81 QColor("#ffffff"), // Base |
82 QColor("#efefef")); // Window | 82 QColor("#efefef")); // Window |
83 | 83 |
84 | 84 |
85 } else { | 85 } else { |
86 /* | |
86 std::cerr << "light palette:" << std::endl; | 87 std::cerr << "light palette:" << std::endl; |
87 std::cerr << "window = " << QApplication::palette().color(QPalette::Window).name().toStdString() << std::endl; | 88 std::cerr << "window = " << QApplication::palette().color(QPalette::Window).name().toStdString() << std::endl; |
88 std::cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name().toStdString() << std::endl; | 89 std::cerr << "windowtext = " << QApplication::palette().color(QPalette::WindowText).name().toStdString() << std::endl; |
89 std::cerr << "base = " << QApplication::palette().color(QPalette::Base).name().toStdString() << std::endl; | 90 std::cerr << "base = " << QApplication::palette().color(QPalette::Base).name().toStdString() << std::endl; |
90 std::cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name().toStdString() << std::endl; | 91 std::cerr << "alternatebase = " << QApplication::palette().color(QPalette::AlternateBase).name().toStdString() << std::endl; |
93 std::cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name().toStdString() << std::endl; | 94 std::cerr << "buttontext = " << QApplication::palette().color(QPalette::ButtonText).name().toStdString() << std::endl; |
94 std::cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name().toStdString() << std::endl; | 95 std::cerr << "brighttext = " << QApplication::palette().color(QPalette::BrightText).name().toStdString() << std::endl; |
95 std::cerr << "light = " << QApplication::palette().color(QPalette::Light).name().toStdString() << std::endl; | 96 std::cerr << "light = " << QApplication::palette().color(QPalette::Light).name().toStdString() << std::endl; |
96 std::cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name().toStdString() << std::endl; | 97 std::cerr << "dark = " << QApplication::palette().color(QPalette::Dark).name().toStdString() << std::endl; |
97 std::cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name().toStdString() << std::endl; | 98 std::cerr << "mid = " << QApplication::palette().color(QPalette::Mid).name().toStdString() << std::endl; |
98 | 99 */ |
99 m_darkPalette = QPalette(QColor("#ffffff"), // WindowText | 100 m_darkPalette = QPalette(QColor("#ffffff"), // WindowText |
100 QColor("#3e3e3e"), // Button | 101 QColor("#3e3e3e"), // Button |
101 QColor("#808080"), // Light | 102 QColor("#808080"), // Light |
102 QColor("#1e1e1e"), // Dark | 103 QColor("#1e1e1e"), // Dark |
103 QColor("#404040"), // Mid | 104 QColor("#404040"), // Mid |
272 ViewManager::constrainFrameToSelection(size_t frame) const | 273 ViewManager::constrainFrameToSelection(size_t frame) const |
273 { | 274 { |
274 MultiSelection::SelectionList sl = getSelections(); | 275 MultiSelection::SelectionList sl = getSelections(); |
275 if (sl.empty()) return frame; | 276 if (sl.empty()) return frame; |
276 | 277 |
277 size_t selectionStartFrame = sl.begin()->getStartFrame(); | 278 for (MultiSelection::SelectionList::const_iterator i = sl.begin(); |
278 if (frame < selectionStartFrame) { | 279 i != sl.end(); ++i) { |
279 frame = selectionStartFrame; | 280 |
280 return frame; | 281 if (frame < i->getEndFrame()) { |
281 } | 282 if (frame < i->getStartFrame()) { |
282 | 283 return i->getStartFrame(); |
283 MultiSelection::SelectionList::iterator i = sl.end(); | 284 } else { |
284 --i; | 285 return frame; |
285 size_t selectionEndFrame = i->getEndFrame(); | 286 } |
286 if (frame > selectionEndFrame) frame = selectionEndFrame; | 287 } |
287 | 288 } |
288 return frame; | 289 |
290 return sl.begin()->getStartFrame(); | |
289 } | 291 } |
290 | 292 |
291 void | 293 void |
292 ViewManager::signalSelectionChange() | 294 ViewManager::signalSelectionChange() |
293 { | 295 { |