Mercurial > libervia-desktop-kivy
diff cagou/core/cagou_main.py @ 208:c5c1dd7f88e1
root widget: improved notes:
- fixed size/text_size
- shorten note when necessary
- don't erase notes anymore when more that 10 are available
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 25 May 2018 12:06:08 +0200 |
parents | 33ac2d2ce5d7 |
children | 24f8ab7c08be |
line wrap: on
line diff
--- a/cagou/core/cagou_main.py Fri May 25 12:04:20 2018 +0200 +++ b/cagou/core/cagou_main.py Fri May 25 12:06:08 2018 +0200 @@ -102,8 +102,10 @@ level = properties.OptionProperty(C.XMLUI_DATA_LVL_DEFAULT, options=list(C.XMLUI_DATA_LVLS)) -class NoteDrop(Note): - pass +class NoteDrop(Label): + title = properties.StringProperty() + message = properties.StringProperty() + level = properties.OptionProperty(C.XMLUI_DATA_LVL_DEFAULT, options=list(C.XMLUI_DATA_LVLS)) class NotesDrop(DropDown): @@ -140,8 +142,6 @@ def addNote(self, title, message, level): note = Note(title=title, message=message, level=level) self.notes.append(note) - if len(self.notes) > 10: - del self.notes[:-10] if self.notes_event is None: self.notes_event = Clock.schedule_interval(self._displayNextNote, 5) self._displayNextNote()