mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Remove the extra side margins imposed by the central widget layout
This commit is contained in:
parent
d81aba5fc5
commit
64d3ed4c26
@ -170,10 +170,11 @@ class LocationManager(QObject): # {{{
|
|||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
class SearchBar(QWidget): # {{{
|
class SearchBar(QFrame): # {{{
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
QWidget.__init__(self, parent)
|
QFrame.__init__(self, parent)
|
||||||
|
self.setFrameStyle(QFrame.NoFrame)
|
||||||
self.setObjectName('search_bar')
|
self.setObjectName('search_bar')
|
||||||
self._layout = l = QHBoxLayout(self)
|
self._layout = l = QHBoxLayout(self)
|
||||||
l.setContentsMargins(0, 4, 0, 4)
|
l.setContentsMargins(0, 4, 0, 4)
|
||||||
@ -197,8 +198,7 @@ class SearchBar(QWidget): # {{{
|
|||||||
x.setToolTip(_('Close the Virtual library'))
|
x.setToolTip(_('Close the Virtual library'))
|
||||||
parent.clear_vl = x
|
parent.clear_vl = x
|
||||||
self.vl_sep = QFrame(self)
|
self.vl_sep = QFrame(self)
|
||||||
self.vl_sep.setFrameShape(QFrame.VLine)
|
self.vl_sep.setFrameStyle(QFrame.VLine | QFrame.Sunken)
|
||||||
self.vl_sep.setFrameShadow(QFrame.Sunken)
|
|
||||||
l.addWidget(self.vl_sep)
|
l.addWidget(self.vl_sep)
|
||||||
|
|
||||||
x = parent.search = SearchBox2(self)
|
x = parent.search = SearchBox2(self)
|
||||||
@ -297,9 +297,7 @@ class MainWindowMixin(object): # {{{
|
|||||||
self.centralwidget = QWidget(self)
|
self.centralwidget = QWidget(self)
|
||||||
self.setCentralWidget(self.centralwidget)
|
self.setCentralWidget(self.centralwidget)
|
||||||
self._central_widget_layout = l = QVBoxLayout(self.centralwidget)
|
self._central_widget_layout = l = QVBoxLayout(self.centralwidget)
|
||||||
m = l.contentsMargins()
|
l.setContentsMargins(0, 0, 0, 0)
|
||||||
m.setTop(0), m.setBottom(0)
|
|
||||||
l.setContentsMargins(m)
|
|
||||||
l.setSpacing(0)
|
l.setSpacing(0)
|
||||||
self.resize(1012, 740)
|
self.resize(1012, 740)
|
||||||
self.location_manager = LocationManager(self)
|
self.location_manager = LocationManager(self)
|
||||||
@ -311,8 +309,10 @@ class MainWindowMixin(object): # {{{
|
|||||||
self.location_manager, self)
|
self.location_manager, self)
|
||||||
for bar in self.bars_manager.main_bars:
|
for bar in self.bars_manager.main_bars:
|
||||||
self.addToolBar(Qt.TopToolBarArea, bar)
|
self.addToolBar(Qt.TopToolBarArea, bar)
|
||||||
|
bar.setStyleSheet('QToolBar { border: 0px }')
|
||||||
for bar in self.bars_manager.child_bars:
|
for bar in self.bars_manager.child_bars:
|
||||||
self.addToolBar(Qt.BottomToolBarArea, bar)
|
self.addToolBar(Qt.BottomToolBarArea, bar)
|
||||||
|
bar.setStyleSheet('QToolBar { border: 0px }')
|
||||||
self.bars_manager.update_bars()
|
self.bars_manager.update_bars()
|
||||||
# This is disabled because it introduces various toolbar related bugs
|
# This is disabled because it introduces various toolbar related bugs
|
||||||
# The width of the toolbar becomes the sum of both toolbars
|
# The width of the toolbar becomes the sum of both toolbars
|
||||||
|
Loading…
x
Reference in New Issue
Block a user