Fix incorrect height adjustment of the command line#5336
Fix incorrect height adjustment of the command line#5336vadi2 merged 1 commit intoMudlet:developmentfrom
Conversation
|
Hey there! Thanks for helping Mudlet improve. 🌟 Test versionsYou can directly test the changes here:
No need to install anything - just unzip and run. |
bf4c773 to
91d02cb
Compare
|
clang-tidy review says "All clean, LGTM! 👍" |
|
One observation: how does it act on a HiDPI screen? |
|
It's looking good on a 2K display (acer chromebook 713). Using a green command line to separate it from the main text - setCmdLineStyleSheet("main", [[
QPlainTextEdit {
background: rgb(0,100,0);
color: rgb(0,200,255);
}
]])It's looking correct - But it starts to cut off letters at the bottom if you use a ridiculous font size (which people can), like 20. Could you test? |
|
Here is my prior attempt at this, could you have a look that this solution isn't affected by problems encountered there? #2725 |
|
For really big font sizes the users have to compensate by increasing the minimum command line height. Currently I have hardcoded a minimum possible height to 31 pixels (taken from buttonLayer in TConsole.cpp). Should I remove the 31 pixel limit? If the users use 31+ in the settings, the behaviour is the same with or without the limit. The important part is that the extra margin only gets added when we reach 2 lines or more.
I wouldn't mind looking into other improvements, but I think this small change fixes this specific issue with the input line. |
vadi2
left a comment
There was a problem hiding this comment.
Yep it is good. We could address the large fonts separately in another PR - by suggesting a change with a link the button could press for example.
Will give others another day to review, then the PR will be open for 3 days so good to merge 👍
|
Thanks for helping solve this, @chrio! |
Brief overview of PR changes/additions
Update the minimum height calculation in TCommandLine::adjustHeight method. Keeps the minimum size of the command line to be consistent with the icons next to the command line.
Motivation for adding to Mudlet
Fixes the behaviour where the command line height grows as soon as you start to typing. The old behaviour was making the minimum command line height twice that of the font height, which for many users is bigger than the icons next to it.
Other info (issues closed, discussion etc)
Release post highlight
Improved the command line height adjustment when typing