python-eel / Eel

A little Python library for making simple Electron-like HTML/JS GUI apps
MIT License
6.3k stars 580 forks source link

Remove the Border #585

Closed Gowixx closed 1 year ago

THEGOLDENPRO commented 2 years ago

I don't think this is possible with eel or chrome(the browser eel defaults to) but I think this can be done if you use pywebview as the browser instead. pywebview is a really good and up-to-date python browser module. I've used it with EEL before.

image

Here's a piece of code to get it up and running.

    def start(self):
        eel_thread = threading.Thread(target=self.eel_start) # Eel app start.
        eel_thread.setDaemon(True)
        eel_thread.start()

        self.webview_start() # Web browser start.

    def eel_start(self, chrome_args):
        # EEL app start.
        eel.start("web/index.html", size=(1200, 680), port=65001, mode=None, shutdown_delay=0.0)

    def webview_start(self):
        webview.create_window('App Name, 'http://localhost:65001/web/index.html', width=1200, height=680, min_size=(1200, 680))
        webview.start(debug=debug, gui="edgechromium")
THEGOLDENPRO commented 2 years ago

Sorry for leaving this unresponded for a very long while. You've probably already solved this but for future reference here is the full code pretty much.

import webview
import eel
import threading

def start_app():
    eel_thread = threading.Thread(target=eel_start) # Eel app start.
    eel_thread.setDaemon(True)
    eel_thread.start() # Run eel in a seperate thread.

    webview_start() # Start pywebview web browser.

def eel_start():
    # EEL app start.
    eel.start("web/index.html", port=8000, mode=None, shutdown_delay=0.0)

def webview_start():
    # pywebview start.
    webview.create_window("App Name", "http://localhost:8000/web/index.html")
    webview.start()

start_app() # Run app.