-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gray background while in light mode #140
Comments
Code? |
The code is incomplete but works
from google_auth_oauthlib.flow import Flow
from tkinter import ttk
import nativesvttk as nsv
from pathlib import Path
import tkinter as tk
import webview
from PIL import Image,ImageTk
flow = Flow.from_client_secrets_file(
f"{Path.cwd()}/googleapis.json",
scopes=['openid', 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile'],
redirect_uri=f'https://internalfiles.johnnytech.net/signme/return.html')
def window(window: tk.Tk, image, header, text, btn, btncommand):
img = Image.open(image)
width, height = img.size
# Adjust the window size based on the image dimensions
window_width = width + 100 # Add some padding
window_height = height + 200 # Add some padding for the header, text, and button
window.geometry(f"{window_width}x{window_height}")
nsv.native_theme(window)
hdr_font = ("Helvetica", 16, "bold")
hdr = ttk.Label(window, text=header, font=hdr_font)
hdr.pack()
imgtk = ImageTk.PhotoImage(img)
imglbl = ttk.Label(image=imgtk)
imglbl.pack()
txtlbl = ttk.Label(text=text)
txtlbl.pack()
button = ttk.Button(text=btn, command=btncommand)
button.pack()
window.mainloop()
def window1cmd(window1):
window1.destroy()
webview.create_window("Sign In with Google",flow.authorization_url()[0])
webview.start()
window1 = tk.Tk()
window(window1,f"{Path.cwd()}\\image.png","SignMe","Sign your apps FAST with SignMe!\n Sign In with Google to get started.","Sign In",lambda:window1cmd(window1)) |
Can you try it with plain sv-ttk? I don't know what exactly nsvttk does. |
from google_auth_oauthlib.flow import Flow
from tkinter import ttk
import sv_ttk
from pathlib import Path
import tkinter as tk
import webview
from PIL import Image,ImageTk
flow = Flow.from_client_secrets_file(
f"{Path.cwd()}/googleapis.json",
scopes=['openid', 'https://www.googleapis.com/auth/userinfo.email', 'https://www.googleapis.com/auth/userinfo.profile'],
redirect_uri=f'https://internalfiles.johnnytech.net/signme/return.html')
def window(window: tk.Tk, image, header, text, btn, btncommand):
img = Image.open(image)
width, height = img.size
# Adjust the window size based on the image dimensions
window_width = width + 100 # Add some padding
window_height = height + 200 # Add some padding for the header, text, and button
window.geometry(f"{window_width}x{window_height}")
sv_ttk.set_theme(window,"light")
hdr_font = ("Helvetica", 16, "bold")
hdr = ttk.Label(window, text=header, font=hdr_font)
hdr.pack()
imgtk = ImageTk.PhotoImage(img)
imglbl = ttk.Label(image=imgtk)
imglbl.pack()
txtlbl = ttk.Label(text=text)
txtlbl.pack()
button = ttk.Button(text=btn, command=btncommand)
button.pack()
window.mainloop()
def window1cmd(window1):
window1.destroy()
webview.create_window("Sign In with Google",flow.authorization_url()[0])
webview.start()
window1 = tk.Tk()
window(window1,f"{Path.cwd()}\\image.png","SignMe","Sign your apps FAST with SignMe!\n Sign In with Google to get started.","Sign In",lambda:window1cmd(window1)) |
Can you try to use sv-ttk==2.5.5 to test again? I think there is something wrong in 2.6.0. |
Thanks. I'll try that. |
Why does this happen? Help would be appreciated!
The text was updated successfully, but these errors were encountered: