0

How can I change the background color of the default tab on kivy? I'm able to change the background of the content and other tabs, but the default tab remains unchanged, this is my code:

class DAP(App):

    title = u'Aplicativo do DAP'
    # Funções para evitar que o aplicativo desligue ao mudar o foco da tela no celular
    def on_pause(self):  return True
    def on_resume(self): pass



    def build(self):

        self.cor_fonte = (0, 0, 1, 1)
        self.cor_fundo = (1, 1, 1, 0)

         #Abas
        self.painel                  = TabbedPanel(background_color = self.cor_fundo, default_tab_text=u'Principal')
        self.aba_resumo              = TabbedPanelHeader(text=u'Resumo PC',    background_color = self.cor_fundo, color = self.cor_fonte)
        self.aba_registros           = TabbedPanelHeader(text=u'Registros PC', background_color = self.cor_fundo, color = self.cor_fonte)
        self.painel.add_widget(self.aba_resumo)
        self.painel.add_widget(self.aba_registros) 
        self.icon  = u'logo_dap.png'



        # Definições iniciais
        tamx = Window.system_size[0] ; tamy = Window.system_size[1]         
        return self.painel


if __name__ in ('__main__','__android__'):

    DAP().run()

any idea?

syntonym
  • 7,134
  • 2
  • 32
  • 45
awulll
  • 161
  • 14

1 Answers1

1

The default tab is of type TabbedPanelHeader, so you can use kivy language rules to style it.

It’s important to note that by default, default_tab_cls is of type TabbedPanelHeader and thus has the same properties as other tabs.

You can also simply not have a default tab by setting do_default_tab to False.

Since 1.5.0, it is now possible to disable the creation of the default_tab by setting do_default_tab to False.

For more information read the documentation.

syntonym
  • 7,134
  • 2
  • 32
  • 45