Anpassung an Vollbild 800x480 auf OBP60P physischem Display
This commit is contained in:
19
led.py
19
led.py
@@ -32,23 +32,30 @@ colordef = {
|
||||
|
||||
class LED():
|
||||
|
||||
def __init__(self, parent):
|
||||
def __init__(self, parent, fullscreen):
|
||||
# parent muß ein Gtk.Fixed-Objekt sein
|
||||
self._colorname = ""
|
||||
self._color = (0, 0, 0) # Farbe schwarz ist aus
|
||||
self._brightness = 0.0
|
||||
self._color_off = (0.3725, 0.4275, 0.6078) # RGB(95, 109, 155)
|
||||
self._pos_x = 30
|
||||
self._pos_y = 14
|
||||
self._radius = 5
|
||||
self._flashcounter = 0
|
||||
self._flashcolor = (0, 0, 0)
|
||||
self._enabled = False
|
||||
|
||||
# Box oberhalb des Displays
|
||||
self._da = Gtk.DrawingArea()
|
||||
parent.put(self._da, 64, 56)
|
||||
self._da.set_size_request(400, 32)
|
||||
if fullscreen:
|
||||
parent.put(self._da, 640, 0)
|
||||
self._da.set_size_request(160, 64)
|
||||
self._pos_x = 18
|
||||
self._pos_y = 20
|
||||
self._radius = 8
|
||||
else:
|
||||
parent.put(self._da, 64, 56)
|
||||
self._da.set_size_request(400, 32)
|
||||
self._pos_x = 30
|
||||
self._pos_y = 14
|
||||
self._radius = 5
|
||||
self._da.connect("draw", self.on_draw)
|
||||
|
||||
def on_draw(self, widget, ctx):
|
||||
|
||||
Reference in New Issue
Block a user