Set sensible sizePolicies everywhere
This commit is contained in:
parent
5366186dd1
commit
06c8f2d03a
@ -7,7 +7,7 @@ containing BrowserTabs).
|
|||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt5.QtWidgets import QShortcut, QApplication
|
from PyQt5.QtWidgets import QShortcut, QApplication, QSizePolicy
|
||||||
from PyQt5.QtCore import pyqtSignal, Qt, QEvent
|
from PyQt5.QtCore import pyqtSignal, Qt, QEvent
|
||||||
from PyQt5.QtGui import QClipboard
|
from PyQt5.QtGui import QClipboard
|
||||||
from PyQt5.QtPrintSupport import QPrintPreviewDialog
|
from PyQt5.QtPrintSupport import QPrintPreviewDialog
|
||||||
@ -43,6 +43,7 @@ class TabbedBrowser(TabWidget):
|
|||||||
space.setKey(Qt.Key_Space)
|
space.setKey(Qt.Key_Space)
|
||||||
space.setContext(Qt.WidgetWithChildrenShortcut)
|
space.setContext(Qt.WidgetWithChildrenShortcut)
|
||||||
space.activated.connect(self.space_scroll)
|
space.activated.connect(self.space_scroll)
|
||||||
|
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding)
|
||||||
|
|
||||||
def tabopen(self, url):
|
def tabopen(self, url):
|
||||||
"""Open a new tab with a given url.
|
"""Open a new tab with a given url.
|
||||||
|
@ -8,7 +8,7 @@ subclasses to provide completions.
|
|||||||
import html
|
import html
|
||||||
|
|
||||||
from PyQt5.QtWidgets import (QTreeView, QStyledItemDelegate, QStyle,
|
from PyQt5.QtWidgets import (QTreeView, QStyledItemDelegate, QStyle,
|
||||||
QStyleOptionViewItem)
|
QStyleOptionViewItem, QSizePolicy)
|
||||||
from PyQt5.QtCore import (QRectF, QRect, QPoint, pyqtSignal, Qt,
|
from PyQt5.QtCore import (QRectF, QRect, QPoint, pyqtSignal, Qt,
|
||||||
QItemSelectionModel)
|
QItemSelectionModel)
|
||||||
from PyQt5.QtGui import (QIcon, QPalette, QTextDocument, QTextOption,
|
from PyQt5.QtGui import (QIcon, QPalette, QTextDocument, QTextOption,
|
||||||
@ -77,6 +77,7 @@ class CompletionView(QTreeView):
|
|||||||
self.model.pattern_changed.connect(self.resort)
|
self.model.pattern_changed.connect(self.resort)
|
||||||
self.setItemDelegate(CompletionItemDelegate())
|
self.setItemDelegate(CompletionItemDelegate())
|
||||||
self.setStyleSheet(config.get_stylesheet(self._stylesheet))
|
self.setStyleSheet(config.get_stylesheet(self._stylesheet))
|
||||||
|
self.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Minimum)
|
||||||
self.expandAll()
|
self.expandAll()
|
||||||
self.setHeaderHidden(True)
|
self.setHeaderHidden(True)
|
||||||
self.setIndentation(0)
|
self.setIndentation(0)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
"""The commandline part of the statusbar."""
|
"""The commandline part of the statusbar."""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from PyQt5.QtWidgets import QLineEdit, QShortcut
|
from PyQt5.QtWidgets import QLineEdit, QShortcut, QSizePolicy
|
||||||
from PyQt5.QtCore import pyqtSignal, Qt
|
from PyQt5.QtCore import pyqtSignal, Qt
|
||||||
from PyQt5.QtGui import QValidator, QKeySequence
|
from PyQt5.QtGui import QValidator, QKeySequence
|
||||||
|
|
||||||
@ -35,6 +35,7 @@ class Command(QLineEdit):
|
|||||||
self.setValidator(Validator())
|
self.setValidator(Validator())
|
||||||
self.returnPressed.connect(self.process_cmdline)
|
self.returnPressed.connect(self.process_cmdline)
|
||||||
self.textEdited.connect(self._histbrowse_stop)
|
self.textEdited.connect(self._histbrowse_stop)
|
||||||
|
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Minimum)
|
||||||
|
|
||||||
for (key, handler) in [
|
for (key, handler) in [
|
||||||
(Qt.Key_Escape, self.esc_pressed),
|
(Qt.Key_Escape, self.esc_pressed),
|
||||||
|
@ -19,7 +19,7 @@ class Text(QLabel):
|
|||||||
def __init__(self, bar):
|
def __init__(self, bar):
|
||||||
super().__init__(bar)
|
super().__init__(bar)
|
||||||
self.setStyleSheet("padding-right: 1px;")
|
self.setStyleSheet("padding-right: 1px;")
|
||||||
self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Ignored)
|
self.setSizePolicy(QSizePolicy.Preferred, QSizePolicy.Minimum)
|
||||||
|
|
||||||
def __setattr__(self, name, value):
|
def __setattr__(self, name, value):
|
||||||
super().__setattr__(name, value)
|
super().__setattr__(name, value)
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
"""The tab widget used for TabbedBrowser from browser.py."""
|
"""The tab widget used for TabbedBrowser from browser.py."""
|
||||||
|
|
||||||
from PyQt5.QtWidgets import QTabWidget
|
from PyQt5.QtWidgets import QTabWidget, QSizePolicy
|
||||||
from PyQt5.QtCore import Qt
|
from PyQt5.QtCore import Qt
|
||||||
|
|
||||||
import qutebrowser.utils.config as config
|
import qutebrowser.utils.config as config
|
||||||
@ -21,6 +21,7 @@ class TabWidget(QTabWidget):
|
|||||||
QTabBar {{
|
QTabBar {{
|
||||||
font-family: {monospace};
|
font-family: {monospace};
|
||||||
font-size: 8pt;
|
font-size: 8pt;
|
||||||
|
height: 13px;
|
||||||
}}
|
}}
|
||||||
|
|
||||||
QTabBar::tab {{
|
QTabBar::tab {{
|
||||||
@ -43,6 +44,7 @@ class TabWidget(QTabWidget):
|
|||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
super().__init__(parent)
|
super().__init__(parent)
|
||||||
|
self.setSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed)
|
||||||
self.setStyleSheet(config.get_stylesheet(self._stylesheet))
|
self.setStyleSheet(config.get_stylesheet(self._stylesheet))
|
||||||
self.setDocumentMode(True)
|
self.setDocumentMode(True)
|
||||||
self.setElideMode(Qt.ElideRight)
|
self.setElideMode(Qt.ElideRight)
|
||||||
|
Loading…
Reference in New Issue
Block a user