[kdevplatform] [Bug 335549] Plain C source formatter used instead of C++ for header files

2023-09-15 Thread Igor Kushnir
https://bugs.kde.org/show_bug.cgi?id=335549

--- Comment #5 from Igor Kushnir  ---
Git commit 2d8cafaae7ee82ab89507b384f5385f9a21d3f97 by Igor Kushnir.
Committed on 15/09/2023 at 11:57.
Pushed by igorkushnir into branch 'master'.

SourceFormatterSelectionEdit: add usage help and info

Configure Source Formatter user interface is unusual. The fact that the
Language combobox defines what is being configured and the Formatter
combobox actually configures something is not obvious (Bug 358798). The
first paragraph of the added usage help should clear this up for new
users.

The second paragraph of the usage help explains what functionality
depends on configured Formatting Styles and why correctly configuring
them is very important. The third paragraph of the usage help points out
the unobvious fact that all *.h are formatted with formatter and style
configured for C language. Piotr Mierzwinski has reported many source
formatter bugs, some of which were caused by incompletely or incorrectly
configured formatting. Hopefully the added usage help will avoid such
user misunderstanding and trouble in the future.

Both AStylePlugin and CustomScriptPlugin implement
ISourceFormatter::description(). The descriptions must have been
translated into many languages long ago, but are not used anywhere. Show
these informative descriptions in Configure Source Formatter UI.

Show the usage help and formatter descriptions as whatsThis of two added
tool buttons. This way, the information is easily discoverable by new
users and practically does not take up useful UI space. The whatsThis
popup can be displayed in two intuitive ways:
1) common: hover over the button, read the tooltip and press Shift;
2) custom: click the button.

Set formatter description whatsThis to an empty string when there are no
enabled formatter plugins. QWhatsThis never shows up when the text is
empty.

Set the tool buttons' iconSize to 22x22. Optimized icons of this size
are present in most icon themes. A button with this icon size is a pixel
or two higher than a combobox in the same row, so only a few pixels of
vertical UI space are lost.

The usage help button is positioned as close as possible to the top left
corner of the SourceFormatterSelectionEdit widget because it explains
the entire interface. The formatter description button is placed to the
right of the Formatter combobox because it describes a selected
formatter. Unfortunately, the resulting misalignment of the buttons and
comboboxes looks weird. On the other hand, the asymmetry might help the
user understand that the two comboboxes have vastly different roles.
Related: bug 358798

M  +11   -0kdevplatform/shell/sourceformatterselectionedit.cpp
M  +43   -0kdevplatform/shell/sourceformatterselectionedit.ui

https://invent.kde.org/kdevelop/kdevelop/-/commit/2d8cafaae7ee82ab89507b384f5385f9a21d3f97

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdevplatform] [Bug 335549] Plain C source formatter used instead of C++ for header files

2023-07-10 Thread Igor Kushnir
https://bugs.kde.org/show_bug.cgi?id=335549

--- Comment #4 from Igor Kushnir  ---
Git commit 65227a6fe0d5ed14107b5a80561ed8eae618eaf5 by Igor Kushnir.
Committed on 06/06/2023 at 14:37.
Pushed by igorkushnir into branch 'fix-and-refactor-formatter-selection-edit'.

SourceFormatterSelectionEdit: add usage help and info

Configure Source Formatter user interface is unusual. The fact that the
Language combobox defines what is being configured and the Formatter
combobox actually configures something is not obvious (Bug 358798). The
first paragraph of the added usage help should clear this up for new
users.

The second paragraph of the usage help explains what functionality
depends on configured Formatting Styles and why correctly configuring
them is very important. The third paragraph of the usage help points out
the unobvious fact that all *.h are formatted with formatter and style
configured for C language. Piotr Mierzwinski has reported many source
formatter bugs, some of which were caused by incompletely or incorrectly
configured formatting. Hopefully the added usage help will avoid such
user misunderstanding and trouble in the future.

