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

Use a custom widget instead of QScrollArea/ImageLabel/CompositeImageLabel combos #13

Open
irydacea opened this issue Apr 25, 2024 · 0 comments

Comments

@irydacea
Copy link
Owner

The current approach of using QScrollArea + specialised child widgets to display the image preview is spectacularly clunky and requires MainWindow to handle more special information about the original image and its transformed version than it really should, as well as manually resize the xImageLabel widgets according to the current zoom level. These will become major hindrances when we eventually move to an MDI model. It also makes it impossible to implement any kind of visual indication for Swipe views that spans beyond the actual image's vertical extents and into the empty vertical space around it in its view container.

Furthermore, KDE Plasma 6's Breeze style has major issues with this approach because we do not handle mouse events in the widgets themselves as we are expected to do, so in order to prevent Breeze from stealing our events, we are forced to disable the style's window dragging for the entire main window rather than just those widgets, unlike with KDE Plasma 5's Breeze — even the way we do this is by setting an undocumented internal attribute.

setProperty("_kde_no_window_grab", true);

Just yucky code all around.

It generally makes more sense to use a custom widget, or potentially QGraphicsView, to avoid issues. I already do have a prototype using a subclass of the latter in a private branch, which I want to resume work on after v0.5.0 is out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant