def add_view_widget(self, gateway): view = View(self.gui, gateway) widget = QWidget() layout = QGridLayout(widget) layout.addWidget(view) self.addWidget(widget) self.views.append(view)
def add_folders_view(self, gateway): view = View(self.gui, gateway) widget = QWidget() layout = QGridLayout(widget) if sys.platform == "darwin": # XXX: For some reason, getContentsMargins returns 20 px on macOS.. layout.setContentsMargins(11, 11, 11, 0) else: left, _, right, _ = layout.getContentsMargins() layout.setContentsMargins(left, 0, right, 0) layout.addWidget(view) layout.addWidget(StatusPanel(gateway, self.gui)) self.addWidget(widget) self.views.append(view) self.folders_views[gateway] = widget