Mercurial > hg > svgui
comparison widgets/SelectableLabel.cpp @ 425:4a5fe5471282
* More transform finder stuff
author | Chris Cannam |
---|---|
date | Mon, 29 Sep 2008 16:31:49 +0000 |
parents | 374b72f5b4bb |
children | f8fcfbe13c8f |
comparison
equal
deleted
inserted
replaced
424:374b72f5b4bb | 425:4a5fe5471282 |
---|---|
33 } | 33 } |
34 | 34 |
35 void | 35 void |
36 SelectableLabel::setUnselectedText(QString text) | 36 SelectableLabel::setUnselectedText(QString text) |
37 { | 37 { |
38 if (m_unselectedText == text) return; | |
38 m_unselectedText = text; | 39 m_unselectedText = text; |
39 if (!m_selected) { | 40 if (!m_selected) { |
40 setText(m_unselectedText); | 41 setText(m_unselectedText); |
41 resize(sizeHint()); | 42 resize(sizeHint()); |
42 } | 43 } |
43 } | 44 } |
44 | 45 |
45 void | 46 void |
46 SelectableLabel::setSelectedText(QString text) | 47 SelectableLabel::setSelectedText(QString text) |
47 { | 48 { |
49 if (m_selectedText == text) return; | |
48 m_selectedText = text; | 50 m_selectedText = text; |
49 if (m_selected) { | 51 if (m_selected) { |
50 setText(m_selectedText); | 52 setText(m_selectedText); |
51 resize(sizeHint()); | 53 resize(sizeHint()); |
52 } | 54 } |
61 setWordWrap(true); | 63 setWordWrap(true); |
62 setStyleSheet | 64 setStyleSheet |
63 (QString("QLabel:hover { background: %1; color: %3; } " | 65 (QString("QLabel:hover { background: %1; color: %3; } " |
64 "QLabel:!hover { background: %2; color: %3 } " | 66 "QLabel:!hover { background: %2; color: %3 } " |
65 "QLabel { padding: 7px }") | 67 "QLabel { padding: 7px }") |
66 .arg(palette.button().color().name()) | 68 .arg(palette.mid().color().lighter(120).name()) |
67 .arg(palette.mid().color().light().name()) | 69 .arg(palette.mid().color().lighter(140).name()) |
68 .arg(palette.text().color().name())); | 70 .arg(palette.text().color().name())); |
69 } else { | 71 } else { |
70 setWordWrap(false); | 72 setWordWrap(false); |
71 setStyleSheet | 73 setStyleSheet |
72 (QString("QLabel:hover { background: %1; color: %3; } " | 74 (QString("QLabel:hover { background: %1; color: %3; } " |