Add a Camera toggle to show the camera panel, hidden by default
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+4
-1
@@ -475,7 +475,6 @@ class MainWindow(QMainWindow):
|
|||||||
if self.device is None:
|
if self.device is None:
|
||||||
self.act_scan.setEnabled(False)
|
self.act_scan.setEnabled(False)
|
||||||
self.act_scan.setToolTip("No myScan found (scanning needs Linux and the mouse plugged in)")
|
self.act_scan.setToolTip("No myScan found (scanning needs Linux and the mouse plugged in)")
|
||||||
self.camera_pane.hide()
|
|
||||||
self.set_message("No scanner found: open or drop an image to read it")
|
self.set_message("No scanner found: open or drop an image to read it")
|
||||||
else:
|
else:
|
||||||
self.start_scanner()
|
self.start_scanner()
|
||||||
@@ -499,6 +498,9 @@ class MainWindow(QMainWindow):
|
|||||||
tb.addAction(a)
|
tb.addAction(a)
|
||||||
return a
|
return a
|
||||||
|
|
||||||
|
self.act_camera = act("Camera", lambda on: self.camera_pane.setVisible(on), "Ctrl+K",
|
||||||
|
"Show the camera and the live sensor readings", True)
|
||||||
|
tb.addSeparator()
|
||||||
self.act_scan = act("Start scan", self.toggle_scan, "F5", "Start or stop a scan (or press the mouse's scan button)")
|
self.act_scan = act("Start scan", self.toggle_scan, "F5", "Start or stop a scan (or press the mouse's scan button)")
|
||||||
tb.addSeparator()
|
tb.addSeparator()
|
||||||
act("Open…", self.open_image, QKeySequence.Open, "Open an image to read")
|
act("Open…", self.open_image, QKeySequence.Open, "Open an image to read")
|
||||||
@@ -542,6 +544,7 @@ class MainWindow(QMainWindow):
|
|||||||
for w in (self.camera_pane, page_pane):
|
for w in (self.camera_pane, page_pane):
|
||||||
main.addWidget(w)
|
main.addWidget(w)
|
||||||
main.setSizes([220, 1180])
|
main.setSizes([220, 1180])
|
||||||
|
self.camera_pane.hide()
|
||||||
self.setCentralWidget(main)
|
self.setCentralWidget(main)
|
||||||
self.status_label = QLabel()
|
self.status_label = QLabel()
|
||||||
self.statusBar().addWidget(self.status_label, 1)
|
self.statusBar().addWidget(self.status_label, 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user