Closed camelCaseNick closed 1 year ago
Thanks @camelCaseNick !
However, the initialization of the mobile layout should not be removed (commit cce5b4c38d1ad911b8394f060eee1ec59b82d749) as an undesired effect occurs.
The problem it causes is that on the desktop the window always opens with a minimum width (605px) even though the user has set it to a smaller size. It's not a very common use case, but it shouldn't happen.
The problem it causes is that on the desktop the window always opens with a minimum width (605px) even though the user has set it to a smaller size. It's not a very common use case, but it shouldn't happen.
That does not happen to me. I have tested this on a screen with > 720px with both a start-up with of < 400px and > 720px. Also, I have tested this with a small screen with one side > 720px and the other < 720px and started Wike in portrait mode after closing it in landscape and the other way around to test this.
However, to not run into the problem you describe here, you might need my other commit. (How) Did you test this branch?
I have rearranged them to not have Wike in a potentially broken state between commits.
With the last change (by removing line 92) it now always boot in mobile layout, even when the window is large.
The solution to make everything work is to remove commit c2de100bd75c6d3814e27a2a35872a1825ecd04d. That is, leave window.py
as it is in the develop branch and only make the change to header.py
It does not always boot into mobile_layout
, because at initial allocation of the window the mobile_layout
is reevaluated, because do_size_allocate
is not only called, when the window is resized, but also at initial allocation, i.e. before the window is drawn the first time.
But if it makes you happy, I will drop the commit, as it is merely a cleanup, that does not change behaviour.
done
It does not always boot into
mobile_layout
, because at initial allocation of the window themobile_layout
is reevaluated, becausedo_size_allocate
is not only called, when the window is resized, but also at initial allocation, i.e. before the window is drawn the first time.
It happens to me.
It happens because when do_size_alloctate
is executed at initial allocation (with size > 720), as the mobile_layout
variable is set to False
it does not make the call to _set_layout
Thanks for your work!
Right, the initial _set_layout
is needed indeed. And I didn't remove in my first version. Removing that was causing this issue. Because with it, it is mobile_layout = False
initially and self._set_layout()
in init makes sure this does not happen. Sorry, the version from four hours ago was broken indeed.
No problem. The important thing is that we were able to solve it. Thank you!
As the headerbar will receive its layout update when the window is (re-)allocated its default is only used for measurement of this widget.
Therefore, it should reflect the state with minimal width to properly work with the height for width way GTK uses for allocating space.
depends on and includes ceb38a3642923eef895dbc792e894151c1fdb47e from the current develop branch
fixes #122