Seitenstil an aktuelles OBP60 angenähert
This commit is contained in:
		
							parent
							
								
									5c2f058888
								
							
						
					
					
						commit
						8b5168a83e
					
				
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 165 B | 
|  | @ -48,6 +48,7 @@ class Page(): | ||||||
|     def __init__(self, pageno, cfg, boatdata): |     def __init__(self, pageno, cfg, boatdata): | ||||||
|         self.pageno = pageno |         self.pageno = pageno | ||||||
|         self.cfg = cfg |         self.cfg = cfg | ||||||
|  |         self.fullscreen = cfg['guistyle'] == 'fullscreen' | ||||||
|         self.bd = boatdata |         self.bd = boatdata | ||||||
|         self.header = True |         self.header = True | ||||||
|         self.footer = True |         self.footer = True | ||||||
|  | @ -59,7 +60,7 @@ class Page(): | ||||||
|         self.icon['NEXT'] = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "arrow_r1.png")) |         self.icon['NEXT'] = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "arrow_r1.png")) | ||||||
|         self.icon['ILUM'] = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "lighton.png")) |         self.icon['ILUM'] = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "lighton.png")) | ||||||
|         self.sym_lock = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "lock.png")) |         self.sym_lock = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "lock.png")) | ||||||
|         self.sym_swipe = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "swipe.png")) |         self.sym_swipe = cairo.ImageSurface.create_from_png(os.path.join(cfg['imgpath'], "swipe3.png")) | ||||||
|         self.buttonlabel = { |         self.buttonlabel = { | ||||||
|             1: '', |             1: '', | ||||||
|             2: '', |             2: '', | ||||||
|  | @ -81,12 +82,23 @@ class Page(): | ||||||
|         Wie ausschalten bei Seitenwechsel? |         Wie ausschalten bei Seitenwechsel? | ||||||
|         """ |         """ | ||||||
|         ctx.save() |         ctx.save() | ||||||
|         if self.hbled: |         ctx.set_line_width(1) | ||||||
|         ctx.set_source_rgb(0, 0, 0) |         ctx.set_source_rgb(0, 0, 0) | ||||||
|         else: |         ctx.rectangle(201.5, 0.5, 23, 19) | ||||||
|  |         if self.hbled: | ||||||
|  |             ctx.fill_preserve() | ||||||
|  |         ctx.stroke() | ||||||
|  | 
 | ||||||
|  |         if self.hbled: | ||||||
|             ctx.set_source_rgb(0.86, 0.86, 0.86) # 0xdcdcdc |             ctx.set_source_rgb(0.86, 0.86, 0.86) # 0xdcdcdc | ||||||
|         ctx.arc(210, 9, 6, 0, math.pi*2) |         else: | ||||||
|         ctx.fill() |             ctx.set_source_rgb(0, 0, 0) | ||||||
|  |         pno = str(self.pageno) | ||||||
|  |         ext = ctx.text_extents(pno) | ||||||
|  |         ctx.move_to(211 - ext.width / 2.0, 9 + ext.height / 2.0) | ||||||
|  |         ctx.show_text(pno) | ||||||
|  | 
 | ||||||
|  |         ctx.stroke() | ||||||
|         ctx.restore() |         ctx.restore() | ||||||
|         self.hbled = not self.hbled |         self.hbled = not self.hbled | ||||||
| 
 | 
 | ||||||
|  | @ -109,22 +121,12 @@ class Page(): | ||||||
|         ctx.show_text(f"N2K GPS") |         ctx.show_text(f"N2K GPS") | ||||||
|         ctx.stroke() |         ctx.stroke() | ||||||
| 
 | 
 | ||||||
|         # Seitennummer neue Darstellung |  | ||||||
|         ctx.set_line_width(1) |  | ||||||
|         ctx.move_to(170.5, 1.5) |  | ||||||
|         ctx.line_to(190.5, 1.5) |  | ||||||
|         ctx.line_to(190.5, 16.5) |  | ||||||
|         ctx.line_to(170.5, 16.5) |  | ||||||
|         ctx.line_to(170.5, 1.5) |  | ||||||
|         ctx.stroke() |  | ||||||
|         self.draw_text_center(ctx, 180, 9.5, str(self.pageno)) |  | ||||||
| 
 |  | ||||||
|         # Tastenstatus |         # Tastenstatus | ||||||
|         ctx.save() |         ctx.save() | ||||||
|         if self.keylock: |         if self.keylock: | ||||||
|             ctx.set_source_surface(self.sym_lock, 150, 1) |             ctx.set_source_surface(self.sym_lock, 170, 1) | ||||||
|         else: |         else: | ||||||
|             ctx.set_source_surface(self.sym_swipe, 150, 1) |             ctx.set_source_surface(self.sym_swipe, 166, 1) | ||||||
|         ctx.paint() |         ctx.paint() | ||||||
|         ctx.restore() |         ctx.restore() | ||||||
| 
 | 
 | ||||||
|  | @ -140,11 +142,24 @@ class Page(): | ||||||
|         """ |         """ | ||||||
|         Nur Belegung der Buttons (label[1] bis label[6]) |         Nur Belegung der Buttons (label[1] bis label[6]) | ||||||
|         """ |         """ | ||||||
|  | 
 | ||||||
|         ctx.select_font_face("AtariST8x16SystemFont") |         ctx.select_font_face("AtariST8x16SystemFont") | ||||||
|         #ctx.select_font_face("Ubuntu", cairo.FontSlant.NORMAL, cairo.FontWeight.BOLD) |  | ||||||
|         ctx.set_font_size(16) |         ctx.set_font_size(16) | ||||||
|         x = (35, 101, 167, 233, 299, 365)  |         x = (35, 101, 167, 233, 299, 365)  | ||||||
|         y = 294 |         y = 294 | ||||||
|  | 
 | ||||||
|  |         ctx.set_line_width(1) | ||||||
|  |         ctx.move_to(0, 280.5) | ||||||
|  |         ctx.line_to(10, 280.5) | ||||||
|  |         ctx.move_to(380, 280.5) | ||||||
|  |         ctx.line_to(400, 280.5) | ||||||
|  |         for i in range(5): | ||||||
|  |             ctx.move_to(x[i]+32.5-10, 280.5) | ||||||
|  |             ctx.line_to(x[i]+32.5+10, 280.5) | ||||||
|  |             ctx.move_to(x[i]+32.5, 280) | ||||||
|  |             ctx.line_to(x[i]+32.5, 300) | ||||||
|  |         ctx.stroke() | ||||||
|  | 
 | ||||||
|         # Fullscreen-Buttons |         # Fullscreen-Buttons | ||||||
|         bx = 400 |         bx = 400 | ||||||
|         by = (128, 192, 256, 320, 384, 448) |         by = (128, 192, 256, 320, 384, 448) | ||||||
|  | @ -162,11 +177,11 @@ class Page(): | ||||||
|                     ctx.paint() |                     ctx.paint() | ||||||
|                     ctx.restore() |                     ctx.restore() | ||||||
|                 else: |                 else: | ||||||
|                     text = "[ {} ]".format(self.buttonlabel[i+1]) |                     text = self.buttonlabel[i+1] | ||||||
|                     w = ctx.text_extents(text).width |                     w = ctx.text_extents(text).width | ||||||
|                     ctx.move_to(x[i] - w/2, y)                |                     ctx.move_to(x[i] - w/2, y+2)                | ||||||
|                     ctx.show_text(text) |                     ctx.show_text(text) | ||||||
|                     # Fullscreen |                     if self.fullscreen: | ||||||
|                         w = ctx.text_extents(self.buttonlabel[i+1]).width |                         w = ctx.text_extents(self.buttonlabel[i+1]).width | ||||||
|                         ctx.move_to(bx + bw/3.2 - w/2, by[i] / 1.6 + 8) |                         ctx.move_to(bx + bw/3.2 - w/2, by[i] / 1.6 + 8) | ||||||
|                         ctx.show_text(self.buttonlabel[i+1]) |                         ctx.show_text(self.buttonlabel[i+1]) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue