NotificationAreaTooltip: Dont inherit from BaseTooltip

This commit is contained in:
Philipp Hörist 2017-12-23 21:08:00 +01:00
parent 9db9e69c35
commit 912192ed41
2 changed files with 6 additions and 6 deletions

View File

@ -104,8 +104,7 @@ class StatusIcon:
self.make_menu(event_button, event_time) self.make_menu(event_button, event_time)
def on_status_icon_query_tooltip(self, widget, x, y, keyboard_mode, tooltip): def on_status_icon_query_tooltip(self, widget, x, y, keyboard_mode, tooltip):
self.tooltip.populate() tooltip.set_custom(self.tooltip.get_tooltip())
tooltip.set_custom(self.tooltip.hbox)
return True return True
def hide_icon(self): def hide_icon(self):

View File

@ -263,13 +263,13 @@ class StatusTable:
self.table.attach(lock_image, 4, self.current_row, 1, 1) self.table.attach(lock_image, 4, self.current_row, 1, 1)
self.current_row += 1 self.current_row += 1
class NotificationAreaTooltip(BaseTooltip, StatusTable):
class NotificationAreaTooltip(StatusTable):
""" """
Tooltip that is shown in the notification area Tooltip that is shown in the notification area
""" """
def __init__(self): def __init__(self):
BaseTooltip.__init__(self)
StatusTable.__init__(self) StatusTable.__init__(self)
def fill_table_with_accounts(self, accounts): def fill_table_with_accounts(self, accounts):
@ -297,8 +297,7 @@ class NotificationAreaTooltip(BaseTooltip, StatusTable):
for line in acct['event_lines']: for line in acct['event_lines']:
self.add_text_row(' ' + line, 1) self.add_text_row(' ' + line, 1)
def populate(self, data=''): def get_tooltip(self):
self.create_window()
self.create_table() self.create_table()
accounts = helpers.get_notification_icon_tooltip_dict() accounts = helpers.get_notification_icon_tooltip_dict()
@ -308,6 +307,8 @@ class NotificationAreaTooltip(BaseTooltip, StatusTable):
self.hbox.add(self.table) self.hbox.add(self.table)
self.hbox.show_all() self.hbox.show_all()
return self.hbox
class GCTooltip(Gtk.Window): class GCTooltip(Gtk.Window):
# pylint: disable=E1101 # pylint: disable=E1101