Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix KviTopicWidget label shifted down and clipped #2562

Merged
merged 1 commit into from
Nov 13, 2023

Conversation

i-garrison
Copy link
Contributor

@i-garrison i-garrison commented Nov 11, 2023

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 in KviTopicWidget constructor, attach label widget at index 0 and a KViTaiHbox with line editor and 3 buttons at index 1. Only operate visibility by switching current stacked widget index and let QStackedWidget resize it's contents as needed.

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 in
KviTopicWidget constructor, attach label widget at index 0 and a KViTaiHbox
with line editor and 3 buttons at index 1. Only operate visibility by switching
current stacked widget index and let QStackedWidget resize it's contents as
needed.
@i-garrison i-garrison force-pushed the pr/fix-topic-widget-label-height branch from 6396839 to 2046ecf Compare November 12, 2023 07:13
Copy link
Contributor

@ctrlaltca ctrlaltca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@ctrlaltca ctrlaltca merged commit 1314895 into kvirc:master Nov 13, 2023
2 checks passed
@ctrlaltca
Copy link
Contributor

Merged, thank you!

@i-garrison i-garrison deleted the pr/fix-topic-widget-label-height branch November 13, 2023 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants