Skip to content
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

Open
jhi2 opened this issue Jun 8, 2024 · 6 comments
Open

Gray background while in light mode #140

jhi2 opened this issue Jun 8, 2024 · 6 comments
Labels
question Further information is requested

Comments

@jhi2
Copy link

jhi2 commented Jun 8, 2024

image
Why does this happen? Help would be appreciated!

@rdbende
Copy link
Owner

rdbende commented Jun 9, 2024

Code?

@rdbende rdbende added the question Further information is requested label Jun 10, 2024
@jhi2
Copy link
Author

jhi2 commented Jun 10, 2024

The code is incomplete but works

Code?

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))

@rdbende
Copy link
Owner

rdbende commented Jun 11, 2024

Can you try it with plain sv-ttk? I don't know what exactly nsvttk does.

@jhi2
Copy link
Author

jhi2 commented Jun 11, 2024

nativesvttk is my fork of the repo (Remember the PR?) . It would be lisht mode.
so, with sv_ttk it would be:

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))

@littlewhitecloud
Copy link
Contributor

Can you try to use sv-ttk==2.5.5 to test again? I think there is something wrong in 2.6.0.

@jhi2
Copy link
Author

jhi2 commented Jun 29, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants