From 1fb32756055f9d70bdf1c6031a18c9981f7cce68 Mon Sep 17 00:00:00 2001 From: Andreev Alexander Date: Mon, 5 Sep 2016 23:14:53 +0300 Subject: add display of color temperature and period in the tooltip status icon --- src/redshift-gtk/statusicon.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/redshift-gtk/statusicon.py') diff --git a/src/redshift-gtk/statusicon.py b/src/redshift-gtk/statusicon.py index 86897c4..9d9835d 100644 --- a/src/redshift-gtk/statusicon.py +++ b/src/redshift-gtk/statusicon.py @@ -474,15 +474,23 @@ class RedshiftStatusIcon(object): def change_temperature(self, temperature): '''Change interface to new temperature''' self.temperature_label.set_markup('{}: {}K'.format(_('Color temperature'), temperature)) + self.update_tooltip_text() def change_period(self, period): '''Change interface to new period''' self.period_label.set_markup('{}: {}'.format(_('Period'), period)) + self.update_tooltip_text() def change_location(self, location): '''Change interface to new location''' self.location_label.set_markup('{}: {}, {}'.format(_('Location'), *location)) + def update_tooltip_text(self): + '''Update text of tooltip status icon ''' + if not appindicator: + self.status_icon.set_tooltip_text('{}: {}K, {}: {}'.format( + _('Color temperature'), self._controller.temperature, + _('Period'), self._controller.period)) def autostart_cb(self, widget, data=None): '''Callback when a request to toggle autostart is made''' -- cgit v1.2.3-70-g09d2