(self)
Update the state of our close button
Update the state of our close button
Update the state of our close button
def update_button(self):
        """Update the state of our close button"""
        if not self.config['close_button_on_tab']:
            if self.button:
                self.button.remove(self.icon)
                self.remove(self.button)
                del(self.button)
                del(self.icon)
                self.button = None
                self.icon = None
            return

        if not self.button:
            self.button = Gtk.Button()
        if not self.icon:
            self.icon = Gio.ThemedIcon.new_with_default_fallbacks("window-close-symbolic")
            self.icon = Gtk.Image.new_from_gicon(self.icon, Gtk.IconSize.MENU)

        self.button.set_focus_on_click(False)
        self.button.set_relief(Gtk.ReliefStyle.NONE)
#        style = Gtk.RcStyle()  # FIXME FOR GTK3 how to do it there? actually do we really want to override the theme?
#        style.xthickness = 0
#        style.ythickness = 0
#        self.button.modify_style(style)
        self.button.add(self.icon)
        self.button.connect('clicked', self.on_close)
        self.button.set_name('terminator-tab-close-button')
        if hasattr(self.button, 'set_tooltip_text'):
            self.button.set_tooltip_text(_('Close Tab'))
        self.pack_start(self.button, False, False, 0)
        self.show_all()
def update_button ( self ) : if not self . config [ 'close_button_on_tab' ] : if self . button : self . button . remove ( self . icon ) self . remove ( self . button ) del ( self . button ) del ( self . icon ) self . button = None self . icon = None return if not self . button : self . button = Gtk . Button ( ) if not self . icon : self . icon = Gio . ThemedIcon . new_with_default_fallbacks ( "window-close-symbolic" ) self . icon = Gtk . Image . new_from_gicon ( self . icon , Gtk . IconSize . MENU ) self . button . set_focus_on_click ( False ) self . button . set_relief ( Gtk . ReliefStyle . NONE ) #        style = Gtk.RcStyle()  # FIXME FOR GTK3 how to do it there? actually do we really want to override the theme? #        style.xthickness = 0 #        style.ythickness = 0 #        self.button.modify_style(style) self . button . add ( self . icon ) self . button . connect ( 'clicked' , self . on_close ) self . button . set_name ( 'terminator-tab-close-button' ) if hasattr ( self . button , 'set_tooltip_text' ) : self . button . set_tooltip_text ( _ ( 'Close Tab' ) ) self . pack_start ( self . button , False , False , 0 ) self . show_all ( )