message: Show error message in tooltip.
diff: @@ -72,6 +72,17 @@ const char *kRepoCategoryBackgroundColor = "white";
  const int kRepoCategoryCountMarginRight = 10;
  const char *kRepoCategoryCountColor = "#BBB";
  +static void showTooltip(const QString &text,
  + QWidget *viewport,
  + const QRect &rect,
  + const QRect &small_rect)
  +{
  + QPoint tool_tip_pos =
  + viewport->mapToGlobal(small_rect.center() + rect.topLeft());
  + QToolTip::showText(
  + tool_tip_pos, text, viewport, small_rect.translated(rect.topLeft()));
  +}
  +
  } // namespace
  RepoItemDelegate::RepoItemDelegate(QObject *parent)
  @@ -465,14 +476,12 @@ void RepoItemDelegate::showRepoItemToolTip(const RepoItem *item,
  const RepoItem::Metrics& metrics = item->metrics();
  const QRect& status_icon_rect = metrics.status_icon_rect;
  + const QRect& subtitle_rect = metrics.subtitle_rect;
  QPoint viewpos = viewport->mapFromGlobal(global_pos);
  viewpos -= rect.topLeft();
  - if (!status_icon_rect.contains(viewpos)) {
  - return;
  - }
  -
  + if (status_icon_rect.contains(viewpos)) {
  QString text = "<p style='white-space:pre'>";
  const LocalRepo& local_repo = item->localRepo();
  if (!local_repo.isValid()) {
  @@ -486,9 +495,15 @@ void RepoItemDelegate::showRepoItemToolTip(const RepoItem *item,
  }
  text += "</p>";
  - QPoint tool_tip_pos = viewport->mapToGlobal(status_icon_rect.center()
  - + rect.topLeft());
  - QToolTip::showText(tool_tip_pos, text,
  - viewport,
  - status_icon_rect.translated(rect.topLeft()));
  + showTooltip(text, viewport, rect, status_icon_rect);
  +
  + } else if (subtitle_rect.contains(viewpos)) {
  + QString text = "<p style='white-space:pre'>";
  + const LocalRepo& local_repo = item->localRepo();
  + if (local_repo.isValid() && local_repo.sync_state == LocalRepo::SYNC_STATE_ERROR) {
  + text += local_repo.getErrorString();
  + text += "</p>";
  + showTooltip(text, viewport, rect, subtitle_rect);
  + }
  + }
  }
  