summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-06-04 22:09:21 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-06-04 22:42:02 (GMT)
commit7bca08eb2829982865f1649483f9aa01b3413b1c (patch)
tree630b333f0dd9b05478816eae27c6695b1a6bbe35 /Swift/QtUI/QtStatusWidget.cpp
parentb3208697addc0492f4ae1f76c75a8810c20e701a (diff)
downloadswift-7bca08eb2829982865f1649483f9aa01b3413b1c.zip
swift-7bca08eb2829982865f1649483f9aa01b3413b1c.tar.bz2
Starting towards tooltips for the colour-blind.
Putting status show names along with the text in tooltips. Covers the MeView and roster entries. Still ToDo: status setter Resolves: #429
Diffstat (limited to 'Swift/QtUI/QtStatusWidget.cpp')
-rw-r--r--Swift/QtUI/QtStatusWidget.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/Swift/QtUI/QtStatusWidget.cpp b/Swift/QtUI/QtStatusWidget.cpp
index 7d39531..d7c0e63 100644
--- a/Swift/QtUI/QtStatusWidget.cpp
+++ b/Swift/QtUI/QtStatusWidget.cpp
@@ -124,11 +124,15 @@ void QtStatusWidget::generateList() {
foreach (StatusShow::Type type, icons_.keys()) {
QListWidgetItem* item = new QListWidgetItem(text, menu_);
item->setIcon(icons_[type]);
+ item->setToolTip(P2QSTRING(StatusShow::typeToFriendlyName(type)) + ": " + item->text());
+ item->setStatusTip(item->toolTip());
item->setData(Qt::UserRole, QVariant(type));
}
foreach (StatusShow::Type type, icons_.keys()) {
QListWidgetItem* item = new QListWidgetItem(P2QSTRING(StatusShow::typeToFriendlyName(type)), menu_);
item->setIcon(icons_[type]);
+ item->setToolTip(item->text());
+ item->setStatusTip(item->toolTip());
item->setData(Qt::UserRole, QVariant(type));
}
}
@@ -207,6 +211,9 @@ void QtStatusWidget::handleItemClicked(QListWidgetItem* item) {
handleEditComplete();
}
+void QtStatusWidget::setNewToolTip() {
+ statusTextLabel_->setToolTip(P2QSTRING(StatusShow::typeToFriendlyName(selectedStatusType_)) + ": " + statusTextLabel_->text());
+}
void QtStatusWidget::setStatusText(const QString& text) {
statusText_ = text;
@@ -215,11 +222,13 @@ void QtStatusWidget::setStatusText(const QString& text) {
escapedText.replace("<","&lt;");
// statusTextLabel_->setText("<i>" + escapedText + "</i>");
statusTextLabel_->setText(escapedText);
+ setNewToolTip();
}
void QtStatusWidget::setStatusType(StatusShow::Type type) {
selectedStatusType_ = icons_.contains(type) ? type : StatusShow::Online;
statusIcon_->setPixmap(icons_[selectedStatusType_].pixmap(16, 16));
+ setNewToolTip();
}
}