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

[BUG] Non working examples ? #455

Closed
Kochise opened this issue Oct 13, 2021 · 14 comments
Closed

[BUG] Non working examples ? #455

Kochise opened this issue Oct 13, 2021 · 14 comments

Comments

@Kochise
Copy link

Kochise commented Oct 13, 2021

Hi, just trying the example files, yet some are acting "weird" :

enaml-main\examples\styling\banner.enaml

The dark gradient is way too dark to see it is actually a gradient. Use this instead :

'stop: 0 #1356A9, stop: 0.3 #8AAFDC, stop: 0.58 #E0E4E0, stop: 0.68 #F8D8B1, stop: 0.848 #D39B8A, stop: 0.8499 #9C7F73, stop: 0.85 #D79F88, stop: 0.851 #E2BF9B, stop: 1 #817F73)'

enaml-main\examples\templates\basic.enaml

ok_clicked and cancel_clicked are obviously not handled like intended, nothing is printed into the console.

enaml-main\examples\widgets\buttons.enaml

While selecting RadionButton from the second container (two lowest radios) you can unselect radios from the first container.

enaml-main\examples\widgets\dual_slider.enaml

Sliders' tab are way too tiny :

slider_tabs

enaml-main\examples\widgets\file_dialog.enaml

The file dialog opens relatively to its parent window (or not, even when parent=None). How is it possible to open the dialog always on screen which is the parent window yet centered ? Or best, save its position and last path for next time.

enaml-main\examples\widgets\flow_area.enaml

Item(FlowItem).Html doesn't show up until 'Ortho Stretch' is at least 1 and up or 'Preferred Height' is at least 173 and up.

enaml-main\examples\widgets\image_view.enaml

The motion of the ImageView is pretty weird because related of the spacer's width. Even if the window's height is high enough, if its width is narrowed the image goes up.

enaml-main\examples\widgets\mdi_area.enaml

Tiling : get 3 mdi windows, tile them, move the top left and top right around, tile them again, the title bar of the top right window is not redrawn correctly.

Cascading : get 3 mdi windows, cascade them, move the top left one around, cascade them again, the middle one gets buried. I mean, the position should be set to top alternatively so that we can read every title bar like the first time. Btw, is there a way to define the horizontal and vertical spacing of the tiled windows ?

mdi_area

enaml-main\examples\layout\basic\stack.enaml

Maybe there should be one.

enaml-main\examples\tutorial\plugin\plugin.enaml

Maybe there should be one.

enaml-main\examples\tutorial\scintilla\scintilla.enaml

Maybe there should be one.

@MatthieuDartiailh
Copy link
Member

Thanks for your report. Can you let me know on what OS you are running, the enaml and Qt version and how you installed enaml ?

@Kochise
Copy link
Author

Kochise commented Oct 13, 2021

Windows 10 20H2 (19042.1165) AeroLite theme
Python 3.7.9 (Spyder 5.1.5)
PyQt5 5.12.3 (Spyder 5.1.5)
enaml 0.13.0

@MatthieuDartiailh
Copy link
Member

Thanks I will have a look at those tomorrow.

