Commits

Yuya Nishihara committed dcbdaec

finish infobar pos patch

  • Participants
  • Parent commits 24142f5

Comments (0)

Files changed (5)

File infobar-err.diff

-# HG changeset patch
-# Date 1361551622 -32400
-# Parent acf311d39197cae72ad6ec3fdb31da897ba250b2
-infobar: don't shadow revision log by error message
-
-It isn't so bad to change vertical scroll position by error infobar, because
-error infobar isn't vanished automatically.
-
-diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
---- a/tortoisehg/hgqt/repowidget.py
-+++ b/tortoisehg/hgqt/repowidget.py
-@@ -359,8 +359,8 @@ class RepoWidget(QWidget):
-         top = self.repoview.mapTo(self, QPoint(0, 0)).y()
-         w.setGeometry(0, top, self.width(), w.heightForWidth(self.width()))
- 
--        # give margin; first row should be visible without closing confirmation
--        if w.infobartype >= qtlib.InfoBar.CONFIRM:
-+        # give margin to make first row visible, except for auto-hide infobar
-+        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))

File infobar-under-filterbar-layreq.diff

-# HG changeset patch
-# Date 1361550493 -32400
-# Parent 8937b9ed7ce28f6713495388ddfec250c8ddf049
-infobar: place infobar right below filterbar to make it usable
-
-Overlaying infobar on top makes filterbar unusable while infobar is visible.
-It's really bad for push confirmation.
-
-To update geometry accordingly, it uses LayoutRequest event:
-http://qt-project.org/doc/qt-4.8/layout.html#custom-widgets-in-layouts
-
-diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
---- a/tortoisehg/hgqt/repowidget.py
-+++ b/tortoisehg/hgqt/repowidget.py
-@@ -356,12 +356,13 @@ class RepoWidget(QWidget):
-         if not self._activeInfoBar:
-             return
-         w = self._activeInfoBar
--        w.setGeometry(0, 0, self.width(), w.heightForWidth(self.width()))
-+        top = self.repoview.mapTo(self, QPoint(0, 0)).y()
-+        w.setGeometry(0, top, self.width(), w.heightForWidth(self.width()))
- 
-         # give margin; first row should be visible without closing confirmation
-         if w.infobartype >= qtlib.InfoBar.CONFIRM:
-             h = self.repoview.horizontalHeader()
--            y = h.mapTo(self, h.pos()).y()
-+            y = h.mapTo(self.repoview, QPoint(0, 0)).y()
-             h.setMinimumSize(0, max(w.height() - y, 0))
-             h.geometriesChanged.emit()
- 
-@@ -673,6 +674,11 @@ class RepoWidget(QWidget):
-         QWidget.resizeEvent(self, event)
-         self._updateInfoBarGeometry()
- 
-+    def event(self, event):
-+        if event.type() == QEvent.LayoutRequest:
-+            self._updateInfoBarGeometry()
-+        return QWidget.event(self, event)
-+
-     def createActions(self):
-         QShortcut(QKeySequence('CTRL+P'), self, self.gotoParent)
-         self.generateSingleMenu()

File infobar-under-filterbar.diff

-# HG changeset patch
-# Parent 8937b9ed7ce28f6713495388ddfec250c8ddf049
-infobar: place infobar right below of filterbar to make it usable
-
-Overlaying infobar on top makes filterbar unusable while infobar is visible.
-It's really bad for push confirmation.
-
-diff --git a/tortoisehg/hgqt/repowidget.py b/tortoisehg/hgqt/repowidget.py
---- a/tortoisehg/hgqt/repowidget.py
-+++ b/tortoisehg/hgqt/repowidget.py
-@@ -170,6 +170,7 @@ class RepoWidget(QWidget):
-         self.filterbar.setRevisionSet.connect(self.setRevisionSet)
-         self.filterbar.clearRevisionSet.connect(self._unapplyRevisionSet)
-         self.filterbar.filterToggled.connect(self.filterToggled)
-+        self.filterbar.visibilityChanged.connect(self._updateInfoBarGeometry)
-         self.filterbar.hide()
-         self.revsetfilter = self.filterbar.filtercb.isChecked()
- 
-@@ -352,16 +353,22 @@ class RepoWidget(QWidget):
-             h.setMinimumSize(0, 0)
-             h.geometriesChanged.emit()
- 
-+    @pyqtSlot()
-     def _updateInfoBarGeometry(self):
-         if not self._activeInfoBar:
-             return
-+
-+        if self.filterbar.isHidden():
-+            top = 0
-+        else:
-+            top = self.filterbar.height()
-         w = self._activeInfoBar
--        w.setGeometry(0, 0, self.width(), w.heightForWidth(self.width()))
-+        w.setGeometry(0, top, self.width(), w.heightForWidth(self.width()))
- 
-         # give margin; first row should be visible without closing confirmation
-         if w.infobartype >= qtlib.InfoBar.CONFIRM:
-             h = self.repoview.horizontalHeader()
--            y = h.mapTo(self, h.pos()).y()
-+            y = h.mapTo(self.repoview, QPoint(0, 0)).y()
-             h.setMinimumSize(0, max(w.height() - y, 0))
-             h.geometriesChanged.emit()
- 
-infobar-under-filterbar-layreq.diff
-infobar-err.diff
-infobar-under-filterbar.diff
-vischangedsig.diff
 filterbarev.diff
 finished-nodel-debug.diff
 no-delete-later.diff

File vischangedsig.diff

-# HG changeset patch
-# Parent a34732855ce3da678c1e1d858b39a6db09573c20
-repofilter: mimic visibilityChanged signal on Qt<4.7
-
-It will be used to update geometory of infobar in repowidget.
-
-diff --git a/tortoisehg/hgqt/repofilter.py b/tortoisehg/hgqt/repofilter.py
---- a/tortoisehg/hgqt/repofilter.py
-+++ b/tortoisehg/hgqt/repofilter.py
-@@ -10,7 +10,7 @@ import os
- from PyQt4.QtCore import *
- from PyQt4.QtGui import *
- 
--from mercurial import revset as hgrevset
-+from mercurial import util, revset as hgrevset
- 
- from tortoisehg.util import hglib
- from tortoisehg.hgqt.i18n import _
-@@ -20,7 +20,22 @@ from tortoisehg.hgqt import revset, qtli
-                       'tagged()', 'bookmark()',
-                       'file(".hgsubstate") or file(".hgsub")')
- 
--class RepoFilterBar(QToolBar):
-+if util.safehasattr(QToolBar, 'visibilityChanged'):  # Qt>=4.7
-+    _QToolBar = QToolBar
-+else:
-+    class _QToolBar(QToolBar):
-+        visibilityChanged = pyqtSignal(bool)
-+
-+        def showEvent(self, event):
-+            self.visibilityChanged.emit(True)
-+            super(_QToolBar, self).showEvent(event)
-+
-+        def hideEvent(self, event):
-+            if self.isHidden():
-+                self.visibilityChanged.emit(False)
-+            super(_QToolBar, self).hideEvent(event)
-+
-+class RepoFilterBar(_QToolBar):
-     """Toolbar for RepoWidget to filter changesets"""
- 
-     setRevisionSet = pyqtSignal(object)