Set css name for widgets
In Gtk+ 3.20, you need to use the css name to select elements, rather than the gtype name. Therefore, these must be added. The css name must be set before the class instances are created, as it effects the class rather than the instance. This is why it must be places after the class definition.
This commit is contained in:
@@ -209,6 +209,8 @@ class Alert(Gtk.EventBox):
|
||||
|
||||
def __button_clicked_cb(self, button, response_id):
|
||||
self._response(response_id)
|
||||
if hasattr(Alert, 'set_css_name'):
|
||||
Alert.set_css_name('alert')
|
||||
|
||||
|
||||
class ConfirmationAlert(Alert):
|
||||
@@ -344,6 +346,8 @@ class _TimeoutIcon(Gtk.Alignment):
|
||||
|
||||
def set_text(self, text):
|
||||
self._text.set_markup('<b>%s</b>' % GLib.markup_escape_text(str(text)))
|
||||
if hasattr(_TimeoutIcon, 'set_css_name'):
|
||||
_TimeoutIcon.set_css_name('timeouticon')
|
||||
|
||||
|
||||
class _TimeoutAlert(Alert):
|
||||
|
||||
Reference in New Issue
Block a user