Python PyQt5.QtGui.QPalette() Examples

The following are code examples for showing how to use PyQt5.QtGui.QPalette(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: cct   Author: awacha   File: circulator.py    BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def setFlagBackground(self, flag: QtWidgets.QLabel, state: bool, label: Optional[str] = None):
        palette = flag.palette()
        assert isinstance(palette, QtGui.QPalette)
        if state is None:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('gray'))
            palette.setColor(QtGui.QPalette.Foreground, QtGui.QColor('black'))
        elif state:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('lightgreen'))
            palette.setColor(QtGui.QPalette.Foreground, QtGui.QColor('black'))
        else:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('red'))
            palette.setColor(QtGui.QPalette.Foreground, QtGui.QColor('white'))
        flag.setPalette(palette)
        flag.setAutoFillBackground(True)
        if label is not None:
            flag.setText(label) 
Example 2
Project: MNIST_Recognition   Author: jiweibo   File: gui.py    MIT License 6 votes vote down vote up
def initUI(self):
        self.setGeometry(300, 300, 256, 256)
        self.setWindowTitle('Drawing')
        self.setAutoFillBackground(True)
        self.setPalette(QPalette(Qt.white))
        self.pix = QPixmap(self.size())

        self.pix.fill(Qt.white)
        # self.setMinimumSize(128, 128)
        self.setFixedSize(256, 256)
        self.label = QLabel()
        self.label.setPixmap(self.pix)

        self.layout = QVBoxLayout()
        self.layout.addWidget(self.label)

        self.start_pos = QPoint()
        self.end_pos = QPoint()
        self.init_style = Qt.SolidLine
        self.init_weight = 10
        self.init_color = QColor(Qt.black)

        self.setLayout(self.layout)
        self.show() 
Example 3
Project: scm-workbench   Author: barry-scott   File: wb_app.py    Apache License 2.0 6 votes vote down vote up
def setDarkPalette( self ):
        # thanks to https://gist.github.com/QuantumCD/6245215
        self.setStyle( QtWidgets.QStyleFactory.create( "Fusion" ) )
        self.dark_palette = QtGui.QPalette()
        self.dark_palette.setColor( QtGui.QPalette.Window, QtGui.QColor( 53,53,53 ) )
        self.dark_palette.setColor( QtGui.QPalette.WindowText, QtCore.Qt.white )
        self.dark_palette.setColor( QtGui.QPalette.Base, QtGui.QColor( 25,25,25 ) )
        self.dark_palette.setColor( QtGui.QPalette.AlternateBase, QtGui.QColor( 53,53,53 ) )
        self.dark_palette.setColor( QtGui.QPalette.ToolTipBase, QtCore.Qt.white )
        self.dark_palette.setColor( QtGui.QPalette.ToolTipText, QtCore.Qt.white )
        self.dark_palette.setColor( QtGui.QPalette.Text, QtCore.Qt.white )
        self.dark_palette.setColor( QtGui.QPalette.Button, QtGui.QColor( 53,53,53 ) )
        self.dark_palette.setColor( QtGui.QPalette.ButtonText, QtCore.Qt.white )
        self.dark_palette.setColor( QtGui.QPalette.BrightText, QtCore.Qt.red )
        self.dark_palette.setColor( QtGui.QPalette.Link, QtGui.QColor( 42, 130, 218 ) )
        self.dark_palette.setColor( QtGui.QPalette.Highlight, QtGui.QColor( 42, 130, 218 ) )
        self.dark_palette.setColor( QtGui.QPalette.HighlightedText, QtCore.Qt.black )

        self.setPalette( self.dark_palette ) 
Example 4
Project: btmhdw   Author: meherett   File: BTMHDW-WINDOWS.py    MIT License 6 votes vote down vote up
def btmhdwLight():
    # Smart import of the rc file
    import qdarkstyle.pyqt5_style_rc

    # Load the stylesheet content from resources
    from PyQt5.QtCore import QCoreApplication, QFile, QTextStream
    from PyQt5.QtGui import QColor, QPalette
    from qdarkstyle import _apply_palette_fix, _logger

    # Apply palette fix. See issue #139
    _apply_palette_fix(QCoreApplication, QPalette, QColor)

    f = QFile(resource_path("BTMHDW-LIGHT.qss"))
    if not f.exists():
        _logger().error("Unable to load stylesheet, file not found in "
                        "resources")
        return ""
    else:
        f.open(QFile.ReadOnly | QFile.Text)
        ts = QTextStream(f)
        stylesheet = ts.readAll()

        # Apply OS specific patches
        # stylesheet = _apply_stylesheet_patches(stylesheet)
        return stylesheet 
Example 5
Project: nanovna-saver   Author: mihtjel   File: Chart.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, name=""):
        super().__init__(name)
        self.leftMargin = 35
        self.chartWidth = 250
        self.chartHeight = 250
        self.fstart = 0
        self.fstop = 0
        self.minQ = 0
        self.maxQ = 0
        self.span = 0
        self.minDisplayValue = 0
        self.maxDisplayValue = 100

        self.setMinimumSize(self.chartWidth + self.rightMargin + self.leftMargin,
                            self.chartHeight + self.topMargin + self.bottomMargin)
        self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                                 QtWidgets.QSizePolicy.MinimumExpanding))
        pal = QtGui.QPalette()
        pal.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(pal)
        self.setAutoFillBackground(True) 
