From 829149ebc18479bd58ebc06b3d56929a309fba2a Mon Sep 17 00:00:00 2001 From: Jonathan Carter Date: Mon, 16 Feb 2026 19:06:32 +0200 Subject: [PATCH] Improve app frame buttons --- src/yasi-webclient | 21 +++++++++++++++--- .../disks/__pycache__/routes.cpython-313.pyc | Bin 6294 -> 6320 bytes src/yasi_applets/disks/routes.py | 16 ++++++++----- src/yasi_applets/main/header.html | 2 +- src/yasi_applets/main/help.html | 4 ++-- src/yasi_applets/main/menu.html | 3 ++- src/yasi_applets/main/quit.html | 11 +++++---- src/yasi_applets/welcome/welcome.html | 4 ++++ 8 files changed, 43 insertions(+), 18 deletions(-) diff --git a/src/yasi-webclient b/src/yasi-webclient index 9291489..ce1bdb1 100755 --- a/src/yasi-webclient +++ b/src/yasi-webclient @@ -4,6 +4,14 @@ import webview LOCATION = "http://localhost:9274/welcome" +class Api(): + def log(self, value): + print(value) + + def close(self): + window.destroy() + + def on_closed(): """ Actions to take when System Installer is closed. @@ -14,8 +22,8 @@ def on_closed(): window = webview.create_window('System Installer', LOCATION, transparent=True, easy_drag=False, frameless=True, width=1050, height=650, focus=True, zoomable=True, - confirm_close=True, resizable=True, shadow=True, - text_select=False, draggable=False + confirm_close=False, resizable=True, shadow=True, + text_select=False, draggable=True, js_api=Api() ) webview.settings = { @@ -30,6 +38,13 @@ webview.settings = { 'SHOW_DEFAULT_MENUS': True } + +def custom_logic(window): + pass + #window.toggle_fullscreen() + #window.evaluate_js('alert("Nice one brother")') + #window.destroy() + window.events.closed += on_closed #webview.start(icon='/usr/share/icons/yasi.png') -webview.start() +webview.start(custom_logic, window) diff --git a/src/yasi_applets/disks/__pycache__/routes.cpython-313.pyc b/src/yasi_applets/disks/__pycache__/routes.cpython-313.pyc index 2171935a5f84fadc42b6f61891200f7da7841156..3a33872b54621449ba81d4bc65235a2b0eee78b5 100644 GIT binary patch delta 296 zcmbPcxWSO`GcPX}0}zyHcV})8-pJ?6%6MyX4C_?48^*RDnHd%BZ`iwnXm`dZYKGU< zEH0{9?2x#q=5)i-87Qpo%J{(2^&=~jx;x`@cb|i$hs$qhTHR1J`pD10Bm04YW3v`p zIun}$(1K!+v2BxOIr+&qTEi0A=u}Q7R(4B}(YB0}1B663H}iEeF-C0W6|`YwOquK@ z^pY`mvWf5u#?sBQBDzeBb(_7#dKq;^8D&2+GcbvKU;?r}7%(ugv`aKeT;Ni<%&7Vi PBnFaIgUU{3m6!+sTxJZRGQ1Wjs4MhIOjtj;MuDg@k7GrX>5aZ$}; zhr~rSrvp|O)%;G>TvUs>u9kFBE$Oma$_)+68>&VhIazsRKQORvHfKv`Vv_}$Sqw6% zZL$_8KLw`Mb270q8gFjmTf)Q`v{_xyhLJIDa*EJP#`MX4!Y>%}H=B#-GBH+cP8I8A t)D>cs{mjh3B=Ug?$oingz{Jun(Ijz!OXV`7>PL_mNLCFhJ6T?0A^^ZYR>uGU diff --git a/src/yasi_applets/disks/routes.py b/src/yasi_applets/disks/routes.py index 964c120..3260693 100644 --- a/src/yasi_applets/disks/routes.py +++ b/src/yasi_applets/disks/routes.py @@ -19,9 +19,12 @@ def disks_welcome(): blockdevs = lsblk.list_block_devices() return render_template('disks_welcome.html', - menu=current_app.config['CONFIG']['settings']['menu'], - menu_order=current_app.config['CONFIG']['settings']['menu_order'].split(), - previous_step = previous_step_url, + menu=current_app.config['CONFIG'] + ['settings']['menu'], + menu_order=current_app.config['CONFIG'] + ['settings'] + ['menu_order'].split(), + previous_step=previous_step_url, next_step=next_step_url, blockdevs=blockdevs ) @@ -41,8 +44,11 @@ def disks_choose_disk_erase(): blockdevs = lsblk.list_block_devices() return render_template('disks_erase_menu.html', - menu=current_app.config['CONFIG']['settings']['menu'], - menu_order=current_app.config['CONFIG']['settings']['menu_order'].split(), + menu=current_app.config['CONFIG'] + ['settings']['menu'], + menu_order=current_app.config['CONFIG'] + ['settings'] + ['menu_order'].split(), previous_step = previous_step_url, next_step=next_step_url, blockdevs=blockdevs ) diff --git a/src/yasi_applets/main/header.html b/src/yasi_applets/main/header.html index 5135f41..8673acb 100644 --- a/src/yasi_applets/main/header.html +++ b/src/yasi_applets/main/header.html @@ -21,7 +21,7 @@ than a proper webapp.
- +
diff --git a/src/yasi_applets/main/help.html b/src/yasi_applets/main/help.html index b8b4d3c..3e7617d 100644 --- a/src/yasi_applets/main/help.html +++ b/src/yasi_applets/main/help.html @@ -11,8 +11,8 @@

Some keyboard tips:


    -
  • ALT+n or CTRL+PGDn moves to the next page.
  • -
  • ALT+p or CTRL+PGUp moves to the previous page.
  • +
  • + or + moves to the next page.
  • +
  • + or + moves to the previous page.

diff --git a/src/yasi_applets/main/menu.html b/src/yasi_applets/main/menu.html index dbe1f8f..6bf89d1 100644 --- a/src/yasi_applets/main/menu.html +++ b/src/yasi_applets/main/menu.html @@ -2,7 +2,8 @@