lxqt / lxqt-config

Tools to configure LXQt and the underlying operating system
https://lxqt.github.io
GNU Lesser General Public License v2.1
86 stars 60 forks source link

Applying an icon theme causes the icon theme grid columns to expand and become difficult to read #1032

Closed ArrayBolt3 closed 2 months ago

ArrayBolt3 commented 2 months ago
Expected Behavior

Selecting a new icon theme in lxqt-config-appearance and clicking "Apply" should result in the icon theme being changes and the change persisting. It should NOT cause any unintentional side effects to the icon theme grid.

Current Behavior

Same as expected, except for the icon theme grid's columns grow after clicking "Apply", causing elements to go off the right side of the screen.

Possible Solution

I don't have any good ideas for solutions, but this is what I tried so far:

I debugged the code from master and narrowed the issue down to lxqt-config-appearance/iconthemeconfig.cpp, function IconThemeConfig::applyIconTheme:

m_settings->setValue(QStringLiteral("icon_theme"), theme);

Commenting out this line of code, then rebuilding and reinstalling lxqt-config, causes the icon theme changer to no longer function properly, but it also causes the strange resizing of columns to stop. The issue persists even if I comment out any or all of the other lines in the if statement this line of code is found in, whereas commenting out that line and only that line is enough to resolve the issue.

I attempted to copy the resizeColumnToContents loop from the end of initIconThemes and putting it in the applyIconTheme function, pasting it just under the m_settings->sync() line. This did not resolve the issue. I also tried clearing iconThemeList before settings its column count in initIconThemes(), then calling initIconThemes() in the applyIconTheme function. This also did not work... unless I selected and applied the same icon theme twice in a row. The first apply would break it, the second apply would fix it. I also tried removing the resizeColumnToContents loop from initIconThemes entirely, which just resulted in the table looking broken out of the starting gate.

My guess is that calling m_settings->setValue() is emitting a signal that somehow refreshes the icon theme table (how, I do not know). That event probably is failing to resize the column, resulting in the breakage. That would make sense of why setting the column sizes in applyIconTheme wouldn't work, since the signal wouldn't be handled until after applyIconTheme was finished executing. Unfortunately I've not been able to find where the signal is that's causing the problem.

Steps to Reproduce (for bugs)
  1. Click the application menu.
  2. Search for "Appearance"
  3. Click "Appearance"
  4. Click "Icon Themes"
  5. Select an icon theme that is not already active
  6. Click "Apply"
Context

Looks weird in Lubuntu 24.10.

System Information
stefonarch commented 2 months ago

If I understood you that's about the desktop grid. I can't reproduce, still if I got it right (actually this is on hyprland). Not an openbox issue?

https://github.com/user-attachments/assets/6da02cf6-fb6c-4c04-a973-031bffb028f6

tsujan commented 2 months ago

@ArrayBolt3, what do you mean by "icon theme grid"? You could attach screenshots if you don't find the exact words.

ArrayBolt3 commented 2 months ago

sorry, I intended to attach screenshots and then just forgot to.

Before:

Screenshot_20240903_151517

After selecting a new theme and clicking "Apply":

Screenshot_20240903_151545

I doubt this is Openbox-related though I can test with xfwm4.

tsujan commented 2 months ago

Thanks for the screenshot. So, it isn't about Desktop but the window itself.

I doubt this is Openbox-related

No, this isn't related to Openbox or any WM but, most probably, to Qt 6.6.X.

stefonarch commented 2 months ago

As you can see that's not the case in my video. But I can reproduce it with any WM in Debian WM with Qt 6.6.2

tsujan commented 2 months ago

OK. I'm closing this because we can't reproduce it with Qt 6.7.2.

@ArrayBolt3 If your Qt version is upgraded to ≥ 6.7.2 and you can still reproduce it, please tell us to reopen the issue. Thanks for reporting!

ArrayBolt3 commented 2 months ago

Sadly Qt 6.7+ isn't an option for Ubuntu this cycle, so I guess I'll look into patching this downstream. Thanks for your help!

tsujan commented 2 months ago

Sadly Qt 6.7+ isn't an option for Ubuntu this cycle,

That's unfortunate. I remember that Qt 6.6 had problems that were fixed in 6.7, although I don't remember what they were.

stefonarch commented 2 months ago

I think we never noticed it as users won't change icons often.