changeset 112:b6002eead003

ROMDockable: hide byte-shifting buttons for CHR browsing It really is only needed for PRG browsing and is somewhat confusing otherwise.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Thu, 19 Sep 2019 17:10:07 -0400
parents 872637684299
children ef1a879802ad
files widgets.py
diffstat 1 files changed, 20 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/widgets.py
+++ b/widgets.py
@@ -436,21 +436,24 @@
 
         self.toolbar.addWidget(self.rom_palette)
 
-        for group in [
-                [
-                    ("zoom-in", "Zoom in", "zoomIn"),
-                    ("zoom-out", "Zoom out", "zoomOut"),
-                    ("zoom-original", "Restore zoom", "zoomOriginal"),
-                ],
-                [
-                    ("increaseCols", "Increase number of columns", "increaseCols"),
-                    ("decreaseCols", "Decrease number of columns", "decreaseCols"),
-                ],
-                [
-                    ("go-up", "Move all tiles one byte forward", "byteForward"),
-                    ("go-down", "Move all tiles one byte backard", "byteBackward"),
-                ]
-        ]:
+        button_groups = [
+            [
+                ("zoom-in", "Zoom in", "zoomIn"),
+                ("zoom-out", "Zoom out", "zoomOut"),
+                ("zoom-original", "Restore zoom", "zoomOriginal"),
+            ],
+            [
+                ("increaseCols", "Increase number of columns", "increaseCols"),
+                ("decreaseCols", "Decrease number of columns", "decreaseCols"),
+            ],
+        ]
+        if not rom.CHR:
+            button_groups.append([
+                ("go-up", "Move all tiles one byte forward", "byteForward" if not rom.CHR else None),
+                ("go-down", "Move all tiles one byte backard", "byteBackward" if not rom.CHR else None),
+            ])
+
+        for group in button_groups:
             for icon, tooltip, function in group:
                 button = QW.QPushButton("")
                 iconpath = widget_icon_path(button)
@@ -460,7 +463,8 @@
                 button.setToolTip(tooltip)
                 button.pressed.connect(getattr(self.rom_canvas, function))
                 self.toolbar.addWidget(button)
-            self.toolbar.addStretch()
+            self.toolbar.addSpacing(BUTTON_SIZE)
+        self.toolbar.addStretch()
 
         layout = QW.QVBoxLayout()
         layout.addWidget(scroll)