Example 6
Project: nanovna-saver   Author: mihtjel   File: Chart.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, name=""):
        super().__init__(name)
        self.leftMargin = 30
        self.chartWidth = 250
        self.chartHeight = 250
        self.minDisplayValue = 0
        self.maxDisplayValue = 1

        self.fixedValues = True
        self.y_action_fixed_span.setChecked(True)
        self.y_action_automatic.setChecked(False)

        self.minValue = 0
        self.maxValue = 1
        self.span = 1

        self.setMinimumSize(self.chartWidth + self.rightMargin + self.leftMargin,
                            self.chartHeight + self.topMargin + self.bottomMargin)
        self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                                 QtWidgets.QSizePolicy.MinimumExpanding))
        pal = QtGui.QPalette()
        pal.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(pal)
        self.setAutoFillBackground(True) 
Example 7
Project: nanovna-saver   Author: mihtjel   File: Chart.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, name=""):
        super().__init__(name)
        self.leftMargin = 30
        self.chartWidth = 250
        self.chartHeight = 250
        self.minDisplayValue = 0
        self.maxDisplayValue = 100

        self.minValue = 0
        self.maxValue = 1
        self.span = 1

        self.setMinimumSize(self.chartWidth + self.rightMargin + self.leftMargin,
                            self.chartHeight + self.topMargin + self.bottomMargin)
        self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                                 QtWidgets.QSizePolicy.MinimumExpanding))
        pal = QtGui.QPalette()
        pal.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(pal)
        self.setAutoFillBackground(True) 
Example 8
Project: nanovna-saver   Author: mihtjel   File: Chart.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, name=""):
        super().__init__(name)
        self.leftMargin = 30
        self.chartWidth = 250
        self.chartHeight = 250
        self.minDisplayValue = 0
        self.maxDisplayValue = 100

        self.minValue = -1
        self.maxValue = 1
        self.span = 1

        self.setMinimumSize(self.chartWidth + self.rightMargin + self.leftMargin,
                            self.chartHeight + self.topMargin + self.bottomMargin)
        self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                                 QtWidgets.QSizePolicy.MinimumExpanding))
        pal = QtGui.QPalette()
        pal.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(pal)
        self.setAutoFillBackground(True) 
Example 9
Project: nanovna-saver   Author: mihtjel   File: Chart.py    GNU General Public License v3.0 6 votes vote down vote up
def __init__(self, name=""):
        super().__init__(name)
        self.leftMargin = 30
        self.chartWidth = 250
        self.chartHeight = 250
        self.minDisplayValue = 0
        self.maxDisplayValue = 100

        self.minValue = -1
        self.maxValue = 1
        self.span = 1

        self.setMinimumSize(self.chartWidth + self.rightMargin + self.leftMargin,
                            self.chartHeight + self.topMargin + self.bottomMargin)
        self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                                 QtWidgets.QSizePolicy.MinimumExpanding))
        pal = QtGui.QPalette()
        pal.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(pal)
        self.setAutoFillBackground(True) 
Example 10
Project: cct   Author: awacha   File: detector.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def setFlagBackground(self, flag: QtWidgets.QLabel, state: str):
        palette = flag.palette()
        assert isinstance(palette, QtGui.QPalette)
        if state == 'ok':
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('green'))
        elif state == 'warning':
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('orange'))
        else:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('red'))
        flag.setPalette(palette)
        flag.setAutoFillBackground(True) 
Example 11
Project: cct   Author: awacha   File: xraysource.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def setFlagBackground(self, flag: QtWidgets.QLabel, state: bool):
        palette = flag.palette()
        assert isinstance(palette, QtGui.QPalette)
        if state is None:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('gray'))
            palette.setColor(QtGui.QPalette.Foreground, QtGui.QColor('black'))
        elif state:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('lightgreen'))
            palette.setColor(QtGui.QPalette.Foreground, QtGui.QColor('black'))
        else:
            palette.setColor(QtGui.QPalette.Window, QtGui.QColor('red'))
            palette.setColor(QtGui.QPalette.Foreground, QtGui.QColor('white'))
        flag.setPalette(palette)
        flag.setAutoFillBackground(True) 
Example 12
Project: pdash   Author: CPChain   File: header.py    GNU General Public License v3.0 5 votes vote down vote up
def brush(self):
        palette1 = QPalette()
        path = abs_path('icons/header@x2.png')
        palette1.setBrush(self.backgroundRole(), QBrush(QPixmap(path)))
        self.setPalette(palette1)
        self.setAutoFillBackground(True) 
Example 13
Project: pdash   Author: CPChain   File: banner.py    GNU General Public License v3.0 5 votes vote down vote up
def brush(self):
        palette1 = QtGui.QPalette()
        palette1.setBrush(self.backgroundRole(), QtGui.QBrush(QtGui.QPixmap(self.path)))
        self.setPalette(palette1)
        self.setAutoFillBackground(True) 
Example 14
Project: lyric-grabber   Author: aaronhktan   File: widget_item.py    MIT License 5 votes vote down vote up
def setBackgroundColor(self, backgroundColor):
    """Sets background color of a song widget
    
    Args:
        backgroundColor (Qt.GlobalColor): A Qt named colour
    """
    self._pal = QtGui.QPalette()
    self._pal.setColor(QtGui.QPalette.Background, backgroundColor)
    self.setAutoFillBackground(True)
    self.setPalette(self._pal) 
