Bug 498926 - Okteta always starts zoomed out
Summary: Okteta always starts zoomed out
Status: RESOLVED FIXED
Alias: None
Product: okteta
Classification: Applications
Component: general (show other bugs)
Version: 0.26.18
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Friedrich W. H. Kossebau
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-20 14:44 UTC by mdcclxv
Modified: 2025-01-22 20:44 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 0.26.19
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mdcclxv 2025-01-20 14:44:43 UTC
SUMMARY
See the subject

STEPS TO REPRODUCE
1. Start Okteta by right-clicking a file.

OBSERVED RESULT
Content is zoomed out (73% on my system)


EXPECTED RESULT
Content should be displayed at 100% zoom.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.8.1
Comment 1 Friedrich W. H. Kossebau 2025-01-20 15:08:25 UTC
Thanks for the report. Never heard so far. Please, can you tell for a start...
* where do you take the zoom value from? (73%)
* which font have you set for fixed width fonts (see Plasma System Settings/Text & Fonts/Fonts)
Comment 2 mdcclxv 2025-01-20 23:53:42 UTC
I get the zoom value by hovering the mouse over the thumb on the slider in the status bar.

The monospaced font is Terminus TTF, 15 points. It looks just fine everywhere else, including Sublime Text editor and Konsole.

If I press Ctrl+0 Okteta zooms back at 100% and the font looks just fine, the same as in Konsole/Sublime.
Comment 3 mdcclxv 2025-01-21 00:09:24 UTC
(In reply to mdcclxv from comment #2)
> I get the zoom value by hovering the mouse over the thumb on the slider in
> the status bar.
> 
> The monospaced font is Terminus TTF, 15 points. It looks just fine
> everywhere else, including Sublime Text editor and Konsole.
> 
> If I press Ctrl+0 Okteta zooms back at 100% and the font looks just fine,
> the same as in Konsole/Sublime.

Same behavior with Liberation Mono.
Comment 4 Friedrich W. H. Kossebau 2025-01-21 12:57:52 UTC
> 15 points

Aha, that bit hinted me to the possible cause and flaw in the code. When the font size of the font set for fixed-width font is different from the general font, it triggers some bad values and then the reported behaviour.

Already have some draft locally which fixes the problem, but need to investigate a bit more what the intention of the current flawed code is (or if there is any, as I do not remember anymore why I wrote things like that). Current plan would be to have the solution in another fix release at begin of February.

Task for you: :)
can you confirm the font you set for "General font" also has a different value? (which font exactly, for reference?)
Comment 5 mdcclxv 2025-01-21 15:56:49 UTC
Yep, different value: Verdana, 11pt.
Comment 6 Friedrich W. H. Kossebau 2025-01-22 17:27:54 UTC
> Yep, different value: Verdana, 11pt.

Thanks, good,  font size being different matches also what two more people reported as very trigger, and what I see with the code.

Fixed code staged locally for landing in public soonish...
Comment 7 mdcclxv 2025-01-22 18:16:03 UTC
That's very good news. Thanks a million for such a swift resolution.
Comment 8 Friedrich W. H. Kossebau 2025-01-22 20:44:08 UTC
Git commit aef183f972398d035b1f0bc867016ae0eac9713a by Friedrich W. H. Kossebau.
Committed on 22/01/2025 at 12:35.
Pushed by kossebau into branch '0.26'.

Okteta gui: fix zoom scaling breaking on setting a font with different size
FIXED-IN: 0.26.19

M  +10   -6    gui/abstractbytearrayview_p.cpp

https://invent.kde.org/utilities/okteta/-/commit/aef183f972398d035b1f0bc867016ae0eac9713a