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

Task Manager plugin: buttons shifting position when opening or closing windows #2065

Closed
isf63 opened this issue May 20, 2024 · 6 comments · Fixed by lxqt/liblxqt#351
Closed

Comments

@isf63
Copy link
Contributor

isf63 commented May 20, 2024

Current Behavior

Taskbar buttons shift slightly when opening or closing windows

Possible Solution
Steps to Reproduce (for bugs)
  1. Set Maximum button width low enough in Task Manager settings to have all buttons stay at maximum width.
  2. Open 2 to 4 windows and then open another.

There is a subtle shift in the buttons position.

Context

Minor UX issue
Sometimes displayed eliding is affected

Affects all LXQt themes, except KDE-Plasma for me.

System Information
  • LXQt Version: 2.0.0
  • Qt Version: 6.7.0
@isf63
Copy link
Contributor Author

isf63 commented May 20, 2024

I can confirm this is unrelated to themeing by creating a blank theme (mkdir ~/.local/share/lxqt/themes/blank; touch ~/.local/share/lxqt/themes/blank/lxqt-panel.qss, and then inspecting the button widths with GammaRay. With Maximum button width set to 200px, 2 windows open the widths are: (200, 200) and 3 windows (200, 201, 200).

@tsujan
Copy link
Member

tsujan commented May 21, 2024

Yes, that may be a sign of a small miscalculation somewhere. It isn't easy to find where but, fortunately, it hasn't had a serious side effect.

@tsujan
Copy link
Member

tsujan commented Aug 5, 2024

Related to #2083 indirectly.

@tsujan
Copy link
Member

tsujan commented Aug 22, 2024

My wild guess is that, in some line(s) of code, the special property of QRect::right() (see Qt doc's note) may have been ignored, resulting in a one-pixel miscalculation. I already found and fixed one case, but it wasn't related to this report.

@tsujan
Copy link
Member

tsujan commented Aug 23, 2024

OK, the problem wasn't in lxqt-panel but in liblxqt → GridLayout::setGeometry(). After I changed its strange calculations to what looked reasonable to me, the shifting was gone.

I should check those calculations several times to make sure that I haven't missed anything. Then I'll make a PR. But in short, for a reason unknown to me, an extra one pixel was added in some places without being considered in others. I just removed it for testing.

tsujan added a commit to lxqt/liblxqt that referenced this issue Aug 23, 2024
With a horizontal layout, the item width was increased by one pixel when there was empty space, but that one pixel wasn't taken into account anywhere else — and similarly with a vertical layout. I removed it, and the occasional position shifts disappeared from task buttons of lxqt-panel.

In short, the original calculations inside `GridLayout::setGeometry` didn't seem correct to me.

Fixes lxqt/lxqt-panel#2065
@tsujan
Copy link
Member

tsujan commented Aug 23, 2024

@isf63
If you use git, please test lxqt/liblxqt#351. The panel should be restarted.

tsujan added a commit to lxqt/liblxqt that referenced this issue Aug 27, 2024
With a horizontal layout, the item width was increased by one pixel when there was empty space, but that one pixel wasn't taken into account anywhere else — and similarly with a vertical layout. I removed it, and the occasional position shifts disappeared from task buttons of lxqt-panel.

In short, the original calculations inside `GridLayout::setGeometry` didn't seem correct to me.

Fixes lxqt/lxqt-panel#2065
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

Successfully merging a pull request may close this issue.

2 participants