feat: add graphics control buttons (Hold/Release) and refine UI styling
All checks were successful
Build Linux / Build Linux (push) Successful in 1m31s
Build Windows / Build Windows (push) Successful in 2m51s

This commit is contained in:
2026-01-21 14:42:14 +01:00
parent 80cca7cd79
commit e304034596

View File

@@ -237,20 +237,47 @@ class MainWindow(QMainWindow):
# New Background (0x1D) # New Background (0x1D)
btn_new_bg = QPushButton("New BG") btn_new_bg = QPushButton("New BG")
btn_new_bg.setFixedSize(80, 30)
btn_new_bg.setStyleSheet("background-color: #CCCCCC; color: black; font-weight: bold; border: 1px solid #555; border-radius: 3px;")
btn_new_bg.setToolTip("Sets the current foreground color as the new background color (0x1D)") btn_new_bg.setToolTip("Sets the current foreground color as the new background color (0x1D)")
btn_new_bg.clicked.connect(lambda: self.insert_char(0x1D)) btn_new_bg.clicked.connect(lambda: self.insert_char(0x1D))
bg_layout.addWidget(btn_new_bg) bg_layout.addWidget(btn_new_bg)
# Black Background (0x1C) # Black Background (0x1C)
btn_black_bg = QPushButton("Black BG") btn_black_bg = QPushButton("Black BG")
btn_black_bg.setFixedSize(80, 30)
btn_black_bg.setStyleSheet("background-color: black; color: white; font-weight: bold; border: 1px solid #555; border-radius: 3px;")
btn_black_bg.setToolTip("Resets the background color to Black (0x1C)") btn_black_bg.setToolTip("Resets the background color to Black (0x1C)")
btn_black_bg.setStyleSheet("background-color: black; color: white;")
btn_black_bg.clicked.connect(lambda: self.insert_char(0x1C)) btn_black_bg.clicked.connect(lambda: self.insert_char(0x1C))
bg_layout.addWidget(btn_black_bg) bg_layout.addWidget(btn_black_bg)
bg_layout.addStretch() bg_layout.addStretch()
center_layout.addLayout(bg_layout) center_layout.addLayout(bg_layout)
# Graphics Control
gfx_ctrl_layout = QHBoxLayout()
gfx_ctrl_label = QLabel("Graphics Control:")
gfx_ctrl_layout.addWidget(gfx_ctrl_label)
# Hold Graphics (0x1E)
btn_hold = QPushButton("Hold Gfx")
btn_hold.setFixedSize(80, 30)
btn_hold.setStyleSheet("background-color: #CCCCCC; color: black; font-weight: bold; border: 1px solid #555; border-radius: 3px;")
btn_hold.setToolTip("Hold Graphics (0x1E): Displays the last graphic char in place of subsequent control codes.")
btn_hold.clicked.connect(lambda: self.insert_char(0x1E))
gfx_ctrl_layout.addWidget(btn_hold)
# Release Graphics (0x1F)
btn_release = QPushButton("Release Gfx")
btn_release.setFixedSize(90, 30)
btn_release.setStyleSheet("background-color: #CCCCCC; color: black; font-weight: bold; border: 1px solid #555; border-radius: 3px;")
btn_release.setToolTip("Release Graphics (0x1F): Ends the 'Hold Graphics' effect.")
btn_release.clicked.connect(lambda: self.insert_char(0x1F))
gfx_ctrl_layout.addWidget(btn_release)
gfx_ctrl_layout.addStretch()
center_layout.addLayout(gfx_ctrl_layout)
# Canvas # Canvas
self.canvas = TeletextCanvas() self.canvas = TeletextCanvas()
self.canvas.cursorChanged.connect(self.on_cursor_changed) self.canvas.cursorChanged.connect(self.on_cursor_changed)