Bug 154745 - Basic Dialogs: Runtime Appearance differs from Editor (spin buttons, dropdown list) on Linux
Summary: Basic Dialogs: Runtime Appearance differs from Editor (spin buttons, dropdown...
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
7.3.7.2 release
Hardware: All Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-10 11:13 UTC by Kai Struck
Modified: 2023-05-29 18:02 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Comparison_Dialogues_Editor-vs-Runtime (113.06 KB, image/png)
2023-04-10 11:14 UTC, Kai Struck
Details
Odt for easy testing Dialogue (42.81 KB, application/vnd.oasis.opendocument.text)
2023-04-12 13:19 UTC, Kai Struck
Details
Comparison_Dialogues_Editor_vs_Runtime_NativeWidgetLook_False (224.87 KB, application/pdf)
2023-04-18 21:20 UTC, Kai Struck
Details
Macro_Dialogue_Comparison_Test.odt (21.39 KB, application/vnd.oasis.opendocument.text)
2023-04-25 17:23 UTC, Kai Struck
Details
Macro_Dialogue_Comparison_Test3.odt (24.11 KB, application/vnd.oasis.opendocument.text)
2023-04-29 17:44 UTC, Kai Struck
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kai Struck 2023-04-10 11:13:19 UTC
Description:
On newer LibreOffice Versions (7) in Linux the rendering of spin buttons and dropdown lists in Dialogues created in the Basic Dialogue Editor is very different at runtime.
It looks like it uses parts of the UI instead what you see in the Editor.
Instead of little up/down Arrows it uses huge +/- Buttons.
This destroys the layout of custom macro dialogues and makes them unusable.

Steps to Reproduce:
1.Create a Dialogue in the Basic Dialogue Editor with a numeric field with spin Buttons
2.Run it or use the preview

Actual Results:
Spin Buttons are huge +/- Buttons

Expected Results:
Spin Buttons should look like the little arrows you see in the Editor.


Reproducible: Always


User Profile Reset: No

Additional Info:
Tested in different Linux Distros: Linux Mint, Lubuntu, Q4OS in VirtualBox

Linux Mint: 
Version: 7.3.7.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 2; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: de-DE (de_DE.UTF-8); UI: de-DE
Ubuntu package version: 1:7.3.7-0ubuntu0.22.04.2
Calc: threaded
Comment 1 Kai Struck 2023-04-10 11:14:37 UTC
Created attachment 186563 [details]
Comparison_Dialogues_Editor-vs-Runtime
Comment 2 Kai Struck 2023-04-12 13:19:06 UTC
Created attachment 186610 [details]
Odt for easy testing Dialogue

To be able to invoke the basic Dialogue by pressing on the button enable macros in security options.
Comment 3 Kai Struck 2023-04-16 12:44:05 UTC
It seems to me that the wrong ui elements are used. Instead of the elements of the form-controls that are ok now the dialogs use the main ui-elements.
This makes the editor useless
Comment 4 Buovjaga 2023-04-17 10:44:51 UTC
I tested your file with many different versions and it is like this with gtk3 already in version 5.2. So nothing that changed in version 7 as far as I can tell.
Comment 5 Kai Struck 2023-04-17 22:02:11 UTC
Thanks for testing.
It worked ok with LO 4.4.7.2 on Lubuntu. 
This is when I created these extensions:
https://extensions.libreoffice.org/en/extensions/show/change-multiple-images-in-writer-pictool
https://extensions.libreoffice.org/en/extensions/show/chorddiagrams
https://extensions.libreoffice.org/en/extensions/show/chordtransposer

and a lot more of dialogues for this project:
http://struckkai.blogspot.de/2015/04/libreofficesongbookarchitect.html

All these are nowadays only usable on Windows and broken on Linux (although they look ok in the Editor on the Linux Versions!!!)

So I'm asking for a solution to make the dialogues appear the same as they are constucted in the Editor.
Comment 6 Mike Kaganski 2023-04-18 07:12:06 UTC
So the bug really is that the editor does not use the proper main elements (i.e., the opposite)? Because I doubt that using inconsistent UI is OK.

A workaround for OP could be using gen VCL plugin?
Comment 7 Caolán McNamara 2023-04-18 09:59:55 UTC
It was always basically this way. There's no great solution that won't cause a pitch fork wielding march. But vcl has EnableNativeWidget(false) to turn off the (older) use system theme for vcl widgets stuff which would make the basic dialogs look like they do during editing so that is possible to do.
Comment 8 Kai Struck 2023-04-18 21:18:19 UTC
Thank you!

Indeed I can get better results by using this switch for Linux:

if getGUIType>1 then oPicDlg.getPeer().setProperty( "NativeWidgetLook", False ) 

This helps a lot and makes the Dialogues appear almost like in the Editor.

Now refine the problem to this:
Too large height of Number- and Textfields with spin buttons or arrows.
(Number- and Textfields without spin buttons or arrows are correct.)

This is the case with or without NativeWidgetLook on all Linux/Libreoffice combinations I tried.

The PDF shows a comparison.
Comment 9 Kai Struck 2023-04-18 21:20:57 UTC
Created attachment 186768 [details]
Comparison_Dialogues_Editor_vs_Runtime_NativeWidgetLook_False

The Comparison shows that on Linux all Text- and Number-Fields that have spin button or dropdown arrows have a too large height.
Comment 10 Kai Struck 2023-04-25 17:23:10 UTC
Created attachment 186923 [details]
Macro_Dialogue_Comparison_Test.odt

This is a .odt for testing the size of Textfields and Numeric Fields with and without spinbuttons or dropdown arrows.

Ther are 2 buttons for invoking the dialogue with or without setting NativeWidgetLook=False

On Windows the height of all fields are the same, on Linux they are different.
Comment 11 Kai Struck 2023-04-25 17:51:52 UTC
ah ok, there is a minimum height for these fields to show at runtime.

On Windows you can go down to 10, on Linux only about 16.
Comment 12 Kai Struck 2023-04-29 17:44:03 UTC
Created attachment 187008 [details]
Macro_Dialogue_Comparison_Test3.odt

I can now narrow down the bug:
Small Numeric and Text-Boxes render too large at runtime on Linux (wrong height)

If NativeWidgetLook is set to False then I can fix the size of the boxes during runtime by resizing them. (adding 1 then immediately subtracting 1)
This only works with the NativeWidgetLook=False-Version. It has no effect on native Dialog.

Here's a test file to run a dialog with
1.NativeWidgetLook=True
2.NativeWidgetLook=False

The dialog has a button to fix the wrong size. It only works on 2. (and shouldn't be needed at all - as on Windows)

(Please tell me if I should file a new bug instead of posting here.)
Comment 13 Kai Struck 2023-05-02 12:27:22 UTC
I experience this bug:
https://bugs.documentfoundation.org/show_bug.cgi?id=154745#c12

in:
LibreOffice 7.3.7.2 on Linux Mint 21 
LibreOffice 7.3.2.2 on Lubuntu 22.04
LibreOffice 7.0.4.2 on Q4OS Trinity

but not in:
Openoffice 4.1.13 on Linux Mint 21
LibreOffice 5.0.3.2 on Linux Mint 17.3 Cinnamon
Comment 14 Kai Struck 2023-05-11 16:37:45 UTC
Can anybody confirm comment 12?

(Please tell me if I should file a new bug instead of posting here.)