Skip to content

Commit 2732d12

Browse files
committed
about page
1 parent eff744f commit 2732d12

File tree

6 files changed

+34
-5
lines changed

6 files changed

+34
-5
lines changed

assets/github_dark.png

1.67 KB
Loading

assets/github_light.png

1.53 KB
Loading

src/about.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import tkinter, darkdetect, webbrowser
2+
from tkinter import ttk
3+
import vars as v
4+
5+
def dark():
6+
if v.cfg["theme"] == "Dark" or (v.cfg["theme"] == "System" and darkdetect.isDark()):
7+
return True
8+
else:
9+
return False
10+
11+
def build():
12+
root = tkinter.Toplevel()
13+
root.title("About Onyx")
14+
root.geometry("550x200")
15+
root.resizable(False, False)
16+
17+
logolabel = tkinter.Label(root, image=v.logo).place(x=10, y=20)
18+
name = tkinter.Label(root, text="Onyx", font=("Segoe UI", 40, "bold")).place(x=210, y=30)
19+
version = tkinter.Label(root, text="Version {}".format(v.ver.split(" ")[0]), font=("Segoe UI", 20, "")).place(x=370, y=57)
20+
versiontype = tkinter.Label(root, text="Beta" if v.ver.endswith("beta") else "Stable", font=("Segoe UI", 20, "bold"), fg="orange" if v.ver.endswith("beta") else "green").place(x=210, y=105)
21+
github = ttk.Button(root, text=" Github Repo", image=v.github_light if dark() else v.github_dark, compound="left", command=lambda:webbrowser.open("https://github.com/not-nef/onyx")).place(x=330, y=105)

src/main.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ver = "0.6"
1+
ver = "0.6 beta"
22

33
import tkinter, ntkutils, pygments, darkdetect, sv_ttk
44
from tkinter.font import Font
@@ -7,7 +7,7 @@
77
from tkinterdnd2 import *
88
from tklinenums import TkLineNumbers
99

10-
import config, tabmanager
10+
import config, tabmanager, about
1111
import settings.UI as settingsui
1212
from settings.images import setimages
1313
import generatesize as size
@@ -95,7 +95,7 @@ def closepreview():
9595
filemenu.add_command(label="Close Preview", command=closepreview, foreground="black")
9696

9797
settingsmenu.add_command(label="Open Settings", command=settingsui.build, foreground="black")
98-
settingsmenu.add_command(label="About", state="disabled")
98+
settingsmenu.add_command(label="About", command=about.build, foreground="black")
9999

100100
if cfg["mica"]:
101101
if cfg["theme"] == "Dark" or (cfg["theme"] == "System" and darkdetect.isDark()):
@@ -137,6 +137,7 @@ def filedrop(event):
137137
v.footer = footer
138138
v.closeimg = closeimg
139139
v.theme = theme
140+
v.ver = ver
140141

141142
setimages()
142143

src/settings/images.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,7 @@ def setimages():
77
v.keyboard_light = tkinter.PhotoImage(master=v.root, file="./assets/keyboard_light.png")
88
v.keyboard_dark = tkinter.PhotoImage(master=v.root, file="./assets/keyboard_dark.png")
99
v.warn_light = tkinter.PhotoImage(master=v.root, file="./assets/warn_light.png")
10-
v.warn_dark = tkinter.PhotoImage(master=v.root, file="./assets/warn_dark.png")
10+
v.warn_dark = tkinter.PhotoImage(master=v.root, file="./assets/warn_dark.png")
11+
v.logo = tkinter.PhotoImage(master=v.root, file="./assets/logo.png")
12+
v.github_dark = tkinter.PhotoImage(master=v.root, file="./assets/github_dark.png")
13+
v.github_light = tkinter.PhotoImage(master=v.root, file="./assets/github_light.png")

src/vars.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@
1313
tabbar = ""
1414
footer = ""
1515
theme = ""
16+
ver = ""
1617

1718
brush_light = ""
1819
brush_dark = ""
1920
keyboard_light = ""
2021
keyboard_dark = ""
2122
warn_light = ""
22-
warn_dark = ""
23+
warn_dark = ""
24+
logo = ""
25+
github_dark = ""
26+
github_light = ""

0 commit comments

Comments
 (0)