Example 15
Project: PyRHEED   Author: yux1991   File: my_widgets.py    MIT License 5 votes vote down vote up
def __init__(self,minimum,maximum,scale,value,name,index,BG=False,direction='vertical',color='black'):
        super(VerticalLabelSlider,self).__init__()
        self.name = name
        self.scale = scale
        self.index = index
        self.BG = BG
        self.currentValue = value
        self.direction = direction
        if direction == 'vertical':
            self.slider = QtWidgets.QSlider(QtCore.Qt.Vertical)
        elif direction == 'horizontal':
            self.slider = QtWidgets.QSlider(QtCore.Qt.Horizontal)
        self.slider.setMinimum(minimum*scale)
        self.slider.setMaximum(maximum*scale)
        self.slider.setValue(value*self.scale)
        self.slider.valueChanged.connect(self.update_label)

        self.UIgrid = QtWidgets.QGridLayout()
        palette = QtGui.QPalette()
        palette.setColor(QtGui.QPalette.Window, QtCore.Qt.transparent)
        palette.setColor(QtGui.QPalette.WindowText,QtGui.QColor(color))
        if direction == 'vertical':
            if self.BG:
                self.label = QtWidgets.QLabel('\u00A0\u00A0'+self.name+'\u00A0BG\n({:3.2f})'.format(value))
            else:
                self.label = QtWidgets.QLabel('\u00A0\u00A0'+self.name+'{}\n({:3.2f})'.format(self.index,value))
            self.label.setFixedWidth(35)
            self.UIgrid.addWidget(self.slider,0,0)
            self.UIgrid.addWidget(self.label,1,0)
        elif direction == 'horizontal':
            self.label = QtWidgets.QLabel(self.name+'\u00A0({:3.2f})'.format(value))
            self.UIgrid.addWidget(self.label,0,0)
            self.UIgrid.addWidget(self.slider,0,1)
        self.label.setAutoFillBackground(True)
        self.label.setPalette(palette)
        self.UIgrid.setContentsMargins(0,0,0,0)
        self.setLayout(self.UIgrid) 
Example 16
Project: AutoSplit64   Author: Kainev   File: misc.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super().__init__(parent)

        self.setFrameShape(QtWidgets.QFrame.HLine)
        #self.setFrameShadow(QtWidgets.QFrame.Plain)
        palette = QtGui.QPalette()
        palette.setColor(QtGui.QPalette.WindowText, QtGui.QColor(43, 45, 47))
        self.setPalette(palette) 
Example 17
Project: CNNArt   Author: thomaskuestner   File: loadf2.py    Apache License 2.0 5 votes vote down vote up
def __init__(self, parent=None):
        QWidget.__init__(self, parent)
        palette = QPalette(self.palette())
        palette.setColor(palette.Background, QtCore.Qt.transparent)
        self.setPalette(palette)

        # self.timer = QBasicTimer()
        self.timer = QTimer()
        # self.timer.setInterval(1000)
        # self.timer.start()
        #
        # self.counter = 0 
Example 18
Project: quantumpt   Author: QuantumPrayerTimes   File: waitoverlay.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, parent=None):
        super(WaitingOverlay, self).__init__(parent, Qt.FramelessWindowHint)

        self.counter = 0
        self.timer = QTimer()

        palette = QPalette(self.palette())
        palette.setColor(palette.Background, Qt.transparent)
        self.setPalette(palette) 
Example 19
Project: universal_tool_template.py   Author: shiningdesign   File: LNTextEdit.py    MIT License 5 votes vote down vote up
def setReadOnlyStyle(self, state):
        if state == 1:
            mainWindowBgColor = QtGui.QPalette().color(QtGui.QPalette.Window)
            self.setStyleSheet('QPlainTextEdit[readOnly="true"] { background-color: %s;} QFrame {border: 0px}' % mainWindowBgColor.name() )
            self.setHighlight(0)
        else:
            self.setStyleSheet('')
            self.setHighlight(1) 
Example 20
Project: qwatson   Author: jnsebgosselin   File: test_colors.py    GNU General Public License v3.0 5 votes vote down vote up
def test_get_qcolor(qtbot):
    """
    Test that the various available methods to create a QColor are working
    as expected.
    """
    qcolor = QColor('red')
    assert get_qcolor(QColor('red')) == qcolor
    assert get_qcolor('red') == qcolor
    assert get_qcolor((255, 0, 0)) == qcolor
    assert get_qcolor('#FF0000') == qcolor
    assert get_qcolor('window') == QPalette().window().color()
    with pytest.raises(ValueError):
        get_qcolor('dummy') 
Example 21
Project: solar-viewer   Author: RobertJaro   File: notification_box.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def setupUi(self, NotificationBox):
        NotificationBox.setObjectName("NotificationBox")
        NotificationBox.resize(400, 38)
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        NotificationBox.setPalette(palette)
        NotificationBox.setAutoFillBackground(True)
        NotificationBox.setFrameShape(QtWidgets.QFrame.Panel)
        NotificationBox.setFrameShadow(QtWidgets.QFrame.Raised)
        self.horizontalLayout = QtWidgets.QHBoxLayout(NotificationBox)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.message_label = QtWidgets.QLabel(NotificationBox)
        self.message_label.setObjectName("message_label")
        self.horizontalLayout.addWidget(self.message_label)
        self.close_button = QtWidgets.QToolButton(NotificationBox)
        self.close_button.setObjectName("close_button")
        self.horizontalLayout.addWidget(self.close_button)

        self.retranslateUi(NotificationBox)
        self.close_button.clicked.connect(NotificationBox.hide)
        QtCore.QMetaObject.connectSlotsByName(NotificationBox) 
