feat: add Mosaic Graphics support and fix char rendering
- Added Mosaic Picker dialog with visual previews - Added 'Graphics' mode toggle to UI - Implemented status bar mode indicator (Text/Graphics) - Corrected English character mapping for 0x60 to Hyphen (-) - Verified German and Swedish/Finnish character sets against ETSI spec
This commit is contained in:
@@ -53,7 +53,7 @@ COLORS = [
|
||||
]
|
||||
|
||||
class TeletextCanvas(QWidget):
|
||||
cursorChanged = pyqtSignal(int, int, int) # x, y, byte_val
|
||||
cursorChanged = pyqtSignal(int, int, int, bool) # x, y, byte_val, is_graphics
|
||||
|
||||
def __init__(self, parent=None):
|
||||
super().__init__(parent)
|
||||
@@ -83,6 +83,7 @@ class TeletextCanvas(QWidget):
|
||||
self.cursor_x = 0
|
||||
self.cursor_y = 0
|
||||
self.cursor_visible = True
|
||||
self.cursor_is_graphics = False # Tracked during draw
|
||||
# Blinking cursor timer could be added, for now static inverted is fine or toggle on timer elsewhere
|
||||
|
||||
def get_byte_at(self, x, y):
|
||||
@@ -103,7 +104,7 @@ class TeletextCanvas(QWidget):
|
||||
|
||||
def emit_cursor_change(self):
|
||||
val = self.get_byte_at(self.cursor_x, self.cursor_y)
|
||||
self.cursorChanged.emit(self.cursor_x, self.cursor_y, val)
|
||||
self.cursorChanged.emit(self.cursor_x, self.cursor_y, val, self.cursor_is_graphics)
|
||||
|
||||
def set_cursor(self, x, y):
|
||||
self.cursor_x = max(0, min(self.cols - 1, x))
|
||||
@@ -329,6 +330,10 @@ class TeletextCanvas(QWidget):
|
||||
if double_height and not is_occluded:
|
||||
next_occlusion_mask[c] = True
|
||||
|
||||
# Capture cursor state if this is the cursor position
|
||||
if c == self.cursor_x and row == self.cursor_y:
|
||||
self.cursor_is_graphics = graphics_mode
|
||||
|
||||
# If occluded, do not draw anything for this cell
|
||||
if is_occluded:
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user