Exemple #1
0
 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)
Exemple #2
0
 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)
Exemple #3
0
 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)
Exemple #4
0
 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)
Exemple #5
0
 def loadNotes():
     NoteManager.loadNotes()
Exemple #6
0
 def stop():
     NoteManager.saveNotes()
     Engine.saveSettings()
Exemple #7
0
 def showAllNotes(self):
     NoteManager.showAllNotes()
Exemple #8
0
 def hideAllNotes(self):
     NoteManager.hideAllNotes()
Exemple #9
0
 def createNewNote(self):
     NoteManager.addNewNote()