mirror of
https://github.com/Febbweiss/mopidy-touchscreen.git
synced 2026-03-04 22:25:39 +00:00
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,4 +7,4 @@
|
|||||||
MANIFEST
|
MANIFEST
|
||||||
build/
|
build/
|
||||||
dist/
|
dist/
|
||||||
.idea/
|
mopidy_touchscreen/.idea/
|
||||||
|
|||||||
@@ -3,8 +3,10 @@ import logging
|
|||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
class TouchTextManager():
|
class TouchTextManager():
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def __init__(self,size,base_size):
|
def __init__(self,size,base_size):
|
||||||
self.size = size
|
self.size = size
|
||||||
self.base_size = base_size
|
self.base_size = base_size
|
||||||
@@ -35,6 +37,7 @@ class TouchTextManager():
|
|||||||
|
|
||||||
|
|
||||||
class BaseItem():
|
class BaseItem():
|
||||||
|
|
||||||
def __init__(self,pos,pos2):
|
def __init__(self,pos,pos2):
|
||||||
self.pos = pos
|
self.pos = pos
|
||||||
self.pos2 = pos2
|
self.pos2 = pos2
|
||||||
@@ -45,6 +48,7 @@ class BaseItem():
|
|||||||
|
|
||||||
|
|
||||||
class TextItem(BaseItem):
|
class TextItem(BaseItem):
|
||||||
|
|
||||||
def __init__(self, text, pos,pos2, color,text_size):
|
def __init__(self, text, pos,pos2, color,text_size):
|
||||||
if pos2 is not None:
|
if pos2 is not None:
|
||||||
BaseItem.__init__(self,pos,pos2)
|
BaseItem.__init__(self,pos,pos2)
|
||||||
@@ -99,8 +103,8 @@ class TextItem(BaseItem):
|
|||||||
def set_text(self, text):
|
def set_text(self, text):
|
||||||
self.__init__(text,self.pos,self.pos2,self.color,self.text_size)
|
self.__init__(text,self.pos,self.pos2,self.color,self.text_size)
|
||||||
|
|
||||||
|
|
||||||
class TouchObject(BaseItem):
|
class TouchObject(BaseItem):
|
||||||
|
|
||||||
def __init__(self,pos,pos2):
|
def __init__(self,pos,pos2):
|
||||||
BaseItem.__init__(self,pos,pos2)
|
BaseItem.__init__(self,pos,pos2)
|
||||||
self.active = False
|
self.active = False
|
||||||
@@ -112,6 +116,7 @@ class TouchObject(BaseItem):
|
|||||||
|
|
||||||
|
|
||||||
class TouchAndTextItem(TouchObject, TextItem):
|
class TouchAndTextItem(TouchObject, TextItem):
|
||||||
|
|
||||||
def __init__(self, text, pos, color,text_size):
|
def __init__(self, text, pos, color,text_size):
|
||||||
TextItem.__init__(self,text, pos,None, color,text_size)
|
TextItem.__init__(self,text, pos,None, color,text_size)
|
||||||
TouchObject.__init__(self,pos,self.pos2)
|
TouchObject.__init__(self,pos,self.pos2)
|
||||||
@@ -123,8 +128,8 @@ class TouchAndTextItem(TouchObject, TextItem):
|
|||||||
TouchObject.render(self,surface)
|
TouchObject.render(self,surface)
|
||||||
TextItem.render(self,surface)
|
TextItem.render(self,surface)
|
||||||
|
|
||||||
|
|
||||||
class Progressbar(BaseItem):
|
class Progressbar(BaseItem):
|
||||||
|
|
||||||
def __init__(self, pos, pos2, max):
|
def __init__(self, pos, pos2, max):
|
||||||
BaseItem.__init__(self, pos, pos2)
|
BaseItem.__init__(self, pos, pos2)
|
||||||
logger.error(pos2)
|
logger.error(pos2)
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ from mopidy_touchscreen import Extension, touch_screen as frontend_lib
|
|||||||
|
|
||||||
|
|
||||||
class ExtensionTest(unittest.TestCase):
|
class ExtensionTest(unittest.TestCase):
|
||||||
|
|
||||||
def test_get_default_config(self):
|
def test_get_default_config(self):
|
||||||
ext = Extension()
|
ext = Extension()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user