digitaltrails / vdu_controls

VDU controls - a control panel for monitor brightness/contrast/...
GNU General Public License v3.0
103 stars 4 forks source link

Use system-consistent icon sizing. #65

Closed RokeJulianLockhart closed 8 months ago

RokeJulianLockhart commented 8 months ago

The current iconography is unnecessarily large:

Screenshot_20231017_190229

See https://discuss.kde.org/t/qml-python3-how-to-read-icons-kcm-configured-sizes/1209/7?u=rokejulianlockhart

digitaltrails commented 8 months ago
digitaltrails commented 8 months ago

In #63 I added a setting to try and help adjust icons appropriately according to DPI. However, I've never be sure if what I've done is the right approach.

It now occurs to me that the choice of icon sizes might be more accurately determined by interrogating the default font size in use.

I've had to play similar games in the past. To detect a dark/light theme I create some text in a QLabel and test the relationship between the text and background colors. In this instance could extract a QLabel's font size (in a relevant metric) and base icon sizes around that.

RokeJulianLockhart commented 8 months ago

Does it involve a High DPI desktop or a normal one?

@digitaltrails, https://www.infobyip.com/detectmonitordpi.php states 96×96 DPI. I use a 1440p monitor.

https://github.com/digitaltrails/vdu_controls/issues/65#issuecomment-1766972372

"After" at https://github.com/digitaltrails/vdu_controls/issues/63#issuecomment-1734675375 is (more like) what I expected.

digitaltrails commented 8 months ago

In the settings dialog, try turning off the adjust for dpi setting (it will prompt to restart the app).

I think the following code might be returning True:

def is_high_dpi() -> bool:
    return adjust_for_dpi and QApplication.primaryScreen().physicalDotsPerInch() >= 160

I'll have to add some logging to see for sure.

RokeJulianLockhart commented 8 months ago

In the settings dialog, try turning off the adjust for dpi setting

I've not been able to locate it, @digitaltrails. Could you screenshot the window you refer to?

digitaltrails commented 8 months ago

image

RokeJulianLockhart commented 8 months ago

@digitaltrails, mine is different – that option is absent.

Screenshot_20231017_224145

digitaltrails commented 8 months ago

Oh, it's a new option in v.12.0, you'd need to probably download the vdu_controls.py from github and replace the version you're using - or wait for the distribution to catch up.

I thought I'd released in in v1.11, but no v1.12 only got released yesterday.

digitaltrails commented 8 months ago

Duplicate of #63 - see further info there.