Note that the flow area one may be fixed in main (see #448)

@MatthieuDartiailh
Copy link
Member

Hi, just trying the example files, yet some are acting "weird" :

enaml-main\examples\styling\banner.enaml

The dark gradient is way too dark to see it is actually a gradient. Use this instead :

'stop: 0 #1356A9, stop: 0.3 #8AAFDC, stop: 0.58 #E0E4E0, stop: 0.68 #F8D8B1, stop: 0.848 #D39B8A, stop: 0.8499 #9C7F73, stop: 0.85 #D79F88, stop: 0.851 #E2BF9B, stop: 1 #817F73)'

I agree it is too dark (maybe related to windows theme), I will update it.

enaml-main\examples\templates\basic.enaml

ok_clicked and cancel_clicked are obviously not handled like intended, nothing is printed into the console.

This has been fixed as part of #445 and will be part of the next release.

enaml-main\examples\widgets\buttons.enaml

While selecting RadionButton from the second container (two lowest radios) you can unselect radios from the first container.

I can reproduce and it is indeed very weird. I will have to investigate more.

enaml-main\examples\widgets\dual_slider.enaml

Sliders' tab are way too tiny :

slider_tabs

This I cannot reproduce.
image

enaml-main\examples\widgets\file_dialog.enaml

The file dialog opens relatively to its parent window (or not, even when parent=None). How is it possible to open the dialog always on screen which is the parent window yet centered ? Or best, save its position and last path for next time.

Enaml relies on the backend implementation there and does not expose those "advanced" (i.e. no provided by the Qt static methods) features. It may be possible to hack around though by using a lower level API on the Qt side.

enaml-main\examples\widgets\flow_area.enaml

Item(FlowItem).Html doesn't show up until 'Ortho Stretch' is at least 1 and up or 'Preferred Height' is at least 173 and up.

The resist_height was set to weak which caused the widget to fully collapsed. I will remove it since the example will be more illustrative this way.

enaml-main\examples\widgets\image_view.enaml

The motion of the ImageView is pretty weird because related of the spacer's width. Even if the window's height is high enough, if its width is narrowed the image goes up.

I agree it is weird. The simplest would be to set the hug_width of the image to strong to prevent the window from being resized. I believe other wise the system is underconstrained.

enaml-main\examples\widgets\mdi_area.enaml

Tiling : get 3 mdi windows, tile them, move the top left and top right around, tile them again, the title bar of the top right window is not redrawn correctly.

Cascading : get 3 mdi windows, cascade them, move the top left one around, cascade them again, the middle one gets buried. I mean, the position should be set to top alternatively so that we can read every title bar like the first time. Btw, is there a way to define the horizontal and vertical spacing of the tiled windows ?

mdi_area

Here again we simply directly use Qt functionalities and they do not appear to offer ways to be customized so not sure what we can do.

enaml-main\examples\layout\basic\stack.enaml

Maybe there should be one.

enaml-main\examples\tutorial\plugin\plugin.enaml

Maybe there should be one.

enaml-main\examples\tutorial\scintilla\scintilla.enaml

Maybe there should be one.

You are welcome to contribute extra examples

@MatthieuDartiailh
Copy link
Member

See #457 for some improvements

@Kochise
Copy link
Author

Kochise commented Oct 14, 2021

Thank, seems good, I'll check how it behaves IRL tomorrow.

I'll contribute to more examples, yet I'm still learning enaml the hard way (reading source code).

I'm actually summing up things (doc, hierarchy, dependencies) into a WIP "template" file, btw could you review it ?

https://github.com/Kochise/enaml-studio/blob/main/enaml-api.py

I let you find out the "syntax" describing the relationships and/or alternatives in the "trees".

@Kochise
Copy link
Author

Kochise commented Oct 15, 2021

enaml-main\examples\widgets\dual_slider.enaml
Sliders' tab are way too tiny :
slider_tabs

This I cannot reproduce.
image


Weird, I tried the normal Windows theme :

dual_slider_normal

I then switched to Aero Lite theme :

dual_slider_lite

I closed the program and reopened it :

dual_slider_lite_reopen

Hence it's not the Aero Lite theme per se, as when switching from normal theme works, yet something is definitively not right.

@MatthieuDartiailh
Copy link
Member

That is definitively a weird one. Can you try making a pure Qt reproducer ? I am wondering if we are miscalling Qt or if it is a kind of Qt bug.

@Kochise
Copy link
Author

Kochise commented Oct 15, 2021

"Pure Qt reproducer" ? You mean native C++ or PyQt5 ? Since I'm using (forced to by Spyder) an "outdated" version, maybe it is the version I'm using that is at fault. Yet, it is strange indeed.

@MatthieuDartiailh
Copy link
Member

No I meant PyQt5 (or pyside2). 5.12 is not that bad actually some people are still on 5.9

@Kochise
Copy link
Author

Kochise commented Oct 15, 2021

Ok, so I did it the "naive" way and here's what I found.

I tried the normal Windows theme :

dual_slider_pyqt5_normal

I then switched to Aero Lite theme :

dual_slider_pyqt5_lite

I closed the program and reopened it :

dual_slider_pyqt5_lite_reopen

As you can see, there's definitively something going on about the size of slider's elements. It's like they are squished. Yet it only happens at initial loading using Aero Lite theme's elements, despite looking good with normal Windows theme elements' size.

Yet it looks different from Enaml's implementation.

dual_slider_pyqt5.py.txt

@MatthieuDartiailh
Copy link
Member

The one difference I see is that your set the ticks to show on both sides. I suspect that if you use single sided ticks you will recover enaml behavior. It may be worth reporting the issue directly on Qt bug tracker.

@Kochise
Copy link
Author

Kochise commented Oct 15, 2021

Oopsie.

dual_slider_pyqt5_tickbelow_normal

dual_slider_pyqt5_tickbelow_lite

dual_slider_pyqt5_tickbelow_lite_reopen

dual_slider_pyqt5_tickbelow.py.txt

So it definitively lies on the PyQt5 side.

@Kochise Kochise changed the title Non working examples? [BUG] Non working examples? Nov 5, 2021
@Kochise Kochise changed the title [BUG] Non working examples? [BUG] Non working examples ? Nov 5, 2021
@MatthieuDartiailh
Copy link
Member

Closing since the issue stems from Qt5 not enaml.

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

No branches or pull requests

2 participants