Make tray icon easier to see and understand

pull/1/head
Timothy Pearson 13 years ago
parent 02d6ef6446
commit c57a10113d

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 428 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 B

@ -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;
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);

@ -79,7 +79,8 @@ private:
TQPixmap noTicketsPixmap;
TQPixmap expiredTicketsPixmap;
TQPixmap partiallyExpiredTicketsPixmap;
TQPixmap expiringTicketsPixmap;
TQPixmap timerOverlayPixmap;
TQPixmap warningOverlayPixmap;
KAction *confAct;
KAction *getNewTGTAct;
KAction *getNewSTAct;

Loading…
Cancel
Save