def pickBgColor(self): color = QtWidgets.QColorDialog.getColor( initial=NoteManager.bgColor, title='Select Background Color') if color.isValid(): self.bgColorButton.setStyleSheet('background-color: ' + color.name() + ';') NoteManager.updateBgColor(color)
def pickTextColor(self): color = QtWidgets.QColorDialog.getColor(NoteManager.textColor, title='Select Text Color') if color.isValid(): self.textColorButton.setStyleSheet('background-color: ' + color.name() + ';') NoteManager.updateTextColor(color)
def updateFontButtonLabel(self, font): name = None weight = '' style = '' fontFamily = font.family() fontWeight = font.weight() fontStyle = font.style() if fontWeight == QFont.Thin: weight = 'Thin' elif fontWeight == QFont.ExtraLight: weight = 'ExtraLight' elif fontWeight == QFont.Light: weight = 'Light' elif fontWeight == QFont.Normal: weight = '' elif fontWeight == QFont.Medium: weight = 'Medium' elif fontWeight == QFont.DemiBold: weight = 'DemiBold' elif fontWeight == QFont.Bold: weight = 'Bold' elif fontWeight == QFont.ExtraBold: weight = 'ExtraBold' elif fontWeight == QFont.Black: weight = 'Black' if fontStyle == QFont.StyleNormal: style = '' elif fontStyle == QFont.StyleItalic: style = 'Italic' elif fontStyle == QFont.StyleOblique: style = 'Oblique' name = fontFamily + ' ' + weight + ' ' + style self.fontButton.setText(name + ' | ' + str(font.pointSize())) NoteManager.updateFont(font)
def toggleAlwaysOnTop(self): isAlwaysOnTop = self.alwaysOnTop.isChecked() if isAlwaysOnTop: self.showAll.setDisabled(True) self.hideAll.setDisabled(True) else: self.showAll.setDisabled(False) self.hideAll.setDisabled(False) NoteManager.toggleAlwaysOnTop(isAlwaysOnTop)
def loadNotes(): NoteManager.loadNotes()
def stop(): NoteManager.saveNotes() Engine.saveSettings()
def showAllNotes(self): NoteManager.showAllNotes()
def hideAllNotes(self): NoteManager.hideAllNotes()
def createNewNote(self): NoteManager.addNewNote()