Example 22
Project: AnimeWatch   Author: kanishka-linux   File: animeWatch.py    GNU General Public License v3.0 5 votes vote down vote up
def set_mainwindow_palette(fanart,first_time=None):
	if not os.path.isfile(fanart) or ui.keep_background_constant:
		fanart = ui.default_background
	if os.path.isfile(fanart):
		if not ui.keep_background_constant or first_time:
			palette	= QtGui.QPalette()
			palette.setBrush(QtGui.QPalette.Background,
							QtGui.QBrush(QtGui.QPixmap(fanart)))
			MainWindow.setPalette(palette)
			ui.current_background = fanart 
Example 23
Project: AnimeWatch   Author: kanishka-linux   File: animeWatch.py    GNU General Public License v3.0 5 votes vote down vote up
def set_mainwindow_palette(fanart,first_time=None):
	if not os.path.isfile(fanart) or ui.keep_background_constant:
		fanart = ui.default_background
	if os.path.isfile(fanart):
		if not ui.keep_background_constant or first_time:
			palette	= QtGui.QPalette()
			palette.setBrush(QtGui.QPalette.Background,
							QtGui.QBrush(QtGui.QPixmap(fanart)))
			MainWindow.setPalette(palette)
			ui.current_background = fanart 
Example 24
Project: fomod-designer   Author: GandaG   File: __main__.py    Apache License 2.0 5 votes vote down vote up
def main():
    sys.excepthook = excepthook

    settings = read_settings()
    if settings["Appearance"]["style"]:
        QApplication.setStyle(settings["Appearance"]["style"])
    app = QApplication(sys.argv)
    if settings["Appearance"]["palette"]:
        app.setPalette(QPalette(QColor(settings["Appearance"]["palette"])))
    IntroWindow()
    sys.exit(app.exec_()) 
Example 25
Project: axopy   Author: axopy   File: prompts.py    MIT License 5 votes vote down vote up
def __init__(self, parent=None):
        super(AnnotatedProgressBar, self).__init__(parent)

        self.value = 0
        self._ticks = 1
        self._update_tick_labels()
        self._transitions = (0, 1)

        self.setMinimumHeight(40)
        self.setMinimumWidth(300)

        self.palette = QtGui.QPalette() 
Example 26
Project: axopy   Author: axopy   File: prompts.py    MIT License 5 votes vote down vote up
def draw_ticks(self, painter):
        w = self.width()
        h = self.height()

        tick_step = int(round(w / self._ticks))

        f1 = int(((w / float(self._ticks*1000)) * self._transitions[0]*1000))
        f2 = int(((w / float(self._ticks*1000)) * self._transitions[1]*1000))

        # the contract indicator window
        painter.setPen(QtGui.QColor(0, 0, 0, 0))
        painter.setBrush(QtGui.QColor(180, 80, 80, 140))
        painter.drawRect(f1, 0, f2-f1, h)

        painter.setPen(self.palette.color(QtGui.QPalette.Text))
        painter.setFont(self.font())

        # draw the "contact" and "rest" text
        for t, l in zip(self._transitions, ['contract', 'rest']):
            x = int(((w / float(self._ticks*1000)) * (t*1000.)))
            metrics = painter.fontMetrics()
            fw = metrics.width(l)
            painter.drawText(x-fw/2, h/2, l)

        # draw the ticks marking each second
        j = 0
        for i in range(tick_step, self._ticks*tick_step, tick_step):
            painter.drawLine(i, h-5, i, h)
            metrics = painter.fontMetrics()
            fw = metrics.width(self.tick_labels[j])
            painter.drawText(i-fw/2, h-7, self.tick_labels[j])
            j += 1 
Example 27
Project: nanovna-saver   Author: mihtjel   File: Chart.py    GNU General Public License v3.0 5 votes vote down vote up
def setBackgroundColor(self, color: QtGui.QColor):
        self.backgroundColor = color
        pal = self.palette()
        pal.setColor(QtGui.QPalette.Background, color)
        self.setPalette(pal)
        self.update() 
Example 28
Project: nanovna-saver   Author: mihtjel   File: Chart.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, name=""):
        super().__init__(name)
        self.leftMargin = 40
        self.chartWidth = 250
        self.chartHeight = 250
        self.fstart = 0
        self.fstop = 0
        self.minAngle = 0
        self.maxAngle = 0
        self.span = 0
        self.unwrap = False

        self.unwrappedData = []
        self.unwrappedReference = []

        self.minDisplayValue = -180
        self.maxDisplayValue = 180

        self.setMinimumSize(self.chartWidth + self.rightMargin + self.leftMargin,
                            self.chartHeight + self.topMargin + self.bottomMargin)
        self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                                 QtWidgets.QSizePolicy.MinimumExpanding))
        pal = QtGui.QPalette()
        pal.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(pal)
        self.setAutoFillBackground(True)

        self.y_menu.addSeparator()
        self.action_unwrap = QtWidgets.QAction("Unwrap")
        self.action_unwrap.setCheckable(True)
        self.action_unwrap.triggered.connect(lambda: self.setUnwrap(self.action_unwrap.isChecked()))
        self.y_menu.addAction(self.action_unwrap) 
