Mercurial > hg > svgui
comparison widgets/KeyReference.cpp @ 291:3801289761a1
* dark background if necessary in key/mouse reference
author | Chris Cannam |
---|---|
date | Mon, 16 Jul 2007 14:06:03 +0000 |
parents | 4edaff85875d |
children | 5f3f5c1e23e8 |
comparison
equal
deleted
inserted
replaced
290:3101c68a00c1 | 291:3801289761a1 |
---|---|
109 m_dialog->raise(); | 109 m_dialog->raise(); |
110 return; | 110 return; |
111 } | 111 } |
112 | 112 |
113 QString text; | 113 QString text; |
114 | |
115 QColor bgcolor = QApplication::palette().window().color(); | |
116 bool darkbg = (bgcolor.red() + bgcolor.green() + bgcolor.blue() < 384); | |
114 | 117 |
115 text += "<center><table bgcolor=\"#e8e8e8\">"; | 118 text += QString("<center><table bgcolor=\"%1\">") |
119 .arg(darkbg ? "#121212" : "#e8e8e8"); | |
116 | 120 |
117 for (CategoryList::iterator i = m_categoryOrder.begin(); | 121 for (CategoryList::iterator i = m_categoryOrder.begin(); |
118 i != m_categoryOrder.end(); ++i) { | 122 i != m_categoryOrder.end(); ++i) { |
119 | 123 |
120 QString category = *i; | 124 QString category = *i; |
121 KeyList &list = m_map[category]; | 125 KeyList &list = m_map[category]; |
122 | 126 |
123 text += QString("<tr><td bgcolor=\"#d0d0d0\" colspan=3 align=\"center\"><br><b>%1</b><br></td></tr>\n").arg(category); | 127 text += QString("<tr><td bgcolor=\"%1\" colspan=3 align=\"center\"><br><b>%2</b><br></td></tr>\n").arg(darkbg ? "#303030" : "#d0d0d0").arg(category); |
124 | 128 |
125 for (KeyList::iterator j = list.begin(); j != list.end(); ++j) { | 129 for (KeyList::iterator j = list.begin(); j != list.end(); ++j) { |
126 | 130 |
127 QString actionName = j->actionName; | 131 QString actionName = j->actionName; |
128 | 132 |