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: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_())
- via option in View menu
Suggestion B
- 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
- issues
1.7.1 - browser - filelist - header highlighting issues
- fixed -
1.6.5 - browser - filelist - history is purged only when Browser tab is opened (1.8.1)
1.7.2 - browser - filelist - checkbox looks checked at win scale >100% (1.8.0)
- suggestions
Browser - filelist - toolbar - improve customization (current post)
Browser - filelist - toolbar - add metadata filters
Browser - filelist - rename - incorrect cursor position
Browser - filelist - limit max hint length
Browser - filelist - Move should not Copy files
Browser - filelist - Copy should not be default action
- done -
Browser - filelist - add statusbar (1.9.0)
Browser - filelist - details view - improve Rating, Color label appearance (1.8.1)
Browser - filelist - context menu - unify behavior (1.8.0)