Example 29
Project: nanovna-saver   Author: mihtjel   File: Chart.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, name=""):
        super().__init__(name)
        self.leftMargin = 30
        self.chartWidth = 250
        self.chartHeight = 250
        self.fstart = 0
        self.fstop = 0
        self.maxDisplayValue = 25
        self.minDisplayValue = 1

        self.setMinimumSize(self.chartWidth + self.rightMargin + self.leftMargin,
                            self.chartHeight + self.topMargin + self.bottomMargin)
        self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                                 QtWidgets.QSizePolicy.MinimumExpanding))
        pal = QtGui.QPalette()
        pal.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(pal)
        self.setAutoFillBackground(True)
        self.y_menu.addSeparator()
        self.y_log_lin_group = QtWidgets.QActionGroup(self.y_menu)
        self.y_action_linear = QtWidgets.QAction("Linear")
        self.y_action_linear.setCheckable(True)
        self.y_action_linear.setChecked(True)
        self.y_action_logarithmic = QtWidgets.QAction("Logarithmic")
        self.y_action_logarithmic.setCheckable(True)
        self.y_action_linear.triggered.connect(lambda: self.setLogarithmicY(False))
        self.y_action_logarithmic.triggered.connect(lambda: self.setLogarithmicY(True))
        self.y_log_lin_group.addAction(self.y_action_linear)
        self.y_log_lin_group.addAction(self.y_action_logarithmic)
        self.y_menu.addAction(self.y_action_linear)
        self.y_menu.addAction(self.y_action_logarithmic) 
Example 30
Project: nanovna-saver   Author: mihtjel   File: Chart.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, name=""):
        super().__init__(name)
        self.chartWidth = 250
        self.chartHeight = 250

        self.setMinimumSize(self.chartWidth + 40, self.chartHeight + 40)
        pal = QtGui.QPalette()
        pal.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(pal)
        self.setAutoFillBackground(True) 
Example 31
Project: nanovna-saver   Author: mihtjel   File: Chart.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, name=""):
        super().__init__(name)
        self.chartWidth = 250
        self.chartHeight = 250

        self.setMinimumSize(self.chartWidth + 40, self.chartHeight + 40)
        pal = QtGui.QPalette()
        pal.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(pal)
        self.setAutoFillBackground(True) 
Example 32
Project: nanovna-saver   Author: mihtjel   File: Chart.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, name=""):
        super().__init__(name)
        self.leftMargin = 30
        self.chartWidth = 250
        self.chartHeight = 250
        self.minDisplayValue = -1
        self.maxDisplayValue = 1
        self.fixedValues = True

        self.y_action_automatic.setChecked(False)
        self.y_action_fixed_span.setChecked(True)

        self.minValue = 0
        self.maxValue = 1
        self.span = 1

        self.isInverted = False

        self.setMinimumSize(self.chartWidth + self.rightMargin + self.leftMargin,
                            self.chartHeight + self.topMargin + self.bottomMargin)
        self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                                 QtWidgets.QSizePolicy.MinimumExpanding))
        pal = QtGui.QPalette()
        pal.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(pal)
        self.setAutoFillBackground(True) 
Example 33
Project: nanovna-saver   Author: mihtjel   File: Chart.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, name=""):
        super().__init__(name)
        self.leftMargin = 30
        self.chartWidth = 250
        self.chartHeight = 250
        self.minDisplayValue = -80
        self.maxDisplayValue = 10

        self.data11: List[Datapoint] = []
        self.data21: List[Datapoint] = []

        self.reference11: List[Datapoint] = []
        self.reference21: List[Datapoint] = []

        self.minValue = 0
        self.maxValue = 1
        self.span = 1

        self.isInverted = False

        self.setMinimumSize(self.chartWidth + self.rightMargin + self.leftMargin,
                            self.chartHeight + self.topMargin + self.bottomMargin)
        self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                                 QtWidgets.QSizePolicy.MinimumExpanding))
        pal = QtGui.QPalette()
        pal.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(pal)
        self.setAutoFillBackground(True) 
Example 34
Project: nanovna-saver   Author: mihtjel   File: Chart.py    GNU General Public License v3.0 5 votes vote down vote up
def __init__(self, name="", reflective=True):
        super().__init__(name)
        self.leftMargin = 40
        self.chartWidth = 250
        self.chartHeight = 250
        self.fstart = 0
        self.fstop = 0
        self.minDelay = 0
        self.maxDelay = 0
        self.span = 0

        self.reflective = reflective

        self.groupDelay = []
        self.groupDelayReference = []

        self.minDisplayValue = -180
        self.maxDisplayValue = 180

        self.setMinimumSize(self.chartWidth + self.rightMargin + self.leftMargin,
                            self.chartHeight + self.topMargin + self.bottomMargin)
        self.setSizePolicy(QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
                                                 QtWidgets.QSizePolicy.MinimumExpanding))
        pal = QtGui.QPalette()
        pal.setColor(QtGui.QPalette.Background, self.backgroundColor)
        self.setPalette(pal)
        self.setAutoFillBackground(True) 
Example 35
Project: HearthPacks   Author: Arzaroth   File: menu.py    BSD 2-Clause "Simplified" License 5 votes vote down vote up
def __init__(self, parent=None, interval=50):
        QWidget.__init__(self, parent)
        palette = QPalette(self.palette())
        palette.setColor(palette.Background, Qt.transparent)
        self.setPalette(palette)
        self.counter = 0
        self.interval = interval 
