def __init__(self, parent_widget, container: Container) -> None: super().__init__(parent_widget) self.container = container self.vertical_layout = QVBoxLayout(self) self.vertical_layout.setContentsMargins(rt(11), rt(11), rt(11), rt(11)) self.vertical_layout.setSpacing(rt(6)) self.top_widget = QWidget(self) self.top_widget.setSizePolicy(BQSizePolicy()) self.horizontal_layout = QHBoxLayout(self.top_widget) self.horizontal_layout.setContentsMargins(0, 0, 0, 0) self.horizontal_layout.setSpacing(rt(6)) self.user_env_label = QLabel(self.top_widget) self.horizontal_layout.addWidget(self.user_env_label) self.hidden_widget = QWidget(self.top_widget) self.hidden_widget.setSizePolicy(BQSizePolicy(h_stretch=1)) self.horizontal_layout.addWidget(self.hidden_widget) self.new_env = QPushButton(self.top_widget) self.horizontal_layout.addWidget(self.new_env) self.delete_env = QPushButton(self.top_widget) self.horizontal_layout.addWidget(self.delete_env) self.vertical_layout.addWidget(self.top_widget) self.user_table = QTableView(self) self.user_table.setSizePolicy(BQSizePolicy(v_stretch=1)) self.vertical_layout.addWidget(self.user_table) self.mid_widget = QWidget(self) self.mid_widget.setSizePolicy(BQSizePolicy()) self.horizontal_layout_2 = QHBoxLayout(self.mid_widget) self.horizontal_layout_2.setContentsMargins(0, 0, 0, 0) self.horizontal_layout_2.setSpacing(rt(6)) self.include_sys_env = QLabel(self.mid_widget) self.horizontal_layout_2.addWidget(self.include_sys_env) self.vertical_layout.addWidget(self.include_sys_env) self.sys_env_table = QTableView(self) self.sys_env_table.setSizePolicy(BQSizePolicy(v_stretch=1)) self.vertical_layout.addWidget(self.sys_env_table)
def __init__(self, parent, container: Container, handler) -> None: super().__init__(parent) self.handler = handler self.container = container self.verticalLayout = QVBoxLayout(self) self.verticalLayout.setContentsMargins(rt(11), rt(11), rt(11), rt(11)) self.verticalLayout.setSpacing(rt(6)) self.top_widget = QWidget(self) self.top_widget.setSizePolicy(BQSizePolicy()) self.horizontalLayout = QHBoxLayout(self.top_widget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setSpacing(rt(6)) self.volume_label = QLabel(self.top_widget) self.horizontalLayout.addWidget(self.volume_label) self.hidden_widget = QWidget(self.top_widget) self.hidden_widget.setSizePolicy(BQSizePolicy(h_stretch=1)) self.horizontalLayout.addWidget(self.hidden_widget) self.new_mount = QPushButton(self.top_widget) self.new_mount.setObjectName("newMount") self.horizontalLayout.addWidget(self.new_mount) self.delete_mount = QPushButton(self.top_widget) self.delete_mount.setObjectName("deleteMount") self.horizontalLayout.addWidget(self.delete_mount) self.verticalLayout.addWidget(self.top_widget) self.mount_table = QTableView(self) self.verticalLayout.addWidget(self.mount_table)
def __init__(self, parent, handler) -> None: super().__init__(parent) self.handler = handler self.setSizePolicy(BQSizePolicy(height=QSizePolicy.Fixed)) self.vertical_layout = QVBoxLayout(self) self.vertical_layout.setContentsMargins(0, 0, 0, 0) self.vertical_layout.setSpacing(0) self.widget = QWidget(self) self.widget.setSizePolicy(BQSizePolicy(height=QSizePolicy.Fixed)) self.vertical_layout.addWidget(self.widget) self.horizontal_layout = QHBoxLayout(self.widget) self.horizontal_layout.setContentsMargins(rt(8), rt(2), rt(8), rt(5)) self.type = QLabel(self.widget) self.horizontal_layout.addWidget(self.type) self.name = QLabel(self.widget) self.name.setSizePolicy(BQSizePolicy(h_stretch=2)) self.horizontal_layout.addWidget(self.name) self.undo = QPushButton(self.widget) self.undo.setFlat(True) padding = "%dpx %dpx" % (1, rt(10)) self.undo.setStyleSheet( "border: 1px solid #999999; padding: %s; border-radius: 2px" % padding) self.horizontal_layout.addWidget(self.undo) self.undo.setText('Undo')
def __init__(self, parent, container: Container) -> None: super().__init__(parent) self.container = container self.setSizePolicy(BQSizePolicy(height=QSizePolicy.Fixed)) self.layout = QVBoxLayout(self) self.layout.setContentsMargins(rt(20), 0, rt(3), rt(5)) self.layout.setSpacing(rt(6)) self.layout.setAlignment(Qt.AlignTop) line = QFrame(self) line.setFrameShape(QFrame.HLine) line.setFrameShadow(QFrame.Sunken) self.layout.addWidget(line) self.widget = QWidget(self) self.grid_layout = QGridLayout(self.widget) self.grid_layout.setAlignment(Qt.AlignTop) self.grid_layout.setContentsMargins(0, 0, 0, 0) self.grid_layout.setSpacing(rt(6)) self.layout.addWidget(self.widget) self.widget_3 = QWidget(self) self.horizontal_layout_2 = QHBoxLayout(self.widget_3) self.horizontal_layout_2.setContentsMargins(0, 0, 0, 0) self.horizontal_layout_2.setSpacing(rt(6)) self.widget_4 = QWidget(self.widget_3) self.widget_4.setSizePolicy(BQSizePolicy(h_stretch=1)) self.horizontal_layout_2.addWidget(self.widget_4) # self.advanced_configuration = QPushButton(self.widget_3) # self.horizontal_layout_2.addWidget(self.advanced_configuration) self.layout.addWidget(self.widget_3)
def __init__(self, parent, group: Group, handler) -> None: super().__init__(parent) self.handler = handler self.group = group self.setSizePolicy(BQSizePolicy(height=QSizePolicy.Fixed)) self.main_layout = QVBoxLayout(self) self.main_layout.setContentsMargins(0, 0, 0, 0) self.main_layout.setAlignment(Qt.AlignTop) self.main_layout.setSpacing(0) self.top_widget = QWidget(self) self.top_widget.setSizePolicy(BQSizePolicy(height=QSizePolicy.Fixed)) top_layout = QHBoxLayout(self.top_widget) top_layout.setContentsMargins(rt(11), rt(5), rt(11), rt(5)) top_layout.setSpacing(rt(6)) self.icon = QLabel(self) self.icon.setPixmap(QIcon(getResource('resources/icons/folder.svg')) .pixmap(QSize(rt(16), rt(16)))) top_layout.addWidget(self.icon) self.container_name = QLineEdit(self.top_widget) # Remove the border outline on focus self.container_name.setAttribute(Qt.WA_MacShowFocusRect, 0) self.container_name.setStyleSheet('border: none; background-color: transparent') self.container_name.setReadOnly(True) self.container_name.setText(self.group.name) top_layout.addWidget(self.container_name) self.workspace = QLabel(self) self.workspace.setText(group.workspace.name) self.workspace.setStyleSheet('color: #999999') top_layout.addWidget(self.workspace, alignment=Qt.AlignRight) self.main_layout.addWidget(self.top_widget) self.line = QFrame(self) self.line.setFrameShape(QFrame.HLine) self.line.setFrameShadow(QFrame.Sunken) self.main_layout.addWidget(self.line) self.app_list = QWidget(self) self.app_list.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.app_list_layout = QVBoxLayout(self.app_list) self.app_list_layout.setSpacing(0) self.app_list_layout.setSizeConstraint(QLayout.SetMinimumSize) self.app_list_layout.setAlignment(Qt.AlignTop) self.app_list_layout.setContentsMargins(0, rt(1), 0, 0) self.app_list.setLayout(self.app_list_layout) self.main_layout.addWidget(self.app_list)
def __init__(self, parent, container: Container, handler) -> None: super().__init__(parent) self.handler = handler self.container = container self.vertical_layout = QVBoxLayout(self) self.vertical_layout.setContentsMargins(rt(11), rt(11), rt(11), rt(11)) self.vertical_layout.setSpacing(rt(6)) self.top_widget = QWidget(self) self.top_widget.setSizePolicy(BQSizePolicy()) self.grid_layout = QGridLayout(self.top_widget) self.grid_layout.setContentsMargins(0, 0, 0, rt(12)) self.grid_layout.setSpacing(rt(6)) self.ip_addr = QLineEdit(self.top_widget) self.ip_addr.setSizePolicy( BQSizePolicy(h_stretch=1, height=QSizePolicy.Fixed)) self.ip_addr.setReadOnly(True) self.grid_layout.addWidget(self.ip_addr, 2, 1, 1, 1) self.ip_addr_label = QLabel(self.top_widget) self.grid_layout.addWidget(self.ip_addr_label, 2, 0, 1, 1) self.network_label = QLabel(self.top_widget) self.grid_layout.addWidget(self.network_label, 0, 0, 1, 1) self.network = QComboBox(self.top_widget) self.grid_layout.addWidget(self.network, 0, 1, 1, 1) self.hidden_widget_2 = QWidget(self.top_widget) self.hidden_widget_2.setSizePolicy(BQSizePolicy(h_stretch=1)) self.grid_layout.addWidget(self.hidden_widget_2, 2, 2, 1, 1) self.vertical_layout.addWidget(self.top_widget) self.line = QFrame(self) self.line.setFrameShape(QFrame.HLine) self.line.setFrameShadow(QFrame.Sunken) self.vertical_layout.addWidget(self.line) self.mid_widget = QWidget(self) self.mid_widget.setSizePolicy(BQSizePolicy()) self.horizontal_layout = QHBoxLayout(self.mid_widget) self.horizontal_layout.setContentsMargins(0, 0, 0, 0) self.horizontal_layout.setSpacing(rt(6)) self.port_label = QLabel(self.mid_widget) self.horizontal_layout.addWidget(self.port_label) self.hidden_widget = QWidget(self.mid_widget) self.hidden_widget.setSizePolicy(BQSizePolicy(h_stretch=1)) self.horizontal_layout.addWidget(self.hidden_widget) self.new_port = QPushButton(self.mid_widget) self.horizontal_layout.addWidget(self.new_port) self.delete_port = QPushButton(self.mid_widget) self.horizontal_layout.addWidget(self.delete_port) self.vertical_layout.addWidget(self.mid_widget) self.mapping_table = QTableView(self) self.vertical_layout.addWidget(self.mapping_table)
def __init__(self, parent: QWidget): super().__init__(parent) self.main_layout = QtWidgets.QHBoxLayout(self) self.main_layout.setContentsMargins(rt(3), 0, 0, 0) self.main_layout.setSpacing(0) self.scroll_area = QScrollArea(self) self.scroll_area.verticalScrollBar().resize(0, 0) self.scroll_area.horizontalScrollBar().resize(0, 0) self.scroll_area.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.scroll_area.setVerticalScrollBarPolicy(Qt.ScrollBarAlwaysOff) self.scroll_area.setSizePolicy(BQSizePolicy(h_stretch=1)) self.scroll_area.setFixedHeight(rt(20)) self.scroll_area.setFrameShape(QFrame.NoFrame) self.scroll_area.setFrameShadow(QFrame.Plain) self.scroll_area.setWidgetResizable(True) self.scroll_area.setContentsMargins(0, 0, 0, 0) self.folder_list = QWidget(self) self.folder_list.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.horizontal_layout = QtWidgets.QHBoxLayout(self.folder_list) self.horizontal_layout.setContentsMargins(0, 0, 0, 0) self.horizontal_layout.setSpacing(0) self.horizontal_layout.setAlignment(Qt.AlignLeft) self.folder_list.setLayout(self.horizontal_layout) self.scroll_area.setWidget(self.folder_list) self.main_layout.addWidget(self.scroll_area) self.labels = [] self.current_width = 0
def drawShortcut(self, shortcut: PreferencesShortcut, row): label = QLabel(self.ui.widget) label.setText(self._translate(self.template, shortcut.label) + ':') label.setToolTip(shortcut.description) self.ui.grid_layout.addWidget(label, row, 0, 1, 1) if shortcut.pref_type in ['File', 'Folder']: input_box = PathViewWidget(self.ui.widget) input_box.setPath(shortcut.default_value, shortcut.pref_type.lower()) self.ui.grid_layout.addWidget(input_box, row, 1, 1, 2) finder = QPushButton(self.ui.widget) finder.setText(' ... ') finder.setFlat(True) finder.setStyleSheet( "border: 1px solid #999999; padding: 0px 4px; border-radius: 2px" ) finder.setMaximumWidth(rt(25)) finder.clicked.connect( lambda x: self.findFileOrFolder(shortcut, input_box)) self.ui.grid_layout.addWidget(finder, row, 3, 1, 2) else: input_box = QLineEdit(self.ui.widget) input_box.setText(shortcut.default_value) input_box.textChanged.connect( lambda x: self.setShortcutValue(shortcut, x)) input_box.setStyleSheet( 'border: none; background-color: transparent') input_box.setReadOnly(shortcut.shortcut == 'Constant') self.ui.grid_layout.addWidget(input_box, row, 1, 1, 2) hidden_widget = QWidget(self.ui.widget) hidden_widget.setSizePolicy(BQSizePolicy(h_stretch=1)) self.ui.grid_layout.addWidget(hidden_widget, row, 3, 1, 2)
def __init__(self, parent, checked, shortcut: PreferencesShortcut): super().__init__(parent) self.setSizePolicy(BQSizePolicy()) layout = QHBoxLayout(self) layout.setContentsMargins(0, 0, 0, 0) switch = Switch(self, thumb_radius=rt(5), track_radius=rt(7)) switch.setChecked(checked) switch.clicked.connect(self.onSwitched) layout.addWidget(switch) self.shortcut = shortcut
def drawTagShortcut(self, row): label = QLabel(self.ui.widget) self.ui.grid_layout.addWidget(label, row, 0, 1, 1) self.tags = QComboBox(self.ui.widget) self.tags.setSizePolicy( BQSizePolicy(h_stretch=4, height=QSizePolicy.Fixed, width=QSizePolicy.Fixed)) self.ui.grid_layout.addWidget(self.tags, row, 1, 1, 2) hidden_widget = QWidget(self.ui.widget) hidden_widget.setSizePolicy(BQSizePolicy(h_stretch=1)) self.ui.grid_layout.addWidget(hidden_widget, row, 3, 1, 2) for index, tag in enumerate(tags_service.getTags(self.container)): self.tags.addItem(self.container.image_name + ":" + tag.name) if tag.name == self.container.tag: self.tags.setCurrentIndex(index) self.tags.currentTextChanged.connect(self.onImageTagChange) label.setText(self._translate(self.template, "Image tag:"))
def __init__(self, dialog) -> None: super().__init__() height = system_service.getRefHeight() / 1.8 width = height * 2 dialog.resize(width, height) dialog.setSizePolicy(BQSizePolicy(h_stretch=1)) dialog.setMinimumSize(QSize(width, height)) dialog.setSizeGripEnabled(False) dialog.setModal(False) main_layout = QVBoxLayout(dialog) main_layout.setContentsMargins(rt(8), rt(8), rt(8), rt(8)) main_layout.setSpacing(0) widget = QWidget(dialog) widget.setSizePolicy(BQSizePolicy()) self.grid_container = QGridLayout(widget) self.grid_container.setContentsMargins(0, 0, 0, rt(10)) self.repo_select = QComboBox(widget) self.repo_select.setSizePolicy( BQSizePolicy(width=QSizePolicy.Fixed, height=QSizePolicy.Fixed)) self.grid_container.addWidget(self.repo_select, 0, 0, 1, 1) self.key_search = QLineEdit(widget) self.key_search.setAttribute(Qt.WA_MacShowFocusRect, 0) self.key_search.setFocusPolicy(Qt.StrongFocus) self.key_search.setStyleSheet("padding: 2 2 2 5;") self.grid_container.addWidget(self.key_search, 0, 1, 1, 1) main_layout.addWidget(widget) self.scroll_area = QScrollArea(dialog) self.scroll_area.setFrameShape(QFrame.NoFrame) self.scroll_area.setFrameShadow(QFrame.Plain) self.scroll_area.setWidgetResizable(True) main_layout.addWidget(self.scroll_area) self.search_result_area = QWidget(dialog) self.search_result_area.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.search_result_layout = QGridLayout(self.search_result_area) self.search_result_layout.setContentsMargins(rt(10), rt(10), rt(12), rt(10)) self.search_result_layout.setAlignment(QtCore.Qt.AlignTop) self.search_result_area.setLayout(self.search_result_layout) # self.search_result_area.setContentsMargins(0, 0, 0, 0) self.scroll_area.setWidget(self.search_result_area)
def __init__(self, dialog) -> None: super().__init__() height = system_service.getRefHeight() / 2.6 width = height * 2 dialog.resize(width, height) dialog.setSizePolicy(BQSizePolicy(h_stretch=1)) dialog.setMinimumSize(QSize(width, height)) dialog.setMinimumSize(QSize(width, height)) dialog.setSizeGripEnabled(False) dialog.setModal(False) self.verticalLayout = QtWidgets.QVBoxLayout(dialog) self.verticalLayout.setContentsMargins(11, 11, 11, 11) self.verticalLayout.setSpacing(6) self.scroll_area = QtWidgets.QScrollArea(dialog) self.scroll_area.setSizePolicy(BQSizePolicy(v_stretch=20)) self.scroll_area.setFrameShape(QFrame.NoFrame) self.scroll_area.setFrameShadow(QFrame.Plain) self.scroll_area.setWidgetResizable(True) self.scroll_area.setContentsMargins(0, 0, 0, 0) self.verticalLayout.addWidget(self.scroll_area) self.acknowledge_widget = QtWidgets.QWidget(dialog) self.acknowledge_widget.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.acknowledge_layout = QtWidgets.QHBoxLayout( self.acknowledge_widget) self.acknowledge_layout.setContentsMargins(0, 10, 0, 0) self.acknowledge_layout.setSpacing(0) self.acknowledge_layout.setAlignment(Qt.AlignTop) self.acknowledge_widget.setLayout(self.acknowledge_layout) self.acknowledge = QtWidgets.QLabel(dialog) self.acknowledge.setSizePolicy(BQSizePolicy()) self.acknowledge.setTextInteractionFlags(Qt.TextBrowserInteraction) self.acknowledge.setWordWrap(True) self.acknowledge.setAlignment(Qt.AlignCenter) self.acknowledge.setOpenExternalLinks(True) self.acknowledge_layout.addWidget(self.acknowledge) self.scroll_area.setWidget(self.acknowledge_widget) self.retranslateUi()
def __init__(self, dialog) -> None: super().__init__() dialog.resize(rt(731), rt(200)) self.verticalLayout = QtWidgets.QVBoxLayout(dialog) self.label = QtWidgets.QLabel(dialog) self.label.setSizePolicy(BQSizePolicy(v_stretch=2)) font = QtGui.QFont() font.setPointSize(applyFontRatio(18)) font.setBold(True) font.setWeight(75) self.label.setFont(font) self.label.setAlignment(QtCore.Qt.AlignCenter) self.verticalLayout.addWidget(self.label) self.message = QtWidgets.QLabel(dialog) self.message.setAlignment(QtCore.Qt.AlignCenter) self.verticalLayout.addWidget(self.message) self.widget = QtWidgets.QWidget(dialog) self.widget.setSizePolicy(BQSizePolicy(v_stretch=3)) self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setSpacing(rt(6)) self.protocol = QtWidgets.QLabel(self.widget) font = QtGui.QFont() font.setPointSize(applyFontRatio(13)) font.setBold(True) font.setWeight(75) self.protocol.setFont(font) self.horizontalLayout.addWidget(self.protocol) self.url = QtWidgets.QLineEdit(self.widget) self.horizontalLayout.addWidget(self.url) self.verticalLayout.addWidget(self.widget) self.button_box = QtWidgets.QDialogButtonBox(dialog) self.button_box.setOrientation(QtCore.Qt.Horizontal) self.button_box.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel | QtWidgets.QDialogButtonBox.Ok) self.verticalLayout.addWidget(self.button_box) self.retranslateUi(dialog) self.button_box.rejected.connect(dialog.reject)
def __init__(self, dialog: QDialog, container: Container, handler) -> None: self.container = container self.handler = handler self.dialog = dialog height = system_service.getRefHeight() / 2.2 width = height * 2 dialog.resize(width, height) dialog.setSizePolicy(BQSizePolicy(h_stretch=1)) dialog.setMinimumSize(QSize(width, height)) dialog.setSizeGripEnabled(False) dialog.setModal(False) self.verticalLayout = QtWidgets.QVBoxLayout(dialog) self.verticalLayout.setContentsMargins(rt(11), rt(11), rt(11), rt(11)) self.verticalLayout.setSpacing(rt(6)) self.top_widget = QtWidgets.QWidget(dialog) self.top_widget.setSizePolicy(BQSizePolicy()) self.horizontalLayout = QtWidgets.QHBoxLayout(self.top_widget) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setSpacing(1) self.import_shortcut = QtWidgets.QPushButton(self.top_widget) self.import_shortcut.setAutoDefault(False) self.import_shortcut.setDefault(False) self.horizontalLayout.addWidget(self.import_shortcut) self.export_shortcut = QtWidgets.QPushButton(self.top_widget) self.horizontalLayout.addWidget(self.export_shortcut) self.hidden = QtWidgets.QWidget(self.top_widget) self.hidden.setSizePolicy(BQSizePolicy(h_stretch=1)) self.horizontalLayout.addWidget(self.hidden) self.new_shortcut = QtWidgets.QPushButton(self.top_widget) self.horizontalLayout.addWidget(self.new_shortcut) self.delete_shortcut = QtWidgets.QPushButton(self.top_widget) self.horizontalLayout.addWidget(self.delete_shortcut) self.move_up = QtWidgets.QPushButton(self.top_widget) self.horizontalLayout.addWidget(self.move_up) self.move_down = QtWidgets.QPushButton(self.top_widget) self.horizontalLayout.addWidget(self.move_down) self.verticalLayout.addWidget(self.top_widget) self.shortcut_table = QtWidgets.QTableView(dialog) self.verticalLayout.addWidget(self.shortcut_table)
def __init__(self, parent, container: Container, handler) -> None: super().__init__(parent) self.handler = handler self.setSizePolicy(BQSizePolicy(height=QSizePolicy.Fixed)) self.vertical_layout = QVBoxLayout(self) self.vertical_layout.setContentsMargins(0, 0, rt(2), 0) self.vertical_layout.setSpacing(0) self.vertical_layout.setAlignment(Qt.AlignTop) self.vertical_layout.setSizeConstraint(QLayout.SetMinimumSize) self.widget = QWidget(self) self.widget.setSizePolicy(BQSizePolicy(height=QSizePolicy.Fixed)) self.vertical_layout.addWidget(self.widget) self.horizontal_layout = QHBoxLayout(self.widget) self.horizontal_layout.setContentsMargins(rt(20), rt(1), rt(10), rt(3)) self.pic = AppAvatar(container, parent=self.widget, radius=rt(20)) self.horizontal_layout.addWidget(self.pic) self.name = QLabel(self.widget) self.name.setSizePolicy(BQSizePolicy(h_stretch=2)) self.horizontal_layout.addWidget(self.name) self.status = QPushButton(self.widget) self.status.setFlat(True) padding = "%dpx %dpx" % (1, rt(10)) self.status.setStyleSheet( "border: 1px solid #999999; padding: %s; border-radius: 2px" % padding) self.horizontal_layout.addWidget(self.status) self.advanced_app = AdvancedAppWidget(self.widget, container) self.vertical_layout.addWidget(self.advanced_app.ui) self.container = container self.line = QFrame(self) self.line.setFrameShape(QFrame.HLine) self.line.setFrameShadow(QFrame.Sunken) self.vertical_layout.addWidget(self.line)
def __init__(self, dialog: QDialog, container: Container) -> None: super().__init__() self.container = container height = system_service.getRefHeight() / 2 width = height * 1.6 dialog.resize(width, height) dialog.setSizePolicy(BQSizePolicy(h_stretch=1)) dialog.setMinimumSize(QSize(width, height)) dialog.setSizeGripEnabled(False) dialog.setModal(False) main_layout = QVBoxLayout(dialog) main_layout.setContentsMargins(0, 0, 0, 0) main_layout.setSpacing(0) self.central_widget = QWidget(dialog) self.vertical_layout = QVBoxLayout(self.central_widget) self.vertical_layout.setContentsMargins(11, 11, 11, 15) self.vertical_layout.setSpacing(6) self.tab_widget = QTabWidget(self.central_widget) self.tab_widget.setDocumentMode(False) self.general = GeneralAppConfig(self.central_widget, self.container) self.tab_widget.addTab(self.general.ui, "") self.port = PortMappingConfig(self.central_widget, self.container) self.tab_widget.addTab(self.port.ui, "") self.volume = VolumeMountConfig(self.central_widget, self.container) self.tab_widget.addTab(self.volume.ui, "") self.environment = EnvironmentConfig(self.central_widget, self.container) self.tab_widget.addTab(self.environment.ui, "") # self.others = AutoResizeWidget(self.central_widget) # self.tab_widget.addTab(self.others, "") self.vertical_layout.addWidget(self.tab_widget) main_layout.addWidget(self.central_widget)
def __init__(self, dialog: QDialog) -> None: super().__init__() height = system_service.getRefHeight() / 2 width = height * 2 dialog.resize(width, height) dialog.setSizePolicy(BQSizePolicy(h_stretch=1)) dialog.setMinimumSize(QSize(width, height)) dialog.setSizeGripEnabled(False) dialog.setModal(False) self.vertical_layout = QtWidgets.QVBoxLayout(dialog) self.vertical_layout.setContentsMargins(0, 0, 0, 0) self.vertical_layout.setSpacing(0) self.top_widget = QtWidgets.QWidget(dialog) self.vertical_layout_2 = QtWidgets.QVBoxLayout(self.top_widget) self.vertical_layout_2.setContentsMargins(0, 0, 0, 0) self.vertical_layout_2.setSpacing(0) self.tool_widget = QtWidgets.QWidget(self.top_widget) self.horizontal_layout = QtWidgets.QHBoxLayout(self.tool_widget) self.horizontal_layout.setContentsMargins(rt(12), rt(6), rt(12), rt(6)) self.horizontal_layout.setSpacing(rt(6)) self.now = QtWidgets.QPushButton(self.tool_widget) self.now.setCheckable(True) self.now.setChecked(True) self.now.setFocusPolicy(Qt.NoFocus) self.horizontal_layout.addWidget(self.now) self.hidden_1 = QtWidgets.QWidget(self.tool_widget) self.hidden_1.setSizePolicy(BQSizePolicy(h_stretch=1)) self.horizontal_layout.addWidget(self.hidden_1) self.clear = QtWidgets.QPushButton(self.tool_widget) self.clear.setFocusPolicy(Qt.NoFocus) self.horizontal_layout.addWidget(self.clear) self.reload = QtWidgets.QPushButton(self.tool_widget) self.reload.setFocusPolicy(Qt.NoFocus) self.horizontal_layout.addWidget(self.reload) self.hidden_2 = QtWidgets.QWidget(self.tool_widget) self.hidden_2.setSizePolicy(BQSizePolicy(h_stretch=1)) self.horizontal_layout.addWidget(self.hidden_2) self.info = QtWidgets.QPushButton(self.tool_widget) self.info.setFocusPolicy(Qt.NoFocus) self.info.setCheckable(True) self.info.setChecked(True) self.horizontal_layout.addWidget(self.info) self.hidden = QtWidgets.QWidget(self.tool_widget) self.horizontal_layout.addWidget(self.hidden) self.search = QtWidgets.QLineEdit(self.tool_widget) self.search.setSizePolicy(BQSizePolicy(h_stretch=3)) self.search.setStyleSheet("padding: 0 0 0 5;") self.horizontal_layout.addWidget(self.search) self.vertical_layout_2.addWidget(self.tool_widget) self.vertical_layout.addWidget(self.top_widget) self.log_widget = QtWidgets.QWidget(dialog) self.log_widget.setSizePolicy(BQSizePolicy(v_stretch=3)) self.vertical_layout_3 = QtWidgets.QVBoxLayout(self.log_widget) self.vertical_layout_3.setContentsMargins(0, 0, 0, 0) self.vertical_layout_3.setSpacing(rt(6)) self.splitter = QtWidgets.QSplitter(self.log_widget) self.splitter.setOrientation(QtCore.Qt.Vertical) self.log_list_table = UniformRowHeights(self.splitter) self.log_details = QtWidgets.QWidget(self.splitter) self.log_details_layout = QtWidgets.QVBoxLayout(self.log_details) self.log_details_layout.setContentsMargins(rt(8), 0, rt(8), rt(2)) self.log_details_label = QtWidgets.QTextBrowser(self.log_details) self.log_details_label.setSizePolicy( BQSizePolicy(height=QtWidgets.QSizePolicy.Expanding)) self.log_details_layout.addWidget(self.log_details_label) self.splitter.setSizes([rt(300), rt(20)]) self.vertical_layout_3.addWidget(self.splitter) self.vertical_layout.addWidget(self.log_widget) self.retranslateUi()
def __init__(self, dialog) -> None: super().__init__() height = system_service.getRefHeight() / 2.6 width = height * 2 dialog.resize(width, height) dialog.setSizePolicy(BQSizePolicy(h_stretch=1)) dialog.setMinimumSize(QSize(width, height)) dialog.setMinimumSize(QSize(width, height)) dialog.setSizeGripEnabled(False) dialog.setModal(False) self.horizontal_layout = QtWidgets.QHBoxLayout(dialog) self.horizontal_layout.setContentsMargins(11, 11, 11, 11) self.horizontal_layout.setSpacing(6) self.left_widget = QtWidgets.QWidget(dialog) self.left_widget.setSizePolicy(BQSizePolicy(h_stretch=1)) self.vertical_layout_2 = QtWidgets.QVBoxLayout(self.left_widget) self.vertical_layout_2.setContentsMargins(11, 11, 11, 11) self.vertical_layout_2.setSpacing(6) self.app_image_widget = QtWidgets.QWidget(self.left_widget) self.app_image_widget.setSizePolicy(BQSizePolicy(v_stretch=2)) self.vertical_layout_4 = QtWidgets.QVBoxLayout(self.app_image_widget) self.vertical_layout_4.setContentsMargins(0, 0, 0, 0) self.vertical_layout_4.setSpacing(6) self.avatar = QtWidgets.QLabel(self.app_image_widget) self.avatar.setText("") self.avatar.setAlignment(QtCore.Qt.AlignCenter) self.vertical_layout_4.addWidget(self.avatar) self.vertical_layout_2.addWidget(self.app_image_widget) self.app_info_widget = QtWidgets.QWidget(self.left_widget) self.app_info_widget.setSizePolicy(BQSizePolicy(v_stretch=1)) self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.app_info_widget) self.verticalLayout_3.setContentsMargins(0, 0, 0, 0) self.verticalLayout_3.setSpacing(6) self.boatswain = QtWidgets.QLabel(self.app_info_widget) font = QtGui.QFont() font.setPointSize(17) font.setWeight(50) self.boatswain.setFont(font) self.boatswain.setAlignment(QtCore.Qt.AlignCenter) self.verticalLayout_3.addWidget(self.boatswain) self.build = QtWidgets.QLabel(self.app_info_widget) self.build.setSizePolicy(BQSizePolicy(v_stretch=1)) self.build.setAlignment(QtCore.Qt.AlignCenter) self.verticalLayout_3.addWidget(self.build) self.license = QtWidgets.QPushButton(self.app_info_widget) self.verticalLayout_3.addWidget(self.license) self.vertical_layout_2.addWidget(self.app_info_widget) self.horizontal_layout.addWidget(self.left_widget) self.right_widget = QtWidgets.QWidget(dialog) self.right_widget.setSizePolicy(BQSizePolicy(h_stretch=2)) self.verticalLayout = QtWidgets.QVBoxLayout(self.right_widget) self.verticalLayout.setContentsMargins(11, 11, 11, 11) self.verticalLayout.setSpacing(6) self.scroll_area = QtWidgets.QScrollArea(self.right_widget) self.scroll_area.setSizePolicy(BQSizePolicy(v_stretch=20)) self.scroll_area.setFrameShape(QFrame.NoFrame) self.scroll_area.setFrameShadow(QFrame.Plain) self.scroll_area.setWidgetResizable(True) self.scroll_area.setContentsMargins(0, 0, 0, 0) self.verticalLayout.addWidget(self.scroll_area) self.acknowledge_widget = QtWidgets.QWidget(self.right_widget) self.acknowledge_widget.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.acknowledge_layout = QtWidgets.QHBoxLayout(self.acknowledge_widget) self.acknowledge_layout.setContentsMargins(0, 10, 0, 0) self.acknowledge_layout.setSpacing(0) self.acknowledge_layout.setAlignment(Qt.AlignTop) self.acknowledge_widget.setLayout(self.acknowledge_layout) self.acknowledge = QtWidgets.QLabel(self.right_widget) self.acknowledge.setSizePolicy(BQSizePolicy()) self.acknowledge.setTextFormat(Qt.RichText) self.acknowledge.setTextInteractionFlags(Qt.TextBrowserInteraction) self.acknowledge.setOpenExternalLinks(True) self.acknowledge_layout.addWidget(self.acknowledge) self.scroll_area.setWidget(self.acknowledge_widget) self.horizontal_layout.addWidget(self.right_widget) self.retranslateUi(dialog)
def __init__(self, dialog: QDialog, container: Container, handler) -> None: self.container = container self.handler = handler self.dialog = dialog width = 680 dialog.setFixedWidth(width) dialog.setSizePolicy(BQSizePolicy(h_stretch=1)) dialog.setMinimumWidth(width) dialog.setSizeGripEnabled(False) dialog.setModal(False) self.verticalLayout = QtWidgets.QVBoxLayout(dialog) self.verticalLayout.setContentsMargins(11, 11, 11, 11) self.verticalLayout.setSpacing(6) self.label = QtWidgets.QLabel(dialog) self.label.setWordWrap(True) self.verticalLayout.addWidget(self.label) self.line = QFrame(self.dialog) self.line.setFrameShape(QFrame.HLine) self.line.setFrameShadow(QFrame.Sunken) self.verticalLayout.addWidget(self.line) self.scroll_area = QScrollArea(dialog) self.scroll_area.setSizePolicy(BQSizePolicy(v_stretch=2)) self.scroll_area.setFrameShape(QFrame.NoFrame) self.scroll_area.setFrameShadow(QFrame.Plain) self.scroll_area.setWidgetResizable(True) self.scroll_area.setContentsMargins(0, 0, 0, 0) self.scroll_area.setMaximumHeight(200) self.app_list = QWidget(dialog) self.app_list.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.app_list_layout = QVBoxLayout(self.app_list) self.app_list_layout.setSpacing(0) self.app_list_layout.setAlignment(Qt.AlignTop) self.app_list_layout.setContentsMargins(0, rt(1), 0, 0) self.app_list.setLayout(self.app_list_layout) self.scroll_area.setWidget(self.app_list) self.verticalLayout.addWidget(self.scroll_area) self.line = QFrame(self.dialog) self.line.setFrameShape(QFrame.HLine) self.line.setFrameShadow(QFrame.Sunken) self.verticalLayout.addWidget(self.line) self.toolbox = QtWidgets.QWidget(dialog) self.horizontalLayout = QtWidgets.QHBoxLayout(self.toolbox) self.horizontalLayout.setContentsMargins(0, 0, 0, 0) self.horizontalLayout.setSpacing(6) self.cancel = QtWidgets.QPushButton(self.toolbox) self.horizontalLayout.addWidget(self.cancel) self.hidden = QtWidgets.QWidget(self.toolbox) self.hidden.setSizePolicy(BQSizePolicy(h_stretch=1)) self.horizontalLayout.addWidget(self.hidden) self.old_conf = QtWidgets.QPushButton(self.toolbox) self.horizontalLayout.addWidget(self.old_conf) self.merge = QtWidgets.QPushButton(self.toolbox) self.horizontalLayout.addWidget(self.merge) self.verticalLayout.addWidget(self.toolbox) self.retranslateUi()
def __init__(self, parent_widget, ui_handler) -> None: super().__init__(parent_widget) self.ui_handler = ui_handler self.setMinimumSize(QtCore.QSize(rt(SEARCH_APP_WIDTH), rt(136))) self.setMaximumHeight(rt(136)) self.setMaximumWidth(rt(SEARCH_APP_WIDTH)) self.central_layout = QtWidgets.QVBoxLayout(self) self.central_layout.setContentsMargins(0, 0, 0, 0) self.central_layout.setSpacing(0) self.central_widget = QWidget(self) self.central_layout.addWidget(self.central_widget) self.horizontal_layout = QtWidgets.QHBoxLayout(self.central_widget) self.horizontal_layout.setContentsMargins(0, 0, 0, 0) self.horizontal_layout.setSpacing(rt(10)) self.avatar_area = QtWidgets.QWidget(self) self.icon = QLabel(self.avatar_area) self.icon.setPixmap( QIcon(getResource('resources/icons/docker.svg')).pixmap( QSize(rt(32), rt(32)))) self.avatar_area.setStyleSheet('background: rgb(89, 173, 223)') self.avatar_layout = QtWidgets.QVBoxLayout(self.avatar_area) self.avatar_layout.setContentsMargins(rt(8), rt(5), rt(8), rt(5)) self.avatar_layout.addWidget(self.icon) self.avatar_layout.setAlignment(QtCore.Qt.AlignTop) self.horizontal_layout.addWidget(self.avatar_area) self.description_area = QtWidgets.QWidget(self) self.description_area.setSizePolicy(BQSizePolicy(h_stretch=1)) self.verticalLayout = QtWidgets.QVBoxLayout(self.description_area) self.verticalLayout.setContentsMargins(0, 0, 0, rt(6)) self.verticalLayout.setSpacing(rt(4)) self.name = QtWidgets.QLabel(self.description_area) font = QtGui.QFont() font.setPointSize(applyFontRatio(14)) font.setBold(True) font.setWeight(65) self.name.setFont(font) self.verticalLayout.addWidget(self.name) self.description = QtWidgets.QLabel(self.description_area) self.description.setSizePolicy(BQSizePolicy(v_stretch=2)) font = QtGui.QFont() font.setPointSize(applyFontRatio(12)) self.description.setFont(font) self.description.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) self.description.setWordWrap(True) self.verticalLayout.addWidget(self.description) self.tags_widget = QtWidgets.QWidget(self.description_area) self.horizontal_layout_3 = QtWidgets.QHBoxLayout(self.tags_widget) self.horizontal_layout_3.setSizeConstraint( QtWidgets.QLayout.SetFixedSize) self.horizontal_layout_3.setContentsMargins(0, 0, 0, 0) self.horizontal_layout_3.setSpacing(rt(6)) self.is_official = QtWidgets.QLabel(self.tags_widget) self.is_official.setFont(font) self.horizontal_layout_3.addWidget(self.is_official) self.from_repo = QtWidgets.QLabel(self.tags_widget) self.from_repo.setFont(font) self.horizontal_layout_3.addWidget(self.from_repo) self.verticalLayout.addWidget(self.tags_widget) self.line = QtWidgets.QFrame(self.description_area) self.line.setFrameShape(QtWidgets.QFrame.HLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.verticalLayout.addWidget(self.line) self.widget = QtWidgets.QWidget(self.description_area) self.horizontal_layout_2 = QtWidgets.QHBoxLayout(self.widget) self.horizontal_layout_2.setContentsMargins(0, 0, 0, 0) self.horizontal_layout_2.setSpacing(rt(6)) self.addition_widget = QtWidgets.QWidget(self.widget) self.addition_widget.setSizePolicy(BQSizePolicy(h_stretch=1)) self.horizontal_layout_4 = QtWidgets.QHBoxLayout(self.addition_widget) self.horizontal_layout_4.setContentsMargins(0, 0, 0, 0) self.horizontal_layout_4.setSpacing(rt(6)) self.stars = QtWidgets.QLabel(self.addition_widget) self.horizontal_layout_4.addWidget(self.stars) self.horizontal_layout_2.addWidget(self.addition_widget) self.install = QtWidgets.QPushButton(self.widget) self.install.setFlat(True) self.install.setStyleSheet('border: 1px solid green; padding: 1px 6px') self.horizontal_layout_2.addWidget(self.install) self.verticalLayout.addWidget(self.widget) self.horizontal_layout.addWidget(self.description_area) self.end_line = QtWidgets.QFrame(self) self.end_line.setFrameShape(QtWidgets.QFrame.HLine) self.end_line.setFrameShadow(QtWidgets.QFrame.Sunken) self.central_layout.addWidget(self.end_line)
def __init__(self, dialog: QDialog, container: Container) -> None: self.container = container self.dialog = dialog height = system_service.getRefHeight() / 2.2 width = height * 2 dialog.resize(width, height) dialog.setSizePolicy(BQSizePolicy(h_stretch=1)) dialog.setMinimumSize(QSize(width, height)) dialog.setSizeGripEnabled(False) dialog.setWindowModality(Qt.WindowModal) self.vertical_layout = QtWidgets.QVBoxLayout(dialog) self.vertical_layout.setContentsMargins(rt(11), rt(11), rt(11), rt(11)) self.vertical_layout.setSpacing(rt(6)) self.stacked_widget = QtWidgets.QStackedWidget(dialog) self.first_step = QtWidgets.QWidget() self.vertical_layout_2 = QtWidgets.QVBoxLayout(self.first_step) self.vertical_layout_2.setContentsMargins(0, 0, 0, 0) self.vertical_layout_2.setSpacing(rt(6)) self.tab_widget = QtWidgets.QTabWidget(self.first_step) self.tab = QtWidgets.QWidget() self.vertical_layout_3 = QtWidgets.QVBoxLayout(self.tab) self.vertical_layout_3.setContentsMargins(rt(11), rt(11), rt(11), rt(11)) self.vertical_layout_3.setSpacing(rt(6)) self.top_line = QtWidgets.QFrame(self.tab) self.top_line.setFrameShape(QtWidgets.QFrame.HLine) self.top_line.setFrameShadow(QtWidgets.QFrame.Sunken) self.vertical_layout_3.addWidget(self.top_line) self.main_widget = QtWidgets.QWidget(self.tab) self.main_widget.setSizePolicy(BQSizePolicy(v_stretch=1)) self.grid_layout = QtWidgets.QGridLayout(self.main_widget) self.grid_layout.setContentsMargins(rt(11), rt(11), rt(11), rt(11)) self.grid_layout.setHorizontalSpacing(rt(6)) self.grid_layout.setVerticalSpacing(0) self.label = QtWidgets.QLabel(self.main_widget) self.label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.grid_layout.addWidget(self.label, 2, 0, 1, 1) self.label_des = QtWidgets.QLabel(self.main_widget) font = QtGui.QFont() font.setPointSize(applyFontRatio(11)) self.label_des.setFont(font) self.label_des.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) self.label_des.setWordWrap(True) self.label_des.setIndent(rt(2)) self.grid_layout.addWidget(self.label_des, 3, 1, 1, 2) self.type_label = QtWidgets.QLabel(self.main_widget) self.type_label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.grid_layout.addWidget(self.type_label, 4, 0, 1, 1) self.hidden = QtWidgets.QWidget(self.main_widget) self.hidden.setSizePolicy(BQSizePolicy(h_stretch=2)) self.grid_layout.addWidget(self.hidden, 0, 2, 1, 1) self.shortcut_for_label = QtWidgets.QLabel(self.main_widget) self.shortcut_for_label.setSizePolicy(BQSizePolicy(h_stretch=2)) self.shortcut_for_label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.grid_layout.addWidget(self.shortcut_for_label, 0, 0, 1, 1) self.shortcut_label = QtWidgets.QLineEdit(self.main_widget) self.shortcut_label.setAttribute(Qt.WA_MacShowFocusRect, 0) self.shortcut_label.setStyleSheet("padding: 2 2 2 5;") self.grid_layout.addWidget(self.shortcut_label, 2, 1, 1, 1) self.shortcut_for_des = QtWidgets.QLabel(self.main_widget) self.shortcut_for_des.setSizePolicy(BQSizePolicy()) self.shortcut_for_des.setFont(font) self.shortcut_for_des.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) self.shortcut_for_des.setWordWrap(True) self.shortcut_for_des.setIndent(2) self.grid_layout.addWidget(self.shortcut_for_des, 1, 1, 1, 2) self.container_name = QtWidgets.QComboBox(self.main_widget) self.container_name.setSizePolicy( BQSizePolicy(h_stretch=2, height=QSizePolicy.Fixed)) self.grid_layout.addWidget(self.container_name, 0, 1, 1, 1) self.data_type_label = QtWidgets.QLabel(self.main_widget) self.data_type_label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.grid_layout.addWidget(self.data_type_label, 5, 0, 1, 1) self.shortcut_type = QtWidgets.QComboBox(self.main_widget) self.grid_layout.addWidget(self.shortcut_type, 4, 1, 1, 1) self.data_type = QtWidgets.QComboBox(self.main_widget) self.grid_layout.addWidget(self.data_type, 5, 1, 1, 1) self.data_type_des = QtWidgets.QLabel(self.main_widget) self.data_type_des.setFont(font) self.data_type_des.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) self.data_type_des.setWordWrap(True) self.data_type_des.setIndent(2) self.grid_layout.addWidget(self.data_type_des, 6, 1, 1, 2) self.vertical_layout_3.addWidget(self.main_widget) self.bot_line = QtWidgets.QFrame(self.tab) self.bot_line.setFrameShape(QtWidgets.QFrame.HLine) self.bot_line.setFrameShadow(QtWidgets.QFrame.Sunken) self.vertical_layout_3.addWidget(self.bot_line) self.widget_2 = QtWidgets.QWidget(self.tab) self.horizontal_layout = QtWidgets.QHBoxLayout(self.widget_2) self.horizontal_layout.setContentsMargins(0, 0, 0, 0) self.horizontal_layout.setSpacing(rt(6)) self.hidden_2 = QtWidgets.QWidget(self.widget_2) self.hidden_2.setSizePolicy(BQSizePolicy(h_stretch=1)) self.horizontal_layout.addWidget(self.hidden_2) self.cancel_button = QtWidgets.QPushButton(self.widget_2) self.horizontal_layout.addWidget(self.cancel_button) self.next_button = QtWidgets.QPushButton(self.widget_2) self.horizontal_layout.addWidget(self.next_button) self.vertical_layout_3.addWidget(self.widget_2) self.tab_widget.addTab(self.tab, "") self.vertical_layout_2.addWidget(self.tab_widget) self.stacked_widget.addWidget(self.first_step) self.second_step = QtWidgets.QWidget() self.vertical_layout_4 = QtWidgets.QVBoxLayout(self.second_step) self.vertical_layout_4.setContentsMargins(0, 0, 0, 0) self.vertical_layout_4.setSpacing(rt(6)) self.tab_widget_2 = QtWidgets.QTabWidget(self.second_step) self.tab_3 = QtWidgets.QWidget() self.vertical_layout_5 = QtWidgets.QVBoxLayout(self.tab_3) self.vertical_layout_5.setContentsMargins(rt(11), rt(11), rt(11), rt(11)) self.vertical_layout_5.setSpacing(rt(6)) self.line_2 = QtWidgets.QFrame(self.tab_3) self.line_2.setFrameShape(QtWidgets.QFrame.HLine) self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken) self.vertical_layout_5.addWidget(self.line_2) self.widget = QtWidgets.QWidget(self.tab_3) self.widget.setSizePolicy(BQSizePolicy(v_stretch=1)) self.grid_layout_2 = QtWidgets.QGridLayout(self.widget) self.grid_layout_2.setContentsMargins(rt(11), rt(11), rt(11), rt(11)) self.grid_layout_2.setHorizontalSpacing(rt(6)) self.grid_layout_2.setVerticalSpacing(rt(5)) self.mapping_to = QtWidgets.QLineEdit(self.widget) self.mapping_to.setAttribute(Qt.WA_MacShowFocusRect, 0) self.grid_layout_2.addWidget(self.mapping_to, 2, 1, 1, 1) self.description = QtWidgets.QTextEdit(self.widget) self.description.setAttribute(Qt.WA_MacShowFocusRect, 0) self.grid_layout_2.addWidget(self.description, 4, 1, 1, 2) self.default_value = ButtonLineEdit( getResource('resources/icons/folder.svg'), self.widget) self.default_value.setSizePolicy( BQSizePolicy(h_stretch=2, width=QSizePolicy.Expanding, height=QSizePolicy.Fixed)) self.grid_layout_2.addWidget(self.default_value, 0, 1, 1, 1) self.mapping_to_label = QtWidgets.QLabel(self.widget) self.mapping_to_label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.grid_layout_2.addWidget(self.mapping_to_label, 2, 0, 1, 1) self.description_label = QtWidgets.QLabel(self.widget) self.description_label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.grid_layout_2.addWidget(self.description_label, 4, 0, 1, 1) self.default_value_label = QtWidgets.QLabel(self.widget) self.default_value_label.setSizePolicy(BQSizePolicy(h_stretch=2)) self.default_value_label.setAlignment(QtCore.Qt.AlignRight | QtCore.Qt.AlignTrailing | QtCore.Qt.AlignVCenter) self.grid_layout_2.addWidget(self.default_value_label, 0, 0, 1, 1) self.hidden_3 = QtWidgets.QWidget(self.widget) self.hidden_3.setSizePolicy(BQSizePolicy(h_stretch=2)) self.grid_layout_2.addWidget(self.hidden_3, 0, 2, 1, 1) self.default_value_des = QtWidgets.QLabel(self.widget) self.default_value_des.setFont(font) self.default_value_des.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) self.default_value_des.setWordWrap(True) self.grid_layout_2.addWidget(self.default_value_des, 1, 1, 1, 2) self.mapping_to_des = QtWidgets.QLabel(self.widget) self.mapping_to_des.setFont(font) self.mapping_to_des.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop) self.grid_layout_2.addWidget(self.mapping_to_des, 3, 1, 1, 2) self.vertical_layout_5.addWidget(self.widget) self.line = QtWidgets.QFrame(self.tab_3) self.line.setFrameShape(QtWidgets.QFrame.HLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.vertical_layout_5.addWidget(self.line) self.bot_widget = QtWidgets.QWidget(self.tab_3) self.horizontal_layout_2 = QtWidgets.QHBoxLayout(self.bot_widget) self.horizontal_layout_2.setContentsMargins(0, 0, 0, 0) self.horizontal_layout_2.setSpacing(rt(6)) self.widget_4 = QtWidgets.QWidget(self.bot_widget) self.widget_4.setSizePolicy(BQSizePolicy(h_stretch=1)) self.horizontal_layout_2.addWidget(self.widget_4) self.back_button = QtWidgets.QPushButton(self.bot_widget) self.horizontal_layout_2.addWidget(self.back_button) self.cancel_button_2 = QtWidgets.QPushButton(self.bot_widget) self.horizontal_layout_2.addWidget(self.cancel_button_2) self.finish_button = QtWidgets.QPushButton(self.bot_widget) self.horizontal_layout_2.addWidget(self.finish_button) self.vertical_layout_5.addWidget(self.bot_widget) self.tab_widget_2.addTab(self.tab_3, "") self.vertical_layout_4.addWidget(self.tab_widget_2) self.stacked_widget.addWidget(self.second_step) self.vertical_layout.addWidget(self.stacked_widget) self.stacked_widget.setCurrentIndex(0) self.tab_widget.setCurrentIndex(0) self.default_value.button.setVisible(False)
def __init__(self): super(HomeUi, self).__init__() self.setSizePolicy(BQSizePolicy(h_stretch=1)) central_widget = QWidget(self) central_widget.setSizePolicy(BQSizePolicy(h_stretch=1)) main_layout = QVBoxLayout(central_widget) main_layout.setContentsMargins(0, rt(6), 0, rt(11)) main_layout.setSpacing(0) widget = QWidget(central_widget) widget.setSizePolicy(BQSizePolicy(h_stretch=1)) widget.setAutoFillBackground(False) top_layout = QGridLayout(widget) top_layout.setContentsMargins(rt(11), 0, rt(4), rt(6)) top_layout.setSpacing(rt(6)) self.add_app = QPushButton(widget) padding = "%dpx %dpx" % (rt(1), rt(12)) self.add_app.setStyleSheet( "border: 1px solid #999999; padding: %s; border-radius: 2px" % padding) self.add_app.setSizePolicy( BQSizePolicy(width=QSizePolicy.Fixed, height=QSizePolicy.Fixed)) self.add_app.setFocusPolicy(Qt.ClickFocus) top_layout.addWidget(self.add_app, 0, 0, 1, 1) self.workspaces = SelectUi(widget) self.workspaces.setSizePolicy( BQSizePolicy(h_stretch=1, width=QSizePolicy.Fixed, height=QSizePolicy.Fixed)) self.workspaces.setFocusPolicy(Qt.ClickFocus) top_layout.addWidget(self.workspaces, 0, 2, 1, 1) self.search_app = QLineEdit(widget) self.search_app.setAttribute(Qt.WA_MacShowFocusRect, 0) self.search_app.setSizePolicy( BQSizePolicy(h_stretch=2, height=QSizePolicy.Fixed)) self.search_app.setFocusPolicy(Qt.ClickFocus) self.search_app.setStyleSheet("padding: 1 1 1 5;") top_layout.addWidget(self.search_app, 0, 3, 1, 1) self.custom_menu = QPushButton(widget) self.custom_menu.setText("⋮") self.custom_menu.setStyleSheet("border: none; padding: 1px 2px;") font = QFont() font.setPointSize(applyFontRatio(16)) self.custom_menu.setFont(font) top_layout.addWidget(self.custom_menu, 0, 4, 1, 1) hidden_widget = QWidget(widget) hidden_widget.setSizePolicy(BQSizePolicy()) top_layout.addWidget(hidden_widget, 0, 1, 1, 1) main_layout.addWidget(widget) line = QFrame(self) line.setFrameShape(QFrame.HLine) line.setFrameShadow(QFrame.Sunken) main_layout.addWidget(line) self.scroll_area = QScrollArea(central_widget) self.scroll_area.setSizePolicy(BQSizePolicy(v_stretch=2)) self.scroll_area.setFrameShape(QFrame.NoFrame) self.scroll_area.setFrameShadow(QFrame.Plain) self.scroll_area.setWidgetResizable(True) self.scroll_area.setContentsMargins(0, 0, 0, 0) main_layout.addWidget(self.scroll_area) self.setCentralWidget(central_widget) self.menu_bar = QMenuBar(self) self.menu_file = QMenu(self.menu_bar) self.setMenuBar(self.menu_bar) self.status_bar = QStatusBar(self) self.setStatusBar(self.status_bar) self.retranslateUi(self) self.app_list = QWidget(self) self.app_list.setSizePolicy(QSizePolicy.MinimumExpanding, QSizePolicy.MinimumExpanding) self.app_list_layout = QVBoxLayout(self.app_list) self.app_list_layout.setSpacing(0) self.app_list_layout.setAlignment(Qt.AlignTop) self.app_list_layout.setContentsMargins(0, rt(1), 0, 0) self.app_list.setLayout(self.app_list_layout) self.scroll_area.setWidget(self.app_list)
def __init__(self, parent, container: Container, handler) -> None: super().__init__(parent) self.container = container self.handler = handler self.vertical_layout_2 = QVBoxLayout(self) self.vertical_layout_2.setContentsMargins(rt(20), rt(11), rt(20), rt(11)) self.vertical_layout_2.setSpacing(rt(6)) self.widget = QWidget(self) self.widget.setSizePolicy(BQSizePolicy(v_stretch=1)) self.horizontal_layout_2 = QHBoxLayout(self.widget) self.horizontal_layout_2.setContentsMargins(0, 0, 0, 0) self.horizontal_layout_2.setSpacing(rt(6)) self._translate = QCoreApplication.translate self.pic = AppAvatar(container, parent=self, radius=rt(20)) self.horizontal_layout_2.addWidget(self.pic) self.container_name = QLineEdit(self.widget) # Remove the border outline on focus self.container_name.setAttribute(Qt.WA_MacShowFocusRect, 0) self.container_name.setStyleSheet( 'border: none; background-color: transparent') self.container_name.setFocusPolicy(Qt.StrongFocus) self.container_name.setFocus() self.horizontal_layout_2.addWidget(self.container_name) self.widget_5 = QWidget(self.widget) self.widget_5.setSizePolicy(BQSizePolicy(h_stretch=1)) self.horizontal_layout_2.addWidget(self.widget_5) self.vertical_layout_2.addWidget(self.widget) self.line_3 = QFrame(self) self.line_3.setFrameShape(QFrame.HLine) self.line_3.setFrameShadow(QFrame.Sunken) self.vertical_layout_2.addWidget(self.line_3) self.widget_3 = QWidget(self) self.widget_3.setSizePolicy(BQSizePolicy(v_stretch=1)) self.vertical_layout_4 = QVBoxLayout(self.widget_3) self.vertical_layout_4.setContentsMargins(0, 0, 0, 0) self.vertical_layout_4.setSpacing(rt(6)) self.repo_source = QLabel(self.widget_3) self.vertical_layout_4.addWidget(self.repo_source) self.container_id = QLabel(self.widget_3) self.vertical_layout_4.addWidget(self.container_id) self.vertical_layout_2.addWidget(self.widget_3) self.line = QFrame(self) self.line.setFrameShape(QFrame.HLine) self.line.setFrameShadow(QFrame.Sunken) self.vertical_layout_2.addWidget(self.line) self.widget_4 = QWidget(self) self.widget_4.setSizePolicy(BQSizePolicy(v_stretch=2)) self.grid_layout = QGridLayout(self.widget_4) self.grid_layout.setContentsMargins(0, 0, 0, rt(5)) self.grid_layout.setSpacing(rt(6)) self.sync = QPushButton(self.widget_4) self.sync.setFocusPolicy(Qt.NoFocus) self.grid_layout.addWidget(self.sync, 2, 4, 1, 1) self.widget_8 = QWidget(self.widget_4) self.widget_8.setSizePolicy(BQSizePolicy(h_stretch=1)) self.grid_layout.addWidget(self.widget_8, 2, 5, 1, 1) self.img_tag_label = QLabel(self.widget_4) self.grid_layout.addWidget(self.img_tag_label, 2, 0, 1, 1) self.current_n_memory = QLabel(self.widget_4) self.grid_layout.addWidget(self.current_n_memory, 3, 4, 1, 1) self.current_n_cpus = QLabel(self.widget_4) self.grid_layout.addWidget(self.current_n_cpus, 4, 4, 1, 1) self.widget_7 = QWidget(self.widget_4) self.widget_7.setSizePolicy(BQSizePolicy(h_stretch=1)) self.grid_layout.addWidget(self.widget_7, 3, 3, 1, 1) self.limit_cpu_label = QLabel(self.widget_4) self.grid_layout.addWidget(self.limit_cpu_label, 4, 0, 1, 1) self.entrypoint_label = QLabel(self.widget_4) self.grid_layout.addWidget(self.entrypoint_label, 5, 0, 1, 1) self.image_tags = QComboBox(self.widget_4) self.image_tags.setMinimumWidth(rt(300)) self.grid_layout.addWidget(self.image_tags, 2, 1, 1, 3) self.limit_memory_label = QLabel(self.widget_4) self.grid_layout.addWidget(self.limit_memory_label, 3, 0, 1, 1) self.limit_memory = QSlider(Qt.Horizontal) # self.limit_memory.setSizePolicy(BQSizePolicy(h_stretch=3)) self.grid_layout.addWidget(self.limit_memory, 3, 1, 1, 3) self.limit_cpu = QSlider(Qt.Horizontal) self.grid_layout.addWidget(self.limit_cpu, 4, 1, 1, 3) self.entrypoint = QLineEdit(self.widget_4) self.entrypoint.setAttribute(Qt.WA_MacShowFocusRect, 0) self.entrypoint.setFocusPolicy(Qt.ClickFocus) self.grid_layout.addWidget(self.entrypoint, 5, 1, 1, 5) self.vertical_layout_2.addWidget(self.widget_4) self.line_2 = QFrame(self) self.line_2.setFrameShape(QFrame.HLine) self.line_2.setFrameShadow(QFrame.Sunken) self.vertical_layout_2.addWidget(self.line_2) self.widget_2 = QWidget(self) self.widget_2.setSizePolicy(BQSizePolicy(v_stretch=1)) self.vertical_layout_3 = QVBoxLayout(self.widget_2) self.vertical_layout_3.setContentsMargins(0, 0, 0, 0) self.vertical_layout_3.setSpacing(rt(6)) self.start_with_boatswain = QCheckBox(self.widget_2) self.vertical_layout_3.addWidget(self.start_with_boatswain) self.stop_with_boatswain = QCheckBox(self.widget_2) self.vertical_layout_3.addWidget(self.stop_with_boatswain) self.vertical_layout_2.addWidget(self.widget_2) self.container_id.setTextInteractionFlags(Qt.TextSelectableByMouse)