Fix KviTopicWidget label shifted down and clipped #2562
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
KviThemedLabel
has margin set to 4. While sizing topic widget this is not taken into account. This causes rendered topic label text to be shifted down and clipped at the bottom.Fix this by setting
KviThemedLabel
margin to zero and using stylesheet left and right margin properties instead.While at it, simplify management of editor widget lifecycle and widget size. Instead of doing that by hand on events, create
QStackedWidget
to operate visibility and size of label and editing widgets. Create all objects at once inKviTopicWidget
constructor, attach label widget at index 0 and aKViTaiHbox
with line editor and 3 buttons at index 1. Only operate visibility by switching current stacked widget index and letQStackedWidget
resize it's contents as needed.