Browser - filelist - toolbar - improve customization

Ideas for improvements and requests for new features in XnView MP

Moderators: helmut, XnTriq, xnview

Post Reply
User avatar
user0
XnThusiast
Posts: 2408
Joined: Sat May 09, 2015 9:37 am

Browser - filelist - toolbar - improve customization

Post by user0 »

XnViewMP 1.9.1 64bit
Windows11 (24H2), display resolution 3840x2160, dpi scale 150%


Browser - filelist
follow-up on this suggestion to further improve customization

Suggestion A
  • add some flexibility to positioning of Filelist panel's toolbars
    • via option in View menu
      similar to View>Tab
    • via detachable functionality
      so they could be repositioned (top/bottom/sides)

      Especially taking into account this suggestion:
      Browser - filelist - toolbar - add metadata filters

      something like this:
      qtpy_panel_toolbar_detachable.png
      qtpy_panel_toolbar_detachable.png (4.48 KiB) Viewed 149 times

      Code: Select all

      from qtpy.QtWidgets import (
          QApplication, QMainWindow, QDockWidget, QToolBar,
          QLabel, QWidget, QAction, QSizePolicy
      )
      from qtpy.QtCore import Qt
      import sys
      
      class DockPanel(QMainWindow):
          def __init__(self):
              super().__init__()
              self.setWindowTitle("Dock Panel Internal")
      
              # Toolbar 1 (top)
              toolbar1 = QToolBar("Toolbar 1", self)
              toolbar1.setMovable(True)
      
              # Action A
              toolbar1.addAction(QAction("Action A", self))
      
              # Spacer between A and B
              spacer1 = QWidget()
              spacer1.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
              toolbar1.addWidget(spacer1)
      
              # Action B
              toolbar1.addAction(QAction("Action B", self))
      
              self.addToolBar(Qt.TopToolBarArea, toolbar1)
      
              # Toolbar 2 (bottom)
              toolbar2 = QToolBar("Toolbar 2", self)
              toolbar2.setMovable(True)
      
              # Action C
              toolbar2.addAction(QAction("Action C", self))
      
              # Spacer between C and D
              spacer2 = QWidget()
              spacer2.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
              toolbar2.addWidget(spacer2)
      
              # Action D
              toolbar2.addAction(QAction("Action D", self))
      
              self.addToolBar(Qt.BottomToolBarArea, toolbar2)
      
              # Content area
              content = QLabel("Panel Content Area")
              content.setStyleSheet("""
                  background-color: white;
                  padding: 10px;
                  font-size: 14px;
                  border: 1px solid #ccc;
              """)
              self.setCentralWidget(content)
      
      
      class MainWindow(QMainWindow):
          def __init__(self):
              super().__init__()
              self.setWindowTitle("QtPy Main Window with Fixed Dock")
      
              # Central content
              central_label = QLabel("Main Window Content")
              central_label.setStyleSheet("font-size: 16px; padding: 10px;")
              self.setCentralWidget(central_label)
      
              # Create dock widget
              dock = QDockWidget("Fixed Panel", self)
              dock.setAllowedAreas(Qt.LeftDockWidgetArea | Qt.RightDockWidgetArea)
      
              # 🔒 Make dock not detachable
              dock.setFeatures(QDockWidget.NoDockWidgetFeatures)
      
              # Set custom panel with two toolbars inside the dock
              dock_panel = DockPanel()
              dock.setWidget(dock_panel)
              self.addDockWidget(Qt.LeftDockWidgetArea, dock)
      
      if __name__ == "__main__":
          app = QApplication(sys.argv)
          window = MainWindow()
          window.resize(800, 500)
          window.show()
          sys.exit(app.exec_())
      


Suggestion B
browser_filelist_toolbar_customization_settings.png
browser_filelist_toolbar_customization_settings.png (35.14 KiB) Viewed 87 times
  • merge Filelist Toolbar into Interface Toolbar tab
    to unify UI settings UI and improve customization
    so there can be any number of toolbars (via --NEW BAR--) and buttons can be easily repositioned
  • add stretchable Spacer
    to align buttons to the right/bottom





Related
Post Reply