Skip to content
This repository was archived by the owner on Dec 15, 2023. It is now read-only.

Commit 82db43e

Browse files
author
Samuel Sebastian Schulze
committed
add logo and weblink
1 parent 1558382 commit 82db43e

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

timesync.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import subprocess
1111
import platformdirs
1212
import languagesetup # import local file "languagesetup.py"
13+
import webbrowser
1314
print("Import finished.")
1415

1516
#Get run_path and config-folder (create config-folder if not exist)
@@ -64,6 +65,9 @@ def aboutprogram():
6465
showinfolines = ["Datum & Uhrzeit Syncronisierer", "Entwickelt von Palace4Software", "", showversion, "", "", "Diese Software unterliegt der MIT-Lizenz."]
6566
messagebox.showinfo("Über das Programm", "\n".join(showinfolines))
6667

68+
def openweb(url):
69+
webbrowser.open(url)
70+
6771
def syncfin(successfulchecker): #Messagebox after syncronization (with multilanguagesupport)
6872
if successfulchecker.returncode == 0:
6973
if language == "1" or language == "None":
@@ -168,7 +172,7 @@ def syncstart():
168172
print("Initalize main program...")
169173
GUI = gui.Tk()
170174
GUI.title("Date/Time Syncronizer")
171-
GUI.geometry("300x375")
175+
GUI.geometry("300x400")
172176
GUI.resizable(width=False, height=False)
173177

174178
## Setup background and button
@@ -179,15 +183,15 @@ def syncstart():
179183

180184
#Headline (Title)
181185
print("Set headline...")
182-
img_path = str(run_path + "/images/icon.png")
183-
img = gui.PhotoImage(file=img_path).subsample(32)
184-
headline = gui.Label(GUI, text="Date & Time Syncronizer", font=("Liberation Serif", 13), image=img, compound="right")
186+
headline = gui.Label(GUI, text="Date & Time Syncronizer", font=("Liberation Serif", 13))
185187
headline.pack(expand=True, fill="x")
186188

187-
#Space between headline and buttons
188-
print("Set space between headline and buttons")
189-
spaceholder2 = gui.Label(GUI)
190-
spaceholder2.pack(expand=True, fill="both")
189+
#logo and space between headline and buttons
190+
print("Load logo...")
191+
img_path = str(run_path + "/images/icon.png")
192+
img = gui.PhotoImage(file=img_path).subsample(20)
193+
imageline = gui.Button(GUI, image=img, compound="center", command=lambda: openweb("https://github.com/Palace4Software/timesync"), cursor="hand2")
194+
imageline.pack(pady=15)
191195

192196
#Buttons
193197
print("Initalize buttons...")
@@ -209,10 +213,10 @@ def syncstart():
209213

210214
#Buttons (Exit, About)
211215
print("Set About button...")
212-
button7 = gui.Button(GUI, text="About", command=aboutprogram)
216+
button7 = gui.Button(GUI, text=" About ", command=aboutprogram)
213217
button7.pack(side="left")
214218
print("Set Exit button...") #must be set before button7
215-
button8 = gui.Button(GUI, text="Exit", command=exitprogram)
219+
button8 = gui.Button(GUI, text=" Exit ", command=exitprogram)
216220
button8.pack(side="right")
217221
print("Set Change language button...")
218222
button6 = gui.Button(GUI, text="Change language", command=changelang)

0 commit comments

Comments
 (0)