-
Notifications
You must be signed in to change notification settings - Fork 0
/
Help.py
42 lines (34 loc) · 1.7 KB
/
Help.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
from PyQt5.QtWidgets import QDialog, QHBoxLayout, QVBoxLayout, QPushButton, QLabel
from PyQt5.QtCore import QSize, QSettings, QFile, QTextStream
from PyQt5.QtGui import QIcon
import webbrowser
class help_dialog(QDialog):
def __init__(self):
super().__init__()
layout = QVBoxLayout()
self.setLayout(layout)
self.setMinimumSize(QSize(300, 150))
self.getSettingsValues()
self.setWindowTitle('noted Help')
#Check and Change dialog theme
self.theme = self.selected_theme.value('Theme')
if self.theme == None or self.theme == 'Light Mode':
file = QFile("Themes/light.qss")
file.open(QFile.ReadOnly)
stream = QTextStream(file)
self.setStyleSheet(str(stream.readAll()))
elif self.theme == 'Dark Mode':
file = QFile("Themes/dark.qss")
file.open(QFile.ReadOnly)
stream = QTextStream(file)
self.setStyleSheet(str(stream.readAll()))
#Markdown Tutorial
mk_layout = QHBoxLayout()
self.mk_tut = QPushButton(QIcon('Icons/Markdown_doc.png'),"MarkDown Tutorial \nOpen official Github Markdown", self)
self.mk_tut.clicked.connect(lambda: webbrowser.open('https://www.markdownguide.org'))
self.mk_tut.setObjectName('mk')
layout.addWidget(self.mk_tut)
def getSettingsValues(self):
#Settings Keys
self.selected_theme = QSettings('noted', 'Selected Theme')
self.hide()