Exemplo n.º 1
0
from kivy.uix.screenmanager import Screen
from kivy.uix.treeview import TreeView, TreeViewLabel
from kivy.uix.label import Label
from kivy.properties import ObjectProperty, StringProperty, NumericProperty
from datetime import timedelta
from utils import *
from fieldlabel import AutoShrinkFieldLabel
from kivy.logger import LoggerHistory, Logger
from autosportlabs.racecapture.theme.color import ColorScheme
from autosportlabs.uix.toast.kivytoast import toast
from main import RaceCaptureApp
from autosportlabs.widgets.scrollcontainer import ScrollContainer

STATUS_KV_FILE = 'autosportlabs/racecapture/views/status/statusview.kv'

RAW_STATUS_BGCOLOR_1 = ColorScheme.get_background()
RAW_STATUS_BGCOLOR_2 = ColorScheme.get_dark_background()


class StatusLabel(AutoShrinkFieldLabel):
    backgroundColor = ObjectProperty(RAW_STATUS_BGCOLOR_1)


class StatusTitle(StatusLabel):
    pass


class StatusValue(StatusLabel):
    def __init__(self, **kwargs):
        super(StatusLabel, self).__init__(**kwargs)
        self.shorten = False
Exemplo n.º 2
0
from kivy.app import Builder
from kivy.uix.screenmanager import Screen
from kivy.uix.treeview import TreeView, TreeViewLabel
from kivy.uix.label import Label
from kivy.properties import ObjectProperty, StringProperty, NumericProperty
from datetime import timedelta
from utils import *
from fieldlabel import FieldLabel
from kivy.logger import LoggerHistory, Logger
from autosportlabs.racecapture.theme.color import ColorScheme
from autosportlabs.uix.toast.kivytoast import toast
from main import RaceCaptureApp
from autosportlabs.widgets.scrollcontainer import ScrollContainer
STATUS_KV_FILE = 'autosportlabs/racecapture/views/status/statusview.kv'

RAW_STATUS_BGCOLOR_1 = ColorScheme.get_background()
RAW_STATUS_BGCOLOR_2 = ColorScheme.get_dark_background()

class StatusLabel(FieldLabel):
    backgroundColor = ObjectProperty(RAW_STATUS_BGCOLOR_1)

class StatusTitle(StatusLabel):
    pass

class StatusValue(StatusLabel):

    def __init__(self, **kwargs):
        super(StatusLabel, self).__init__(**kwargs)
        self.shorten = False

# Simple extension of Kivy's TreeViewLabel so we can add on our own properties