DrewNaylor / Retiled

An attempt at creating a "desktop" environment mainly for Linux phones and tablets that's similar in function to some parts of Microsoft's Windows Phone 8.x, primarily the Start screen, Search app, navigation bar, Action Center, and the status bar. Development is mainly being done using the PinePhone, so that'll be the main supported device.
https://codeberg.org/DrewNaylor/Retiled
Apache License 2.0
67 stars 3 forks source link

I might've found a way to kinda do tile backgrounds, thanks to StackOverflow. #145

Closed DrewNaylor closed 1 year ago

DrewNaylor commented 2 years ago

It would require tweaking and I'm not sure about how opaque tiles would be handled alongside transparent ones, but item layers with OpacityMask appear to be how it can be done: https://stackoverflow.com/questions/66604044/qml-layer-element-reveals-element-above-it-when-they-overlap

While looking for that, I also found a page describing how to do a 20% opacity black rectangle (in Qt 4.x, so hopefully it can be ported to 6.x somewhat easily), which would be useful for making things easier to see (which is what Microsoft did for background images if there was a lot of stuff on top) if the user wants it: https://stackoverflow.com/a/26998032 Not sure how this would apply to the tile background, maybe it would just be above the background but behind the tiles or something.

DrewNaylor commented 2 years ago

For now I need to wait for qt5compat to be fixed for PySide6 in Qt 6.4, as I can't import it otherwise.

DrewNaylor commented 2 years ago

Ended up copying and pasting the first example into its own project, then modifying it so it uses the image I'm trying to use as an example wallpaper, and it appears to make the buttons see-through as expected. The main issue is that text isn't showing up because it makes everything transparent.

DrewNaylor commented 2 years ago

This might be important if I notice that image quality is reduced with the OpacityMask: https://stackoverflow.com/questions/61925379/qml-opacitymask-reduces-image-quality

DrewNaylor commented 2 years ago

Might have to try to figure out how to modify this chromakey shader so it can be used with QML/Qt instead of webgl and such: https://stackoverflow.com/a/60778766 Main page for this answer: https://stackoverflow.com/questions/60767805/chromakey-glsl-shader-with-transparent-background

Also, this repo may prove useful if I need to manually port it to Qt, as the original shader was a ShaderToy one, and it may be similar or something: https://github.com/MichaelStraube/shaders

DrewNaylor commented 1 year ago

If anyone else is reading this, I figured it out with a ShaderEffectSource that uses the image and then sets the sourceRect to be based on the image but using offsets from the tiles based on their X- and Y-values, as well as their width and height. Basically like punching out a hole just for tiles. This replaces the solid color background rectangle for tiles, but doesn't really have antialiasing that much, as far as it appears. Pressing down also doesn't keep the internal image the same, so the preview size matches the button instead of "cropping" the view as expected. You can find my implementation in ./RetiledStyles/TileBackgroundShaderEffectSource.qml.