Example 36
Project: xqemu-manager   Author: xqemu   File: main.py    GNU General Public License v2.0 5 votes vote down vote up
def main():
	app = QApplication(sys.argv)
	app.setStyle('Fusion')

	# Dark theme via https://gist.github.com/gph03n1x/7281135 with modifications
	palette = QtGui.QPalette()
	palette.setColor(QtGui.QPalette.Window, QtGui.QColor(53,53,53))
	palette.setColor(QtGui.QPalette.WindowText, QtCore.Qt.white)
	palette.setColor(QtGui.QPalette.Base, QtGui.QColor(15,15,15))
	palette.setColor(QtGui.QPalette.AlternateBase, QtGui.QColor(53,53,53))
	palette.setColor(QtGui.QPalette.ToolTipBase, QtCore.Qt.white)
	palette.setColor(QtGui.QPalette.ToolTipText, QtCore.Qt.white)
	palette.setColor(QtGui.QPalette.Text, QtCore.Qt.white)
	palette.setColor(QtGui.QPalette.Button, QtGui.QColor(53,53,53))
	palette.setColor(QtGui.QPalette.ButtonText, QtCore.Qt.white)
	palette.setColor(QtGui.QPalette.BrightText, QtCore.Qt.red)
	palette.setColor(QtGui.QPalette.Highlight, QtGui.QColor(45,197,45).lighter())
	palette.setColor(QtGui.QPalette.HighlightedText, QtCore.Qt.black)
	palette.setColor(QtGui.QPalette.Disabled, QtGui.QPalette.Text, QtCore.Qt.darkGray)
	palette.setColor(QtGui.QPalette.Disabled, QtGui.QPalette.ButtonText, QtCore.Qt.darkGray)
	palette.setColor(QtGui.QPalette.Disabled, QtGui.QPalette.WindowText, QtCore.Qt.darkGray)
	app.setPalette(palette)

	widget = MainWindow()
	widget.show()
	sys.exit(app.exec_()) 
Example 37
Project: flight-stone   Author: asmateus   File: minimal_autogen.py    MIT License 5 votes vote down vote up
def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.setEnabled(True)
        MainWindow.resize(640, 480)
        MainWindow.setMinimumSize(QtCore.QSize(640, 480))
        MainWindow.setMaximumSize(QtCore.QSize(640, 480))
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.video_holder = QtWidgets.QLabel(self.centralwidget)
        self.video_holder.setGeometry(QtCore.QRect(0, 10, 640, 480))
        self.video_holder.setMinimumSize(QtCore.QSize(640, 480))
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(252, 252, 252))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(241, 84, 87))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(252, 252, 252))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(241, 84, 87))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(241, 84, 87))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(241, 84, 87))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        self.video_holder.setPalette(palette)
        self.video_holder.setAutoFillBackground(True)
        self.video_holder.setObjectName("video_holder")
        MainWindow.setCentralWidget(self.centralwidget)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow) 
Example 38
Project: data-structure   Author: yunowo   File: about.py    GNU General Public License v3.0 4 votes vote down vote up
def setupUi(self, about_dialog):
        about_dialog.setObjectName("about_dialog")
        about_dialog.setWindowModality(QtCore.Qt.WindowModal)
        about_dialog.resize(400, 280)
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Window, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Base, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Window, brush)
        about_dialog.setPalette(palette)
        font = QtGui.QFont()
        font.setFamily("微软雅黑")
        about_dialog.setFont(font)
        about_dialog.setModal(True)
        self.buttonbox = QtWidgets.QDialogButtonBox(about_dialog)
        self.buttonbox.setGeometry(QtCore.QRect(150, 240, 211, 32))
        self.buttonbox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonbox.setStandardButtons(QtWidgets.QDialogButtonBox.Ok)
        self.buttonbox.setObjectName("buttonbox")
        self.header = QtWidgets.QLabel(about_dialog)
        self.header.setGeometry(QtCore.QRect(150, 20, 201, 21))
        font = QtGui.QFont()
        font.setPointSize(10)
        font.setBold(True)
        font.setWeight(75)
        self.header.setFont(font)
        self.header.setObjectName("header")
        self.info = QtWidgets.QLabel(about_dialog)
        self.info.setGeometry(QtCore.QRect(150, 50, 251, 191))
        self.info.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.info.setObjectName("info")
        self.logo = QtWidgets.QLabel(about_dialog)
        self.logo.setGeometry(QtCore.QRect(20, 20, 100, 100))
        self.logo.setText("")
        self.logo.setPixmap(QtGui.QPixmap(":/icon/img/logo.png"))
        self.logo.setScaledContents(True)
        self.logo.setObjectName("logo")

        self.retranslateUi(about_dialog)
        self.buttonbox.accepted.connect(about_dialog.accept)
        self.buttonbox.rejected.connect(about_dialog.reject)
        QtCore.QMetaObject.connectSlotsByName(about_dialog) 
