TDEFontDialog: Fix font style matching. #164

Merged
blu.256 merged 1 commits from fix/font-styles into master 2 years ago
Collaborator

This resolves issue TDE/tde#81.

This resolves issue TDE/tde#81.
blu.256 force-pushed fix/font-styles from 5b182d3dba to 042633a711 2 years ago
Poster
Collaborator

There were several problems fixed with this commit:

a) Differently translated strings prevented matching font styles. This also resulted in awkward translations where one half of the name would be translated and the other one left as is. Fixed with a common style_name(...) function which returns the correct translation of the style string.

b) Simplistic bold/italics matching disregarded other font styles (e.g. font weights). Fixed with a loop which matches the font style by name (like done elsewhere).

There were several problems fixed with this commit: a) Differently translated strings prevented matching font styles. This also resulted in awkward translations where one half of the name would be translated and the other one left as is. Fixed with a common `style_name(...)` function which returns the correct translation of the style string. b) Simplistic bold/italics matching disregarded other font styles (e.g. font weights). Fixed with a loop which matches the font style by name (like done elsewhere).
Poster
Collaborator

@SlavekB can you please test this?

@SlavekB can you please test this?
SlavekB reviewed 2 years ago
SlavekB left a comment
Owner

So far I haven't done a test, but there is one note – see below.

So far I haven't done a test, but there is one note – see below.
familyListBox->setCurrentItem( 0 );
styleListBox->setCurrentItem(style);
styleListBox->setCurrentItem( 0 );
Owner

It seems that the call setCurrentItem(...) leads many other calls, such as the selectionChanged() signal and perhaps also drawing in the user interface. Therefore, it seems clumsy to call it 2× – once before the loop and the second inside the loop. I propose to modify the code so that setCurrentItem() is called once.

It seems that the call `setCurrentItem(...)` leads many other calls, such as the `selectionChanged()` signal and perhaps also drawing in the user interface. Therefore, it seems clumsy to call it 2× – once before the loop and the second inside the loop. I propose to modify the code so that `setCurrentItem()` is called once.
Poster
Collaborator

Did not think of the possible overhead because my test was fine. Now it is probably solved.

Did not think of the possible overhead because my test was fine. Now it is probably solved.
Owner

Great, thank you, that's exactly how I meant it.

Great, thank you, that's exactly how I meant it.
blu.256 marked this conversation as resolved
blu.256 force-pushed fix/font-styles from 042633a711 to e902187194 2 years ago
Owner

I did a test and while in TCC it seems to be okay, in KWord I still observe the same problem.

I did a test and while in TCC it seems to be okay, in KWord I still observe the same problem.
Poster
Collaborator

Problem confirmed.

Strange, maybe Kword uses another font picker? I'll take a look at its source.

Problem confirmed. Strange, maybe Kword uses another font picker? I'll take a look at its source.
Poster
Collaborator

Discussion of KWord (KOffice) issue continued in issue TDE/koffice#22.

Discussion of KWord (KOffice) issue continued in issue TDE/koffice#22.
Owner

Should we merge this PR as is and treat the problem of KWord as a separate bug (already tracked in TDE/koffice#22)?

Should we merge this PR as is and treat the problem of KWord as a separate bug (already tracked in TDE/koffice#22)?
SlavekB approved these changes 2 years ago
SlavekB left a comment
Owner

It works well – nothing seems to prevent merging.
The case of KOffice will be solved separately.

It works well – nothing seems to prevent merging. The case of KOffice will be solved separately.
blu.256 added this to the R14.0.13 release milestone 2 years ago
blu.256 merged commit e902187194 into master 2 years ago
blu.256 deleted branch fix/font-styles 2 years ago
Poster
Collaborator

Merged together with TDE/koffice#24.

Merged together with TDE/koffice#24.

Reviewers

SlavekB approved these changes 2 years ago
The pull request has been merged as e902187194.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: TDE/tdelibs#164
Loading…
There is no content yet.