da-rth / yasb

A highly configurable cross-platform (Windows) status bar written in Python.
MIT License
1.43k stars 80 forks source link

[FEATURE] Tauri Port - Change Style Of Bar Depending On If Window Is Maximized Or Not #81

Open TooSpooky opened 1 year ago

TooSpooky commented 1 year ago

What is the request?

Enable the ability to change the style of bar depending on whether a window is maximized or not within Komorebi.

For example when a window is not maximized it appears in this style:

BonBon_A0ULsJ7CXQ

When the window is maximized it appears like this instead:

floorp_2li8LLmPbF

Although preferably more flush fit and similar to the pre-tauri YASB where it bumps the window down instead of sitting ontop of it:

cLaUrEMjE1

Could already be possible and I'm just not familiar enough haha.

Why is it useful?

When a window is not maximized it feels more open design wise to have it in the style it comes by default, but when maximized it feels nicer to have a more flush fit while also having the bar still in view.

How could it be implemented?

Sadly not familiar with implementations, which is why i'm unsure if it's not already possible.

Thanks for your time and take care!

da-rth commented 1 year ago

This is not yet implemented but should be possible with the win32 api and a WInEventHook listener. The active window widget currently uses SetWinEventHook to listen to window foreground change events in the background.

Ideally, it'd be good to have a win32 event listener notify a bar when the current forground window has become maximised. The bar can then conditionally apply a CSS class to it's top-most container e.g. '.foreground-maximised' and you would be able to style the bar from there. I have other changes planned first, can definitely come back to this so will mark as 'to be implemented'

TooSpooky commented 1 year ago

Sounds good, I sadly don’t have the knowledge to help do that myself but would appreciate it whenever you get around to it! Thanks! Take care!

NormTurtle commented 1 year ago

how you guys are using riight now ??!

TooSpooky commented 1 year ago

@omaru-ok

Go to the main page

Select tauri-port from the dropdown

image

Clone it

cd in a command line to the src folder within it

in a command line type npm install

then type npm run tauri build

go to the src-tauri folder, go to /target/release and you'll find the exe

Have to reclone and go through the process each time he makes a change if you want it.

NormTurtle commented 1 year ago

please make a alpha release , so everyone can test who dont have rust installed, 🙏