Skip to content

Commit

Permalink
Review height and colors of Events
Browse files Browse the repository at this point in the history
Ref #267
  • Loading branch information
algorys committed Mar 8, 2018
1 parent fa0d262 commit 26cb1a0
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 67 deletions.
19 changes: 3 additions & 16 deletions alignak_app/qobjects/events/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@

import time

from PyQt5.QtCore import QTimer, QSize
from PyQt5.QtGui import QColor, QIcon
from PyQt5.QtWidgets import QListWidgetItem

from alignak_app.utils.config import settings
from PyQt5.Qt import QTimer, QColor, QListWidgetItem


class EventItem(QListWidgetItem):
Expand Down Expand Up @@ -71,17 +67,8 @@ def initialize(self, event_type, msg, timer=False, spied_on=False, host=None):
send_at = time.strftime("%a, %d %b %Y %H:%M:%S")
msg_to_send = '%s. (Send at %s)' % (msg, send_at)
self.setToolTip(msg_to_send)
self.setBackground(QColor(self.get_color_event(event_type)))
self.setForeground(QColor("#000"))

self.setSizeHint(QSize(self.sizeHint().width(), 50))

if 'TODO' in event_type:
self.setIcon(QIcon(settings.get_image('todo')))
elif self.host:
self.setIcon(QIcon(settings.get_image('event')))
else:
pass
self.setForeground(QColor(self.get_foreground_color(event_type)))

def close_item(self):
"""
Expand All @@ -92,7 +79,7 @@ def close_item(self):
self.setHidden(True)

@staticmethod
def get_color_event(event_type):
def get_foreground_color(event_type):
"""
Return corresponding color of event type
Expand Down
17 changes: 13 additions & 4 deletions etc/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -374,14 +374,23 @@ QFrame#vseparator {
/****** QListWidget ******/
QListWidget {
border: none;
background-color: transparent;
background-color: white;
}

QListWidget::item:selected {
color: black;
QListWidget::item {
height: 34px;
}

QListWidget::item:hover {
background-color: white;
border: 1px solid #1fb4e4;
border-radius: 3px;
color: #3884c3;
}

QListWidget::item:selected {
background-color: white;
color: #3884c3;
border: 1px solid #3884c3;
}

/****** QTableWidget ******/
Expand Down
2 changes: 0 additions & 2 deletions etc/images.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ connected = connected.svg
disconnected = disconnected.svg
edit = edit.svg
error = error.svg
event = event.svg
exit = exit.svg
flapping = flapping.svg
minimize = minimize.svg
Expand All @@ -67,6 +66,5 @@ spy_ok = spy_ok.svg
tree = tree.svg
time = time.svg
token = token.svg
todo = todo.svg
user = user.svg
web = web.svg
12 changes: 0 additions & 12 deletions etc/images/event.svg

This file was deleted.

31 changes: 0 additions & 31 deletions etc/images/todo.svg

This file was deleted.

2 changes: 0 additions & 2 deletions test/etc/images.ini
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ connected = connected.svg
disconnected = disconnected.svg
edit = edit.svg
error = error.svg
event = event.svg
exit = exit.svg
flapping = flapping.svg
minimize = minimize.svg
Expand All @@ -67,6 +66,5 @@ spy_ok = spy_ok.svg
tree = tree.svg
time = time.svg
token = token.svg
todo = todo.svg
user = user.svg
web = web.svg

0 comments on commit 26cb1a0

Please sign in to comment.