Example 39
Project: kawaii-player   Author: kanishka-linux   File: kawaii_player.py    GNU General Public License v3.0 4 votes vote down vote up
def set_mainwindow_palette(self, fanart, first_time=None, theme=None, rgb_tuple=None):
        if theme is None or theme == 'default':
            logger.info('\n{0}:  mainwindow background\n'.format(fanart))
            if fanart.endswith('default.jpg'):
                default_dir, default_img = os.path.split(fanart)
                default_fit = os.path.join(default_dir, 'default_fit.jpg')
                if not os.path.exists(default_fit):
                    self.image_fit_option(fanart, default_fit, fit_size=1)
                fanart = default_fit
                    
            if not os.path.isfile(fanart) or self.keep_background_constant:
                fanart = self.default_background
            if os.path.isfile(fanart):
                if not self.keep_background_constant or first_time:
                    palette	= QtGui.QPalette()
                    palette.setBrush(QtGui.QPalette.Background, 
                                     QtGui.QBrush(QtGui.QPixmap(fanart)))
                    MainWindow.setPalette(palette)
                    self.current_background = fanart
        elif theme in ['system', 'transparent', 'mix', 'dark']:
            if theme == 'dark' and (first_time or rgb_tuple):
                palette	= QtGui.QPalette()
                if rgb_tuple:
                    r, g, b = rgb_tuple
                else:
                    r, g, b = self.bg_color_dark_theme
                palette.setColor(MainWindow.backgroundRole(), QtGui.QColor(r, g, b))
                MainWindow.setPalette(palette)
            if os.path.isfile(fanart) and self.layout_mode != 'Music':
                self.current_background = fanart
                if '.' in fanart and self.view_mode != "thumbnail_light":
                    fanart_name, ext = fanart.rsplit('.', 1)
                    if not fanart_name.endswith('default'):
                        fanart_new = fanart_name + '-new.' + ext
                        picn = self.image_fit_option(
                                fanart, fanart_new, fit_size=11, widget=ui.label_new
                                )
                        if os.path.exists(fanart_new):
                            self.label_new.setPixmap(QtGui.QPixmap(fanart_new, "1"))
                    else:
                        self.label_new.clear()
            else:
                self.label_new.clear() 
Example 40
Project: ELDonationTracker   Author: djotaku   File: tracker.py    GNU General Public License v3.0 4 votes vote down vote up
def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.setEnabled(True)
        Dialog.resize(985, 137)
        Dialog.setAutoFillBackground(False)
        self.graphicsView = QtWidgets.QGraphicsView(Dialog)
        self.graphicsView.setEnabled(True)
        self.graphicsView.setGeometry(QtCore.QRect(0, -10, 991, 151))
        self.graphicsView.setAutoFillBackground(False)
        self.graphicsView.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.graphicsView.setLineWidth(0)
        self.graphicsView.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        self.graphicsView.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
        brush = QtGui.QBrush(QtGui.QColor(0, 170, 0))
        brush.setStyle(QtCore.Qt.SolidPattern)
        self.graphicsView.setBackgroundBrush(brush)
        brush = QtGui.QBrush(QtGui.QColor(0, 0, 0))
        brush.setStyle(QtCore.Qt.NoBrush)
        self.graphicsView.setForegroundBrush(brush)
        self.graphicsView.setInteractive(False)
        self.graphicsView.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.graphicsView.setObjectName("graphicsView")
        self.Donation_label = QtWidgets.QLabel(Dialog)
        self.Donation_label.setGeometry(QtCore.QRect(170, 0, 811, 121))
        palette = QtGui.QPalette()
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(255, 255, 255))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Text, brush)
        brush = QtGui.QBrush(QtGui.QColor(101, 104, 106))
        brush.setStyle(QtCore.Qt.SolidPattern)
        palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Text, brush)
        self.Donation_label.setPalette(palette)
        font = QtGui.QFont()
        font.setPointSize(43)
        font.setBold(True)
        font.setWeight(75)
        font.setKerning(True)
        self.Donation_label.setFont(font)
        self.Donation_label.setText("")
        self.Donation_label.setTextFormat(QtCore.Qt.PlainText)
        self.Donation_label.setScaledContents(False)
        self.Donation_label.setWordWrap(True)
        self.Donation_label.setObjectName("Donation_label")

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog) 
Example 41
Project: AnimeWatch   Author: kanishka-linux   File: animeWatch.py    GNU General Public License v3.0 4 votes vote down vote up
def addToLibrary(self):
		global home
		#self.LibraryDialog.show()
		self.LibraryDialog = QtWidgets.QDialog()
		self.LibraryDialog.setObjectName(_fromUtf8("Dialog"))
		self.LibraryDialog.resize(582, 254)
		self.listLibrary = QtWidgets.QListWidget(self.LibraryDialog)
		self.listLibrary.setGeometry(QtCore.QRect(20, 20, 341, 192))
		self.listLibrary.setObjectName(_fromUtf8("listLibrary"))
		self.AddLibraryFolder = QtWidgets.QPushButton(self.LibraryDialog)
		self.AddLibraryFolder.setGeometry(QtCore.QRect(420, 50, 94, 27))
		self.AddLibraryFolder.setObjectName(_fromUtf8("AddLibraryFolder"))
		self.RemoveLibraryFolder = QtWidgets.QPushButton(self.LibraryDialog)
		self.RemoveLibraryFolder.setGeometry(QtCore.QRect(420, 90, 94, 27))
		self.RemoveLibraryFolder.setObjectName(_fromUtf8("RemoveLibraryFolder"))
		self.LibraryClose = QtWidgets.QPushButton(self.LibraryDialog)
		self.LibraryClose.setGeometry(QtCore.QRect(420, 130, 94, 27))
		self.LibraryClose.setObjectName(_fromUtf8("LibraryClose"))
		self.LibraryDialog.setWindowTitle(_translate("Dialog", "Library Setting", None))
		self.AddLibraryFolder.setText(_translate("Dialog", "ADD", None))
		self.RemoveLibraryFolder.setText(_translate("Dialog", "Remove", None))
		self.LibraryClose.setText(_translate("Dialog", "Close", None))
		self.LibraryDialog.show()
		file_name = os.path.join(home,'local.txt')
		if os.path.exists(file_name):
			lines = open_files(file_name,True)
			self.listLibrary.clear()
			for i in lines:
				i = i.replace('\n','')
				self.listLibrary.addItem(i)
		self.AddLibraryFolder.clicked.connect(self.addFolderLibrary)
		self.RemoveLibraryFolder.clicked.connect(self.removeFolderLibrary)
		self.LibraryClose.clicked.connect(self.LibraryDialog.close)
		
		self.LibraryClose.setStyleSheet("font: bold 12px;color:white;background:rgba(0,0,0,30%);border:rgba(0,0,0,30%);border-radius: 3px;")
		self.RemoveLibraryFolder.setStyleSheet("font: bold 12px;color:white;background:rgba(0,0,0,30%);border:rgba(0,0,0,30%);border-radius: 3px;")
		self.AddLibraryFolder.setStyleSheet("font: bold 12px;color:white;background:rgba(0,0,0,30%);border:rgba(0,0,0,30%);border-radius: 3px;")
		self.listLibrary.setStyleSheet("""QListWidget{
		font: bold 12px;color:white;background:rgba(0,0,0,30%);
		border:rgba(0,0,0,30%);border-radius: 3px;
		}
		QListWidget:item:selected:active {
		background:rgba(0,0,0,20%);
		color: violet;
		}
		QListWidget:item:selected:inactive {
		border:rgba(0,0,0,30%);
		}
		QMenu{
			font: bold 12px;color:black;background-image:url('1.png');
		}
		""")
		picn = self.default_background
		palette	= QtGui.QPalette()
		palette.setBrush(QtGui.QPalette.Background,QtGui.QBrush(QtGui.QPixmap(picn)))
		self.LibraryDialog.setPalette(palette) 