Both AStylePlugin and CustomScriptPlugin implement
ISourceFormatter::description(). The descriptions must have been
translated into many languages long ago, but are not used anywhere. Show
these informative descriptions in Configure Source Formatter UI.

Show the usage help and formatter descriptions as whatsThis of two added
tool buttons. This way, the information is easily discoverable by new
users and practically does not take up useful UI space. The whatsThis
popup can be displayed in two intuitive ways:
1) common: hover over the button, read the tooltip and press Shift;
2) custom: click the button.

Set formatter description whatsThis to an empty string when there are no
enabled formatter plugins. QWhatsThis never shows up when the text is
empty.

Set the tool buttons' iconSize to 22x22. Optimized icons of this size
are present in most icon themes. A button with this icon size is a pixel
or two higher than a combobox in the same row, so only a few pixels of
vertical UI space are lost.

The usage help button is positioned as close as possible to the top left
corner of the SourceFormatterSelectionEdit widget because it explains
the entire interface. The formatter description button is placed to the
right of the Formatter combobox because it describes a selected
formatter. Unfortunately, the resulting misalignment of the buttons and
comboboxes looks weird. On the other hand, the asymmetry might help the
user understand that the two comboboxes have vastly different roles.
Related: bug 358798

M  +11   -0kdevplatform/shell/sourceformatterselectionedit.cpp
M  +43   -0kdevplatform/shell/sourceformatterselectionedit.ui

https://invent.kde.org/kdevelop/kdevelop/-/commit/65227a6fe0d5ed14107b5a80561ed8eae618eaf5

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdevplatform] [Bug 335549] Plain C source formatter used instead of C++ for header files

2021-12-16 Thread Igor Kushnir
https://bugs.kde.org/show_bug.cgi?id=335549

Igor Kushnir  changed:

   What|Removed |Added

 CC||igor...@gmail.com
 Status|REPORTED|CONFIRMED
 Ever confirmed|0   |1

--- Comment #3 from Igor Kushnir  ---
This behavior is unfortunate and all but impossible to fix. KDevelop assigns a
language to a file based on its MIME type. A proper fix is to make the Shared
MIME-info Database distinguish C++ headers from C headers, but this cannot be
implemented reliably.

Fortunately, per-project Source Formatter configuration in Project settings has
been implemented several years ago. When a project does not contain plain-C
headers that have to be formatted differently, a workaround is to configure the
same formatter and style for both C and C++ languages.

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdevplatform] [Bug 335549] Plain C source formatter used instead of C++ for header files

2018-11-20 Thread Andrew Crouthamel
https://bugs.kde.org/show_bug.cgi?id=335549

Andrew Crouthamel  changed:

   What|Removed |Added

 Resolution|WAITINGFORINFO  |---
 Status|NEEDSINFO   |REPORTED

--- Comment #2 from Andrew Crouthamel  ---
Dear Bug Submitter,

This is a reminder that this bug has been stagnant for a long time. Could you
help us out and re-test if the bug is valid in the latest version? This bug
will be moved back to REPORTED Status for manual review later, which may take a
while. If you are able to, please lend us a hand.

Thank you for helping us make KDE software even better for everyone!

-- 
You are receiving this mail because:
You are watching all bug changes.

[kdevplatform] [Bug 335549] Plain C source formatter used instead of C++ for header files

2018-11-10 Thread Andrew Crouthamel
https://bugs.kde.org/show_bug.cgi?id=335549

Andrew Crouthamel  changed:

   What|Removed |Added

 Resolution|--- |WAITINGFORINFO
 Status|REPORTED|NEEDSINFO

--- Comment #1 from Andrew Crouthamel  ---
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test
if the bug is valid in the latest version? I am setting the status to NEEDSINFO
pending your response, please change the Status back to REPORTED when you
respond.

Thank you for helping us make KDE software even better for everyone!

-- 
You are receiving this mail because:
You are watching all bug changes.