Bug 508281 - No way to create a button for "Format document" action
Summary: No way to create a button for "Format document" action
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (other bugs)
Version First Reported In: 23.08.5
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-08-15 11:53 UTC by qazerr
Modified: 2025-08-25 18:01 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments
edit toolbar does not have "format" document action (94.83 KB, image/png)
2025-08-24 11:23 UTC, qazerr
Details
list of toolbars (157.71 KB, image/png)
2025-08-24 17:31 UTC, qazerr
Details
screenshot_waqar (59.32 KB, image/png)
2025-08-24 19:58 UTC, Waqar Ahmed
Details

Note You need to log in before you can comment on or make changes to this bug.
Description qazerr 2025-08-15 11:53:52 UTC
SUMMARY
There is no "menu item" and no way to create a button for "Format document" action.
There is only a possibility to assign hotkey to "Format document" action.
But if you need this feature rarely -  menu item or button is more convenient.
Thank you.

STEPS TO REPRODUCE
1. see menu items - no "Format document"
2. try to add button and see available actions - no "Format document"

OBSERVED RESULT
There is only a possibility to assign hotkey to "Format document" action.

EXPECTED RESULT
"menu item" and a way to create a button for "Format document" action.

SOFTWARE/OS VERSIONS
Operating System: Kubuntu 24.04
KDE Plasma Version: 5.27.12
KDE Frameworks Version: 5.115.0
Qt Version: 5.15.13
Kernel Version: 6.8.0-71-generic (64-bit)
Graphics Platform: X11

ADDITIONAL INFORMATION
Comment 1 Waqar Ahmed 2025-08-15 16:10:50 UTC
Thanks for reporting. This is fixed in newer versions.
Comment 2 qazerr 2025-08-15 16:12:24 UTC
(In reply to Waqar Ahmed from comment #1)
> Thanks for reporting. This is fixed in newer versions.

ah, i see. do you know in which version this is fixed? thanks.
Comment 3 qazerr 2025-08-24 11:12:59 UTC
so i installed latest version 25.08.0. and it has only menu item.
but there is still no way to add button.

would it be possible to add ability to add button as well?
thanks you.
Comment 4 Waqar Ahmed 2025-08-24 11:16:55 UTC
Edit the toolbar and add the format document action to the toolbar
Comment 5 qazerr 2025-08-24 11:23:13 UTC
Created attachment 184393 [details]
edit toolbar does not have "format" document action
Comment 6 qazerr 2025-08-24 11:23:31 UTC
(In reply to Waqar Ahmed from comment #4)
> Edit the toolbar and add the format document action to the toolbar

i tried that before writing, of course.
there is no such action ("format document") available. i attached screenshot.
Comment 7 Waqar Ahmed 2025-08-24 14:35:37 UTC
There are other toolbars in the drop down, "mainToolbar <formatplugin>" has that action.
Comment 8 qazerr 2025-08-24 17:31:58 UTC
Created attachment 184403 [details]
list of toolbars
Comment 9 qazerr 2025-08-24 17:32:32 UTC
(In reply to Waqar Ahmed from comment #7)
> There are other toolbars in the drop down, "mainToolbar <formatplugin>" has
> that action.

but there is no such toolbar in my Kate. i attached the screenshot.
Comment 10 Waqar Ahmed 2025-08-24 19:58:14 UTC
Created attachment 184408 [details]
screenshot_waqar

Not sure why its not appearing for you. Attaching the screenshot of how it looks like here.
Comment 11 Waqar Ahmed 2025-08-24 19:59:28 UTC
Are you sure the plugin is enabled?
Comment 12 qazerr 2025-08-24 20:11:32 UTC
(In reply to Waqar Ahmed from comment #11)
> Are you sure the plugin is enabled?

yes, it is enabled. i see "format document" in menu. i can use that menu item and hot key - formatting works.
but there is no toolbar for that plugin.

also if i enable "build&run" , "kate debugger" and "keyboard macros" plugins -  "kate debugger" and "keyboard macros" have toolbars, but "build&run" does not (but in your screenshot i see that you have toolbar for it).

this is very strange.

i use kate 25.08.0 from snap.
Comment 13 qazerr 2025-08-24 20:43:09 UTC
for test i also installed Kate 25.08.0 from flatpak - same issue.
Comment 14 Waqar Ahmed 2025-08-24 20:48:32 UTC
Maybe a snap issue...

You can try to right click on the menu item and add the action to toolbar
Comment 15 qazerr 2025-08-24 20:56:24 UTC
(In reply to Waqar Ahmed from comment #14)
> Maybe a snap issue...
> 
> You can try to right click on the menu item and add the action to toolbar

right click works the same as left click, for me.

and same issue in flatpak. so i am not sure that this is snap issue.
Comment 16 Christoph Cullmann 2025-08-24 21:52:29 UTC
Don't see that toolbar in my master build either.
Comment 17 Waqar Ahmed 2025-08-25 06:47:20 UTC
Git commit ed7de7bc592b0d98be760e67e96d885ccf40efee by Waqar Ahmed.
Committed on 25/08/2025 at 06:46.
Pushed by waqar into branch 'master'.

Add toolbar to formatplugin

M  +3    -0    addons/format/ui.rc

https://invent.kde.org/utilities/kate/-/commit/ed7de7bc592b0d98be760e67e96d885ccf40efee
Comment 18 Waqar Ahmed 2025-08-25 06:52:19 UTC
Seems like I have the toolbar from the days when "right click" on menu items was still working. I have pushed a fix, but you could fix it by modifying the xml file locally. For me, the file is ~/.local/share/kxmlgui5/formatplugin/ui.rc. In the case of snap or flatpak, the location of this file will be different. Add the following line just before the </gui> line.

    <ToolBar name="mainToolBar" noMerge="1"><text>Format Plugin Toolbar</text></ToolBar>
Comment 19 qazerr 2025-08-25 11:25:37 UTC
(In reply to Waqar Ahmed from comment #18)
> Seems like I have the toolbar from the days when "right click" on menu items
> was still working. I have pushed a fix, but you could fix it by modifying
> the xml file locally. For me, the file is
> ~/.local/share/kxmlgui5/formatplugin/ui.rc. In the case of snap or flatpak,
> the location of this file will be different. Add the following line just
> before the </gui> line.
> 
>     <ToolBar name="mainToolBar" noMerge="1"><text>Format Plugin
> Toolbar</text></ToolBar>

now i have panel. thank you!
i see that you also fixed build plugin.

about
>from the days when "right click" on menu items

so, should "right click" work on menu items or not?
just curious.
Comment 20 Waqar Ahmed 2025-08-25 14:16:49 UTC
> so, should "right click" work on menu items or not?

It should work, but is broken atm. Seems like Qt is not sending context menu event to QMenu.
Comment 21 qazerr 2025-08-25 18:01:28 UTC
(In reply to Waqar Ahmed from comment #20)
> > so, should "right click" work on menu items or not?
> 
> It should work, but is broken atm. Seems like Qt is not sending context menu
> event to QMenu.

Should I create a new bug about this? Or this  bug already reported?