From c57a10113d7abc28a8e05d2cbf9ea9956bb5b58b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 13 Jun 2012 21:56:45 -0500 Subject: Make tray icon easier to see and understand --- src/cr22-action-kerberos_ticketexpiring.png | Bin 1398 -> 0 bytes src/cr22-action-kerberos_timeroverlay.png | Bin 0 -> 428 bytes src/cr22-action-kerberos_warningoverlay.png | Bin 0 -> 436 bytes src/toplevel.cpp | 31 ++++++++++++++-------------- src/toplevel.h | 3 ++- 5 files changed, 18 insertions(+), 16 deletions(-) delete mode 100644 src/cr22-action-kerberos_ticketexpiring.png create mode 100644 src/cr22-action-kerberos_timeroverlay.png create mode 100644 src/cr22-action-kerberos_warningoverlay.png diff --git a/src/cr22-action-kerberos_ticketexpiring.png b/src/cr22-action-kerberos_ticketexpiring.png deleted file mode 100644 index 2354930..0000000 Binary files a/src/cr22-action-kerberos_ticketexpiring.png and /dev/null differ diff --git a/src/cr22-action-kerberos_timeroverlay.png b/src/cr22-action-kerberos_timeroverlay.png new file mode 100644 index 0000000..7b94cee Binary files /dev/null and b/src/cr22-action-kerberos_timeroverlay.png differ diff --git a/src/cr22-action-kerberos_warningoverlay.png b/src/cr22-action-kerberos_warningoverlay.png new file mode 100644 index 0000000..38d2380 Binary files /dev/null and b/src/cr22-action-kerberos_warningoverlay.png differ diff --git a/src/toplevel.cpp b/src/toplevel.cpp index 3b80d2d..d998691 100644 --- a/src/toplevel.cpp +++ b/src/toplevel.cpp @@ -271,7 +271,8 @@ void TopLevel::resizeEvent (TQResizeEvent *) noTicketsPixmap = loadSizedIcon("kerberos_notickets", width()); expiredTicketsPixmap = loadSizedIcon("kerberos_expiredtickets", width()); partiallyExpiredTicketsPixmap = loadSizedIcon("kerberos_someexpiredtickets", width()); - expiringTicketsPixmap = loadSizedIcon("kerberos_ticketexpiring", width()); + timerOverlayPixmap = loadSizedIcon("kerberos_timeroverlay", width()); + warningOverlayPixmap = loadSizedIcon("kerberos_warningoverlay", width()); repaint(); } @@ -293,8 +294,6 @@ void TopLevel::mousePressEvent(TQMouseEvent *event) { void TopLevel::paintEvent(TQPaintEvent *) { TQString baseToolTip = i18n("%1 Kerberos ticket(s) listed for principal %2").arg(m_ticketList.count()).arg(m_ticketList[0].cachePrincipal); - TQPixmap *pm = &noTicketsPixmap; - bool has_tickets = false; bool tickets_expiring_soon = false; bool some_tickets_expired = false; @@ -318,31 +317,33 @@ void TopLevel::paintEvent(TQPaintEvent *) { if (!notifyExpiry) tickets_expiring_soon = false; + TQPainter p(this); if (has_tickets) { if (all_tickets_expired) { - pm = &expiredTicketsPixmap; + p.drawPixmap(0, 0, expiredTicketsPixmap); + p.drawPixmap(0, 0, warningOverlayPixmap); baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) have expired"); } - else if (tickets_expiring_soon) { - pm = &expiringTicketsPixmap; - baseToolTip = baseToolTip + "\n" + i18n("Ticket(s) will expire soon"); - } else if (some_tickets_expired) { - pm = &partiallyExpiredTicketsPixmap; + p.drawPixmap(0, 0, partiallyExpiredTicketsPixmap); + p.drawPixmap(0, 0, warningOverlayPixmap); baseToolTip = baseToolTip + "\n" + i18n("Some ticket(s) have expired"); } else { - pm = &activeTicketsPixmap; - baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) are active"); + p.drawPixmap(0, 0, activeTicketsPixmap); + if (tickets_expiring_soon) { + p.drawPixmap(0, 0, timerOverlayPixmap); + baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) are active\nSome ticket(s) will expire shortly"); + } + else { + baseToolTip = baseToolTip + "\n" + i18n("All ticket(s) are active"); + } } } else { + p.drawPixmap(0, 0, noTicketsPixmap); baseToolTip = i18n("No Kerberos tickets are available"); } - - TQPixmap base(*pm); // make copy of base pixmap - TQPainter p(this); - p.drawPixmap(0, 0, base); p.end(); setToolTip(baseToolTip); diff --git a/src/toplevel.h b/src/toplevel.h index 4082eef..41ed816 100644 --- a/src/toplevel.h +++ b/src/toplevel.h @@ -79,7 +79,8 @@ private: TQPixmap noTicketsPixmap; TQPixmap expiredTicketsPixmap; TQPixmap partiallyExpiredTicketsPixmap; - TQPixmap expiringTicketsPixmap; + TQPixmap timerOverlayPixmap; + TQPixmap warningOverlayPixmap; KAction *confAct; KAction *getNewTGTAct; KAction *getNewSTAct; -- cgit v1.2.1