0

I am working with a FileChooser module in Kivy which is black by default. But for the rest of my app I used this to define Labels and Buttons style :

<Label>
canvas.before:
                Color:
                    rgba: 1, 1, 1, 1
                Rectangle:
                    pos: self.pos
                    size: self.size 

and

<Button>
    font_size:20
    color:  1,1,1,1
    background_color: (0.55,0.55,0.47,1.0)
    size_hint:0.9,0.2

This is efficient and time saver BUT it breaks the FileChooserIconView I use : The filechooser contains Labels and buttons. They are all in the same class, so do you know how to NOT affect this button and label stuyle to one class ?

I already tried to change the filechooser style instead but it's not working

The filechooser class

<LoadDialog>:
    BoxLayout:
        size: root.size
        pos: root.pos
        orientation: "vertical"

        FileChooserIconView:

            id: filechooser

        BoxLayout:
            size_hint_y: None
            height: 30
            Button:
                text: "Cancel"
                on_release: root.cancel()

            Button:
                text: "Load"
                on_release: root.load(filechooser.path, filechooser.selection)
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Antoine Berger
  • 85
  • 1
  • 10
  • 1
    Rather than changing all `Labels` and `Buttons` and then trying to unchange the `FileChooser`, consider defining styles for custom classes like `MyButton` and `MyLabel` and using those custom `Widgets` in the rest of your `App`. – John Anderson Nov 26 '19 at 18:19
  • Oh yes that's smart, I always forgot that – Antoine Berger Nov 27 '19 at 19:08

0 Answers0