Yuya Nishihara avatar Yuya Nishihara committed 7509c37

infobar: make header view accessible even if confirmation is presented

Column widths cannot be changed manually without accessing a header view.

Sometimes we want to adjust widths of incoming/outgoing preview, so we cannot
just cloak horizontal header by confirmation infobar.

Comments (0)

Files changed (2)

tortoisehg/hgqt/repoview.py

         vh.setDefaultSectionSize(20)
 
         header = self.horizontalHeader()
-        header.setDefaultAlignment(Qt.AlignLeft)
+        # AlignBottom because RepoWidget steals top of header space for InfoBar
+        header.setDefaultAlignment(Qt.AlignLeft | Qt.AlignBottom)
         header.setHighlightSections(False)
         header.setContextMenuPolicy(Qt.CustomContextMenu)
         header.customContextMenuRequested.connect(self.headerMenuRequest)

tortoisehg/hgqt/repowidget.py

         top = self.repoview.mapTo(self, QPoint(0, 0)).y()
         w.setGeometry(0, top, self.width(), w.heightForWidth(self.width()))
 
-        # give margin to make first row visible, except for auto-hide infobar
+        # give margin to make header or first row accessible. without header,
+        # column width cannot be changed while confirmation is presented.
         if w.infobartype > qtlib.InfoBar.INFO:
             h = self.repoview.horizontalHeader()
             y = h.mapTo(self.repoview, QPoint(0, 0)).y()
-            h.setMinimumSize(0, max(w.height() - y, 0))
+            if w.infobartype >= qtlib.InfoBar.CONFIRM:
+                xh = h.sizeHint().height()
+            else:
+                xh = 0
+            h.setMinimumSize(0, max(w.height() - y, 0) + xh)
             h.geometriesChanged.emit()
 
     @pyqtSlot(unicode, unicode)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.