Example 42
Project: AnimeWatch   Author: kanishka-linux   File: animeWatch.py    GNU General Public License v3.0 4 votes vote down vote up
def addToLibrary(self):
		global home
		#self.LibraryDialog.show()
		self.LibraryDialog = QtWidgets.QDialog()
		self.LibraryDialog.setObjectName(_fromUtf8("Dialog"))
		self.LibraryDialog.resize(582, 254)
		self.listLibrary = QtWidgets.QListWidget(self.LibraryDialog)
		self.listLibrary.setGeometry(QtCore.QRect(20, 20, 341, 192))
		self.listLibrary.setObjectName(_fromUtf8("listLibrary"))
		self.AddLibraryFolder = QtWidgets.QPushButton(self.LibraryDialog)
		self.AddLibraryFolder.setGeometry(QtCore.QRect(420, 50, 94, 27))
		self.AddLibraryFolder.setObjectName(_fromUtf8("AddLibraryFolder"))
		self.RemoveLibraryFolder = QtWidgets.QPushButton(self.LibraryDialog)
		self.RemoveLibraryFolder.setGeometry(QtCore.QRect(420, 90, 94, 27))
		self.RemoveLibraryFolder.setObjectName(_fromUtf8("RemoveLibraryFolder"))
		self.LibraryClose = QtWidgets.QPushButton(self.LibraryDialog)
		self.LibraryClose.setGeometry(QtCore.QRect(420, 130, 94, 27))
		self.LibraryClose.setObjectName(_fromUtf8("LibraryClose"))
		self.LibraryDialog.setWindowTitle(_translate("Dialog", "Library Setting", None))
		self.AddLibraryFolder.setText(_translate("Dialog", "ADD", None))
		self.RemoveLibraryFolder.setText(_translate("Dialog", "Remove", None))
		self.LibraryClose.setText(_translate("Dialog", "Close", None))
		self.LibraryDialog.show()
		file_name = os.path.join(home,'local.txt')
		if os.path.exists(file_name):
			lines = open_files(file_name,True)
			self.listLibrary.clear()
			for i in lines:
				i = i.replace('\n','')
				self.listLibrary.addItem(i)
		self.AddLibraryFolder.clicked.connect(self.addFolderLibrary)
		self.RemoveLibraryFolder.clicked.connect(self.removeFolderLibrary)
		self.LibraryClose.clicked.connect(self.LibraryDialog.close)
		
		self.LibraryClose.setStyleSheet("font: bold 12px;color:white;background:rgba(0,0,0,30%);border:rgba(0,0,0,30%);border-radius: 3px;")
		self.RemoveLibraryFolder.setStyleSheet("font: bold 12px;color:white;background:rgba(0,0,0,30%);border:rgba(0,0,0,30%);border-radius: 3px;")
		self.AddLibraryFolder.setStyleSheet("font: bold 12px;color:white;background:rgba(0,0,0,30%);border:rgba(0,0,0,30%);border-radius: 3px;")
		self.listLibrary.setStyleSheet("""QListWidget{
		font: bold 12px;color:white;background:rgba(0,0,0,30%);
		border:rgba(0,0,0,30%);border-radius: 3px;
		}
		QListWidget:item:selected:active {
		background:rgba(0,0,0,20%);
		color: violet;
		}
		QListWidget:item:selected:inactive {
		border:rgba(0,0,0,30%);
		}
		QMenu{
			font: bold 12px;color:black;background-image:url('1.png');
		}
		""")
		picn = self.default_background
		palette	= QtGui.QPalette()
		palette.setBrush(QtGui.QPalette.Background,QtGui.QBrush(QtGui.QPixmap(picn)))
		self.LibraryDialog.setPalette(palette)