def paintEvent(self, event): painter = QPainter(self) painter.setRenderHint(QPainter.Antialiasing) center = QPointF(self.width() / 2, self.height() / 2) radius = self.radius() ellipse_line_width = self.radius() * 60 / 512 # big ellipse pen = QPen() pen.setWidth(ellipse_line_width) pen.setColor(self.color) painter.setPen(pen) painter.drawEllipse(center, radius - pen.width() / 2, radius - pen.width() / 2) # dots pen = QPen() pen.setColor(QColor(0, 0, 0, 0)) painter.setPen(pen) brush = QBrush() brush.setStyle(Qt.SolidPattern) dot_size = radius * 200 / 1024 color = copy.copy(self.color) self._change_color(painter, brush, color, 0) painter.drawEllipse( QPointF((self.width() - radius - ellipse_line_width / 2) / 2, self.height() / 2), dot_size, dot_size) self._change_color(painter, brush, color, 15) painter.drawEllipse(center, dot_size, dot_size) self._change_color(painter, brush, color, 30) painter.drawEllipse( QPointF((self.width() + radius + ellipse_line_width / 2) / 2, self.height() / 2), dot_size, dot_size)
def particle_brush(self, index: int): brush = QBrush() brush.setStyle(Qt.SolidPattern) colors = self.settings.list_value(default_settings.particle_color) colors = [QColor(c) for c in colors] brush.setColor(colors[index % len(colors)]) return brush
def mark_brush(self, index: int): if self.settings.boolean_value( default_settings.same_mark_color_with_particle): return self.particle_brush(index) else: brush = QBrush() colors = self.settings.list_value(default_settings.mark_color) colors = [QColor(c) for c in colors] brush.setStyle(Qt.SolidPattern) brush.setColor(colors[index % len(colors)]) return brush
def setupUi(self, MainWindow): if not MainWindow.objectName(): MainWindow.setObjectName(u"MainWindow") MainWindow.resize(400, 300) MainWindow.setWindowTitle(u"\u0421\u0442\u0435\u0433\u0430\u043d\u043e\u0433\u0440\u0430\u0444\u0438\u044f") MainWindow.setStyleSheet(u "QMainWindow {\n" "background-color: #f8f9fa;\n" "}\n" "QPushButton:hover {\n" "color: rgb(70, 126, 163);\n" "font: bold 11pt;\n" "}\n" "QPushButton {\n" "color: white;\n" "border:1px solid rgb(82, 108, 125);\n" "border-radius: 6px;\n" "background-color: rgb(82, 108, 125)\n"; "}") self.centralwidget = QWidget(MainWindow) self.centralwidget.setObjectName(u"centralwidget") self.verticalLayout = QVBoxLayout(self.centralwidget) self.verticalLayout.setObjectName(u"verticalLayout") self.horizontalLayout = QHBoxLayout() self.horizontalLayout.setObjectName(u"horizontalLayout") self.load_button = QPushButton(self.centralwidget) self.load_button.setObjectName(u"load_button") font = QFont() font.setPointSize(9) self.load_button.setFont(font) self.load_button.setStyleSheet(u"") self.load_button.setText(u"\u0417\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435") self.horizontalLayout.addWidget(self.load_button) self.save_button = QPushButton(self.centralwidget) self.save_button.setObjectName(u"save_button") self.save_button.setFont(font) self.save_button.setStyleSheet(u"") self.save_button.setText(u"\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435") self.horizontalLayout.addWidget(self.save_button) self.verticalLayout.addLayout(self.horizontalLayout) self.message_frame = QTextEdit(self.centralwidget) self.message_frame.setObjectName(u"message_frame") sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(1) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.message_frame.sizePolicy().hasHeightForWidth()) self.message_frame.setSizePolicy(sizePolicy) font.setPointSize(10) self.message_frame.setFont(font) font.setPointSize(9) self.message_frame.setStyleSheet(u"") self.message_frame.setFrameShape(QFrame.StyledPanel) self.message_frame.setMarkdown(u"") self.message_frame.setHtml(u"") self.message_frame.setPlaceholderText(u"\u0412\u0432\u0435\u0434\u0438\u0442\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435") self.verticalLayout.addWidget(self.message_frame) self.output_label = QLabel(self.centralwidget) self.output_label.setObjectName(u"output_label") sizePolicy1 = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy1.setHorizontalStretch(1) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth(self.output_label.sizePolicy().hasHeightForWidth()) self.output_label.setSizePolicy(sizePolicy1) font1 = QFont() self.output_label.setFont(font1) self.output_label.setText(u"") self.output_label.setScaledContents(False) self.output_label.setAlignment(Qt.AlignLeading|Qt.AlignLeft|Qt.AlignTop) self.output_label.setWordWrap(True) self.verticalLayout.addWidget(self.output_label) self.horizontalLayout_2 = QHBoxLayout() self.horizontalLayout_2.setObjectName(u"horizontalLayout_2") self.decode_button = QPushButton(self.centralwidget) self.decode_button.setObjectName(u"decode_button") palette = QPalette() brush = QBrush(QColor(255, 255, 255, 255)) brush.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.WindowText, brush) brush1 = QBrush(QColor(13, 110, 253, 255)) brush1.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Button, brush1) palette.setBrush(QPalette.Active, QPalette.Text, brush) palette.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette.setBrush(QPalette.Active, QPalette.Base, brush1) palette.setBrush(QPalette.Active, QPalette.Window, brush1) palette.setBrush(QPalette.Active, QPalette.PlaceholderText, brush) palette.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette.setBrush(QPalette.Inactive, QPalette.Button, brush1) palette.setBrush(QPalette.Inactive, QPalette.Text, brush) palette.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette.setBrush(QPalette.Inactive, QPalette.Base, brush1) palette.setBrush(QPalette.Inactive, QPalette.Window, brush1) palette.setBrush(QPalette.Inactive, QPalette.PlaceholderText, brush) palette.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette.setBrush(QPalette.Disabled, QPalette.Button, brush1) palette.setBrush(QPalette.Disabled, QPalette.Text, brush) palette.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette.setBrush(QPalette.Disabled, QPalette.Base, brush1) palette.setBrush(QPalette.Disabled, QPalette.Window, brush1) palette.setBrush(QPalette.Disabled, QPalette.PlaceholderText, brush) self.decode_button.setPalette(palette) self.decode_button.setFont(font) self.decode_button.setStyleSheet(u"") self.decode_button.setText(u"\u0414\u0435\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442") self.horizontalLayout_2.addWidget(self.decode_button) self.encode_button = QPushButton(self.centralwidget) self.encode_button.setObjectName(u"encode_button") self.encode_button.setFont(font) self.encode_button.setStyleSheet(u"") self.encode_button.setText(u"\u0417\u0430\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043a\u0441\u0442") self.horizontalLayout_2.addWidget(self.encode_button) self.verticalLayout.addLayout(self.horizontalLayout_2) MainWindow.setCentralWidget(self.centralwidget) QWidget.setTabOrder(self.load_button, self.save_button) QWidget.setTabOrder(self.save_button, self.encode_button) QWidget.setTabOrder(self.encode_button, self.decode_button) self.retranslateUi(MainWindow) QMetaObject.connectSlotsByName(MainWindow)
def setupUi(self, Config): if not Config.objectName(): Config.setObjectName(u"Config") Config.resize(600, 650) Config.setSizeGripEnabled(True) self.vboxLayout = QVBoxLayout(Config) self.vboxLayout.setSpacing(6) self.vboxLayout.setContentsMargins(11, 11, 11, 11) self.vboxLayout.setObjectName(u"vboxLayout") self.vboxLayout.setContentsMargins(8, 8, 8, 8) self.hboxLayout = QHBoxLayout() self.hboxLayout.setSpacing(6) self.hboxLayout.setObjectName(u"hboxLayout") self.hboxLayout.setContentsMargins(0, 0, 0, 0) self.ButtonGroup1 = QGroupBox(Config) self.ButtonGroup1.setObjectName(u"ButtonGroup1") sizePolicy = QSizePolicy(QSizePolicy.Preferred, QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth( self.ButtonGroup1.sizePolicy().hasHeightForWidth()) self.ButtonGroup1.setSizePolicy(sizePolicy) self.vboxLayout1 = QVBoxLayout(self.ButtonGroup1) self.vboxLayout1.setSpacing(6) self.vboxLayout1.setContentsMargins(11, 11, 11, 11) self.vboxLayout1.setObjectName(u"vboxLayout1") self.vboxLayout1.setContentsMargins(11, 11, 11, 11) self.size_176_220 = QRadioButton(self.ButtonGroup1) self.size_176_220.setObjectName(u"size_176_220") self.vboxLayout1.addWidget(self.size_176_220) self.size_240_320 = QRadioButton(self.ButtonGroup1) self.size_240_320.setObjectName(u"size_240_320") self.vboxLayout1.addWidget(self.size_240_320) self.size_320_240 = QRadioButton(self.ButtonGroup1) self.size_320_240.setObjectName(u"size_320_240") self.vboxLayout1.addWidget(self.size_320_240) self.size_640_480 = QRadioButton(self.ButtonGroup1) self.size_640_480.setObjectName(u"size_640_480") self.vboxLayout1.addWidget(self.size_640_480) self.size_800_600 = QRadioButton(self.ButtonGroup1) self.size_800_600.setObjectName(u"size_800_600") self.vboxLayout1.addWidget(self.size_800_600) self.size_1024_768 = QRadioButton(self.ButtonGroup1) self.size_1024_768.setObjectName(u"size_1024_768") self.vboxLayout1.addWidget(self.size_1024_768) self.hboxLayout1 = QHBoxLayout() self.hboxLayout1.setSpacing(6) self.hboxLayout1.setObjectName(u"hboxLayout1") self.hboxLayout1.setContentsMargins(0, 0, 0, 0) self.size_custom = QRadioButton(self.ButtonGroup1) self.size_custom.setObjectName(u"size_custom") sizePolicy1 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) sizePolicy1.setHorizontalStretch(0) sizePolicy1.setVerticalStretch(0) sizePolicy1.setHeightForWidth( self.size_custom.sizePolicy().hasHeightForWidth()) self.size_custom.setSizePolicy(sizePolicy1) self.hboxLayout1.addWidget(self.size_custom) self.size_width = QSpinBox(self.ButtonGroup1) self.size_width.setObjectName(u"size_width") self.size_width.setMinimum(1) self.size_width.setMaximum(1280) self.size_width.setSingleStep(16) self.size_width.setValue(400) self.hboxLayout1.addWidget(self.size_width) self.size_height = QSpinBox(self.ButtonGroup1) self.size_height.setObjectName(u"size_height") self.size_height.setMinimum(1) self.size_height.setMaximum(1024) self.size_height.setSingleStep(16) self.size_height.setValue(300) self.hboxLayout1.addWidget(self.size_height) self.vboxLayout1.addLayout(self.hboxLayout1) self.hboxLayout.addWidget(self.ButtonGroup1) self.ButtonGroup2 = QGroupBox(Config) self.ButtonGroup2.setObjectName(u"ButtonGroup2") self.vboxLayout2 = QVBoxLayout(self.ButtonGroup2) self.vboxLayout2.setSpacing(6) self.vboxLayout2.setContentsMargins(11, 11, 11, 11) self.vboxLayout2.setObjectName(u"vboxLayout2") self.vboxLayout2.setContentsMargins(11, 11, 11, 11) self.depth_1 = QRadioButton(self.ButtonGroup2) self.depth_1.setObjectName(u"depth_1") self.vboxLayout2.addWidget(self.depth_1) self.depth_4gray = QRadioButton(self.ButtonGroup2) self.depth_4gray.setObjectName(u"depth_4gray") self.vboxLayout2.addWidget(self.depth_4gray) self.depth_8 = QRadioButton(self.ButtonGroup2) self.depth_8.setObjectName(u"depth_8") self.vboxLayout2.addWidget(self.depth_8) self.depth_12 = QRadioButton(self.ButtonGroup2) self.depth_12.setObjectName(u"depth_12") self.vboxLayout2.addWidget(self.depth_12) self.depth_15 = QRadioButton(self.ButtonGroup2) self.depth_15.setObjectName(u"depth_15") self.vboxLayout2.addWidget(self.depth_15) self.depth_16 = QRadioButton(self.ButtonGroup2) self.depth_16.setObjectName(u"depth_16") self.vboxLayout2.addWidget(self.depth_16) self.depth_18 = QRadioButton(self.ButtonGroup2) self.depth_18.setObjectName(u"depth_18") self.vboxLayout2.addWidget(self.depth_18) self.depth_24 = QRadioButton(self.ButtonGroup2) self.depth_24.setObjectName(u"depth_24") self.vboxLayout2.addWidget(self.depth_24) self.depth_32 = QRadioButton(self.ButtonGroup2) self.depth_32.setObjectName(u"depth_32") self.vboxLayout2.addWidget(self.depth_32) self.depth_32_argb = QRadioButton(self.ButtonGroup2) self.depth_32_argb.setObjectName(u"depth_32_argb") self.vboxLayout2.addWidget(self.depth_32_argb) self.hboxLayout.addWidget(self.ButtonGroup2) self.vboxLayout.addLayout(self.hboxLayout) self.hboxLayout2 = QHBoxLayout() self.hboxLayout2.setSpacing(6) self.hboxLayout2.setObjectName(u"hboxLayout2") self.hboxLayout2.setContentsMargins(0, 0, 0, 0) self.TextLabel1_3 = QLabel(Config) self.TextLabel1_3.setObjectName(u"TextLabel1_3") self.hboxLayout2.addWidget(self.TextLabel1_3) self.skin = QComboBox(Config) self.skin.addItem("") self.skin.setObjectName(u"skin") sizePolicy2 = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Fixed) sizePolicy2.setHorizontalStretch(0) sizePolicy2.setVerticalStretch(0) sizePolicy2.setHeightForWidth( self.skin.sizePolicy().hasHeightForWidth()) self.skin.setSizePolicy(sizePolicy2) self.hboxLayout2.addWidget(self.skin) self.vboxLayout.addLayout(self.hboxLayout2) self.touchScreen = QCheckBox(Config) self.touchScreen.setObjectName(u"touchScreen") self.vboxLayout.addWidget(self.touchScreen) self.lcdScreen = QCheckBox(Config) self.lcdScreen.setObjectName(u"lcdScreen") self.vboxLayout.addWidget(self.lcdScreen) self.spacerItem = QSpacerItem(20, 10, QSizePolicy.Minimum, QSizePolicy.Expanding) self.vboxLayout.addItem(self.spacerItem) self.TextLabel1 = QLabel(Config) self.TextLabel1.setObjectName(u"TextLabel1") sizePolicy.setHeightForWidth( self.TextLabel1.sizePolicy().hasHeightForWidth()) self.TextLabel1.setSizePolicy(sizePolicy) self.TextLabel1.setWordWrap(True) self.vboxLayout.addWidget(self.TextLabel1) self.GroupBox1 = QGroupBox(Config) self.GroupBox1.setObjectName(u"GroupBox1") self.gridLayout = QGridLayout(self.GroupBox1) self.gridLayout.setSpacing(6) self.gridLayout.setContentsMargins(11, 11, 11, 11) self.gridLayout.setObjectName(u"gridLayout") self.gridLayout.setHorizontalSpacing(6) self.gridLayout.setVerticalSpacing(6) self.gridLayout.setContentsMargins(11, 11, 11, 11) self.TextLabel3 = QLabel(self.GroupBox1) self.TextLabel3.setObjectName(u"TextLabel3") self.gridLayout.addWidget(self.TextLabel3, 6, 0, 1, 1) self.bslider = QSlider(self.GroupBox1) self.bslider.setObjectName(u"bslider") palette = QPalette() brush = QBrush(QColor(128, 128, 128, 255)) brush.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.WindowText, brush) brush1 = QBrush(QColor(0, 0, 255, 255)) brush1.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Button, brush1) brush2 = QBrush(QColor(127, 127, 255, 255)) brush2.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Light, brush2) brush3 = QBrush(QColor(38, 38, 255, 255)) brush3.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Midlight, brush3) brush4 = QBrush(QColor(0, 0, 127, 255)) brush4.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Dark, brush4) brush5 = QBrush(QColor(0, 0, 170, 255)) brush5.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Mid, brush5) brush6 = QBrush(QColor(0, 0, 0, 255)) brush6.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Text, brush6) brush7 = QBrush(QColor(255, 255, 255, 255)) brush7.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette.setBrush(QPalette.Active, QPalette.Base, brush7) brush8 = QBrush(QColor(220, 220, 220, 255)) brush8.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Window, brush8) palette.setBrush(QPalette.Active, QPalette.Shadow, brush6) brush9 = QBrush(QColor(10, 95, 137, 255)) brush9.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette.setBrush(QPalette.Active, QPalette.Link, brush6) palette.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) brush10 = QBrush(QColor(232, 232, 232, 255)) brush10.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette.setBrush(QPalette.Inactive, QPalette.Button, brush1) palette.setBrush(QPalette.Inactive, QPalette.Light, brush2) palette.setBrush(QPalette.Inactive, QPalette.Midlight, brush3) palette.setBrush(QPalette.Inactive, QPalette.Dark, brush4) palette.setBrush(QPalette.Inactive, QPalette.Mid, brush5) palette.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette.setBrush(QPalette.Disabled, QPalette.Button, brush1) palette.setBrush(QPalette.Disabled, QPalette.Light, brush2) palette.setBrush(QPalette.Disabled, QPalette.Midlight, brush3) palette.setBrush(QPalette.Disabled, QPalette.Dark, brush4) palette.setBrush(QPalette.Disabled, QPalette.Mid, brush5) palette.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.bslider.setPalette(palette) self.bslider.setMaximum(400) self.bslider.setValue(100) self.bslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.bslider, 6, 1, 1, 1) self.blabel = QLabel(self.GroupBox1) self.blabel.setObjectName(u"blabel") self.gridLayout.addWidget(self.blabel, 6, 2, 1, 1) self.TextLabel2 = QLabel(self.GroupBox1) self.TextLabel2.setObjectName(u"TextLabel2") self.gridLayout.addWidget(self.TextLabel2, 4, 0, 1, 1) self.gslider = QSlider(self.GroupBox1) self.gslider.setObjectName(u"gslider") palette1 = QPalette() palette1.setBrush(QPalette.Active, QPalette.WindowText, brush) brush11 = QBrush(QColor(0, 255, 0, 255)) brush11.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Button, brush11) brush12 = QBrush(QColor(127, 255, 127, 255)) brush12.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Light, brush12) brush13 = QBrush(QColor(38, 255, 38, 255)) brush13.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Midlight, brush13) brush14 = QBrush(QColor(0, 127, 0, 255)) brush14.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Dark, brush14) brush15 = QBrush(QColor(0, 170, 0, 255)) brush15.setStyle(Qt.SolidPattern) palette1.setBrush(QPalette.Active, QPalette.Mid, brush15) palette1.setBrush(QPalette.Active, QPalette.Text, brush6) palette1.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette1.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette1.setBrush(QPalette.Active, QPalette.Base, brush7) palette1.setBrush(QPalette.Active, QPalette.Window, brush8) palette1.setBrush(QPalette.Active, QPalette.Shadow, brush6) palette1.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette1.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette1.setBrush(QPalette.Active, QPalette.Link, brush6) palette1.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) palette1.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette1.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette1.setBrush(QPalette.Inactive, QPalette.Button, brush11) palette1.setBrush(QPalette.Inactive, QPalette.Light, brush12) palette1.setBrush(QPalette.Inactive, QPalette.Midlight, brush13) palette1.setBrush(QPalette.Inactive, QPalette.Dark, brush14) palette1.setBrush(QPalette.Inactive, QPalette.Mid, brush15) palette1.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette1.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette1.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette1.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette1.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette1.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette1.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette1.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette1.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette1.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette1.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette1.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette1.setBrush(QPalette.Disabled, QPalette.Button, brush11) palette1.setBrush(QPalette.Disabled, QPalette.Light, brush12) palette1.setBrush(QPalette.Disabled, QPalette.Midlight, brush13) palette1.setBrush(QPalette.Disabled, QPalette.Dark, brush14) palette1.setBrush(QPalette.Disabled, QPalette.Mid, brush15) palette1.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette1.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette1.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette1.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette1.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette1.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette1.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette1.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette1.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette1.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette1.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.gslider.setPalette(palette1) self.gslider.setMaximum(400) self.gslider.setValue(100) self.gslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.gslider, 4, 1, 1, 1) self.glabel = QLabel(self.GroupBox1) self.glabel.setObjectName(u"glabel") self.gridLayout.addWidget(self.glabel, 4, 2, 1, 1) self.TextLabel7 = QLabel(self.GroupBox1) self.TextLabel7.setObjectName(u"TextLabel7") self.gridLayout.addWidget(self.TextLabel7, 0, 0, 1, 1) self.TextLabel8 = QLabel(self.GroupBox1) self.TextLabel8.setObjectName(u"TextLabel8") self.gridLayout.addWidget(self.TextLabel8, 0, 2, 1, 1) self.gammaslider = QSlider(self.GroupBox1) self.gammaslider.setObjectName(u"gammaslider") palette2 = QPalette() palette2.setBrush(QPalette.Active, QPalette.WindowText, brush) palette2.setBrush(QPalette.Active, QPalette.Button, brush7) palette2.setBrush(QPalette.Active, QPalette.Light, brush7) palette2.setBrush(QPalette.Active, QPalette.Midlight, brush7) brush16 = QBrush(QColor(127, 127, 127, 255)) brush16.setStyle(Qt.SolidPattern) palette2.setBrush(QPalette.Active, QPalette.Dark, brush16) brush17 = QBrush(QColor(170, 170, 170, 255)) brush17.setStyle(Qt.SolidPattern) palette2.setBrush(QPalette.Active, QPalette.Mid, brush17) palette2.setBrush(QPalette.Active, QPalette.Text, brush6) palette2.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette2.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette2.setBrush(QPalette.Active, QPalette.Base, brush7) palette2.setBrush(QPalette.Active, QPalette.Window, brush8) palette2.setBrush(QPalette.Active, QPalette.Shadow, brush6) palette2.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette2.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette2.setBrush(QPalette.Active, QPalette.Link, brush6) palette2.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) palette2.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette2.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette2.setBrush(QPalette.Inactive, QPalette.Button, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Light, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Midlight, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Dark, brush16) palette2.setBrush(QPalette.Inactive, QPalette.Mid, brush17) palette2.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette2.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette2.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette2.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette2.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette2.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette2.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette2.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette2.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette2.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette2.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette2.setBrush(QPalette.Disabled, QPalette.Button, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Light, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Midlight, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Dark, brush16) palette2.setBrush(QPalette.Disabled, QPalette.Mid, brush17) palette2.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette2.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette2.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette2.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette2.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette2.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette2.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette2.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette2.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette2.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.gammaslider.setPalette(palette2) self.gammaslider.setMaximum(400) self.gammaslider.setValue(100) self.gammaslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.gammaslider, 0, 1, 1, 1) self.TextLabel1_2 = QLabel(self.GroupBox1) self.TextLabel1_2.setObjectName(u"TextLabel1_2") self.gridLayout.addWidget(self.TextLabel1_2, 2, 0, 1, 1) self.rlabel = QLabel(self.GroupBox1) self.rlabel.setObjectName(u"rlabel") self.gridLayout.addWidget(self.rlabel, 2, 2, 1, 1) self.rslider = QSlider(self.GroupBox1) self.rslider.setObjectName(u"rslider") palette3 = QPalette() palette3.setBrush(QPalette.Active, QPalette.WindowText, brush) brush18 = QBrush(QColor(255, 0, 0, 255)) brush18.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Button, brush18) brush19 = QBrush(QColor(255, 127, 127, 255)) brush19.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Light, brush19) brush20 = QBrush(QColor(255, 38, 38, 255)) brush20.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Midlight, brush20) brush21 = QBrush(QColor(127, 0, 0, 255)) brush21.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Dark, brush21) brush22 = QBrush(QColor(170, 0, 0, 255)) brush22.setStyle(Qt.SolidPattern) palette3.setBrush(QPalette.Active, QPalette.Mid, brush22) palette3.setBrush(QPalette.Active, QPalette.Text, brush6) palette3.setBrush(QPalette.Active, QPalette.BrightText, brush7) palette3.setBrush(QPalette.Active, QPalette.ButtonText, brush) palette3.setBrush(QPalette.Active, QPalette.Base, brush7) palette3.setBrush(QPalette.Active, QPalette.Window, brush8) palette3.setBrush(QPalette.Active, QPalette.Shadow, brush6) palette3.setBrush(QPalette.Active, QPalette.Highlight, brush9) palette3.setBrush(QPalette.Active, QPalette.HighlightedText, brush7) palette3.setBrush(QPalette.Active, QPalette.Link, brush6) palette3.setBrush(QPalette.Active, QPalette.LinkVisited, brush6) palette3.setBrush(QPalette.Active, QPalette.AlternateBase, brush10) palette3.setBrush(QPalette.Inactive, QPalette.WindowText, brush) palette3.setBrush(QPalette.Inactive, QPalette.Button, brush18) palette3.setBrush(QPalette.Inactive, QPalette.Light, brush19) palette3.setBrush(QPalette.Inactive, QPalette.Midlight, brush20) palette3.setBrush(QPalette.Inactive, QPalette.Dark, brush21) palette3.setBrush(QPalette.Inactive, QPalette.Mid, brush22) palette3.setBrush(QPalette.Inactive, QPalette.Text, brush6) palette3.setBrush(QPalette.Inactive, QPalette.BrightText, brush7) palette3.setBrush(QPalette.Inactive, QPalette.ButtonText, brush) palette3.setBrush(QPalette.Inactive, QPalette.Base, brush7) palette3.setBrush(QPalette.Inactive, QPalette.Window, brush8) palette3.setBrush(QPalette.Inactive, QPalette.Shadow, brush6) palette3.setBrush(QPalette.Inactive, QPalette.Highlight, brush9) palette3.setBrush(QPalette.Inactive, QPalette.HighlightedText, brush7) palette3.setBrush(QPalette.Inactive, QPalette.Link, brush6) palette3.setBrush(QPalette.Inactive, QPalette.LinkVisited, brush6) palette3.setBrush(QPalette.Inactive, QPalette.AlternateBase, brush10) palette3.setBrush(QPalette.Disabled, QPalette.WindowText, brush) palette3.setBrush(QPalette.Disabled, QPalette.Button, brush18) palette3.setBrush(QPalette.Disabled, QPalette.Light, brush19) palette3.setBrush(QPalette.Disabled, QPalette.Midlight, brush20) palette3.setBrush(QPalette.Disabled, QPalette.Dark, brush21) palette3.setBrush(QPalette.Disabled, QPalette.Mid, brush22) palette3.setBrush(QPalette.Disabled, QPalette.Text, brush6) palette3.setBrush(QPalette.Disabled, QPalette.BrightText, brush7) palette3.setBrush(QPalette.Disabled, QPalette.ButtonText, brush) palette3.setBrush(QPalette.Disabled, QPalette.Base, brush7) palette3.setBrush(QPalette.Disabled, QPalette.Window, brush8) palette3.setBrush(QPalette.Disabled, QPalette.Shadow, brush6) palette3.setBrush(QPalette.Disabled, QPalette.Highlight, brush9) palette3.setBrush(QPalette.Disabled, QPalette.HighlightedText, brush7) palette3.setBrush(QPalette.Disabled, QPalette.Link, brush6) palette3.setBrush(QPalette.Disabled, QPalette.LinkVisited, brush6) palette3.setBrush(QPalette.Disabled, QPalette.AlternateBase, brush10) self.rslider.setPalette(palette3) self.rslider.setMaximum(400) self.rslider.setValue(100) self.rslider.setOrientation(Qt.Horizontal) self.gridLayout.addWidget(self.rslider, 2, 1, 1, 1) self.PushButton3 = QPushButton(self.GroupBox1) self.PushButton3.setObjectName(u"PushButton3") self.gridLayout.addWidget(self.PushButton3, 8, 0, 1, 3) self.MyCustomWidget1 = GammaView(self.GroupBox1) self.MyCustomWidget1.setObjectName(u"MyCustomWidget1") self.gridLayout.addWidget(self.MyCustomWidget1, 0, 3, 9, 1) self.vboxLayout.addWidget(self.GroupBox1) self.hboxLayout3 = QHBoxLayout() self.hboxLayout3.setSpacing(6) self.hboxLayout3.setObjectName(u"hboxLayout3") self.hboxLayout3.setContentsMargins(0, 0, 0, 0) self.spacerItem1 = QSpacerItem(40, 20, QSizePolicy.Expanding, QSizePolicy.Minimum) self.hboxLayout3.addItem(self.spacerItem1) self.buttonOk = QPushButton(Config) self.buttonOk.setObjectName(u"buttonOk") self.buttonOk.setAutoDefault(True) self.hboxLayout3.addWidget(self.buttonOk) self.buttonCancel = QPushButton(Config) self.buttonCancel.setObjectName(u"buttonCancel") self.buttonCancel.setAutoDefault(True) self.hboxLayout3.addWidget(self.buttonCancel) self.vboxLayout.addLayout(self.hboxLayout3) self.retranslateUi(Config) self.size_width.valueChanged.connect(self.size_custom.click) self.size_height.valueChanged.connect(self.size_custom.click) self.buttonOk.setDefault(True) QMetaObject.connectSlotsByName(Config)
def __init__(self, base, account): TritonWidget.__init__(self, base) self.account = account self.type = account['type'] self.name = account['name'] self.icon = account['icon'].replace('\\', '/') self.timer = None self.secretWidget = None self.iconWidget = None self.closeEvent = self.widgetDeleted self.boxLayout = QHBoxLayout(self) self.boxLayout.setContentsMargins(0, 0, 0, 0) self.image = QLabel() self.image.setFixedSize(48, 48) self.reloadIcon() self.detailWidget = QWidget() self.detailLayout = QVBoxLayout(self.detailWidget) self.detailLayout.setContentsMargins(0, 0, 0, 0) self.nameLabel = EditableLabel(True, None) self.nameLabel.callback = self.renameAccount self.nameLabel.setText(self.name) self.nameLabel.setAlignment(Qt.AlignTop) self.nameLabel.setFont(QFont('Helvetica', 11)) self.passLabel = EditableLabel(False, self.openPassLabel) self.passLabel.disableEdit() self.passLabel.setAlignment(Qt.AlignBottom) self.detailLayout.addWidget(self.nameLabel) self.detailLayout.addWidget(self.passLabel) self.showButton = PixmapButton(QPixmap('icons/RefreshIcon.png').scaled(48, 48)) self.showButton.clicked.connect(self.buttonPressed) self.timerProgress = QRoundProgressBar() self.timerProgress.setBarStyle(QRoundProgressBar.BarStyle.PIE) self.timerProgress.setFixedSize(48, 48) self.timerProgress.setFormat('') self.timerProgress.mouseReleaseEvent = self.buttonPressed palette = QPalette() brush = QBrush(QColor(155, 183, 214)) brush.setStyle(Qt.SolidPattern) palette.setBrush(QPalette.Active, QPalette.Highlight, brush) self.timerProgress.setPalette(palette) self.timerProgress.hide() self.boxLayout.addWidget(self.image) self.boxLayout.addSpacing(5) self.boxLayout.addWidget(self.detailWidget) self.boxLayout.addWidget(self.showButton, 0, Qt.AlignRight) self.boxLayout.addWidget(self.timerProgress, 0, Qt.AlignRight) self.setFixedSize(360, 48) self.hidePassword() self.setContextMenuPolicy(Qt.CustomContextMenu) self.customContextMenuRequested.connect(self.openContextMenu) self.menu = QMenu(self) self.removeAction = QAction('Remove') self.removeAction.triggered.connect(self.removeAccount) self.iconAction = QAction('Edit icon') self.iconAction.triggered.connect(self.editIcon) self.showAction = QAction('Show secret key') self.showAction.triggered.connect(self.showSecretKey) self.menu.addAction(self.removeAction) self.menu.addSeparator() self.menu.addAction(self.iconAction) self.menu.addAction(self.showAction)