Download it now!
Bug 127803 - Improve lint-ui checker for UI (see comment 5)
Summary: Improve lint-ui checker for UI (see comment 5)
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Dialog
  Show dependency treegraph
 
Reported: 2019-09-26 20:07 UTC by andreas_k
Modified: 2019-11-21 15:10 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
Gnome Control Center with LibreOffice Dialog Widget Idea (278.88 KB, image/png)
2019-09-26 20:19 UTC, andreas_k
Details

Note You need to log in before you can comment on or make changes to this bug.
Description andreas_k 2019-09-26 20:07:32 UTC
LibreOffice has a guideline for dialogues [1] it's not very detailed, but can be improved.

If you have a look at the different .ui files you will see that each file is customized. Ordinary it look something like that:

- GtkFrame
  - GtkAlignment
  - GtkLabel
  - GtkGrid
    - different widgets

The problem is that GtkAlignment has .ui specific padding, GtkLabel has .ui specific attributs (bold), GtkGrid has .ui specific paddings, ...

In the end each .ui file is unique, if you want to change the global dialog layout, you have to change > 500 .ui files and than you will also have specific differences.

[1] https://wiki.documentfoundation.org/Design/PropertyDialog
Comment 1 andreas_k 2019-09-26 20:19:41 UTC
Created attachment 154567 [details]
Gnome Control Center with LibreOffice Dialog Widget Idea

My enhancement will be to have ONE specific widget that can be use in ALL .ui Dialog files and this widget is defined in the LibreOffice guidelines.

The Widget contain of an Header line with the Label and An Content Area where you can add than an GtkBox, GtkGrid element or whatever is needed for the Widget.

Padding to other Widgets are predefined, Header Layout is predefined. As I love the Gnome Control Center with the colored boxes, the colored boxes are predefined.
Comment 2 andreas_k 2019-09-26 20:22:31 UTC
I think with an additional widget we can save ~25% of the .ui code (no specific padding, no GtkAlignment widget, ...
Comment 3 andreas_k 2019-09-26 20:23:33 UTC
In addition it will maybe give LOOL the "possibility" for a better usage of the .ui dialog files.
Comment 4 andreas_k 2019-09-26 20:30:20 UTC
I will do the .ui update work. 

(Heiko will write the guideline.)

So we only need an developer to make the widget. But only the widget is needed, no additional dev work. 

So we talk about 
 - 10 % dev work
 - 70 % .ui change work (done by me)
 - 20 % guideline, usability, ...

When the work is finished
 - consistent configure layout
 - more consistent .ui files
 - less widgets (less codebase)
 - more flexibility cause change can be done centralized
 - better platform integration
Comment 5 andreas_k 2019-09-27 12:50:32 UTC
Szymon if I'd like to update the dialogues and add there some predefined layout widget would it be usefull to change something else in the .ui files for a better interoperability between desktop/browser/mobile.

http://eszkadev.blogspot.com/2019/09/native-widgets-on-mobile-for-online.html
Comment 6 Caolán McNamara 2019-09-27 13:37:27 UTC
There is a script ./bin/lint-ui.py which has some amount of functionality in it to check dialogs against the guidelines. I could see that, or something like that, being improved to find inconsistent .uis and get them fixed up. And become a check-in git hook.

I could see mass converting consistent .ui files to have different padding etc as not that difficult in the larger scheme of things.

But I think trying to use some centralized widget for all dialogs as seriously difficult. We have a stupendous amount of ui
Comment 7 andreas_k 2019-09-29 21:04:08 UTC
(In reply to Caolán McNamara from comment #6)
> But I think trying to use some centralized widget for all dialogs as
> seriously difficult. We have a stupendous amount of ui

I don't suggest to make ONE big centralized widget the idea is to have ONE widget that contain

- GtkFrame (generic)
  - GtkAlignment (generic)
    - GtkBox, GtkGrid, ... (specific)
  - GtkLabel (generic)

I'd like to merge 3 widgets (generic) and define in

- GtkFrame (generic)
  distance to other widgets
  maximal width
- GtkAlignment (generic)
  define padding
- GtkLabel
  define text attributes

cause than we can change the layout of the dialogues centralize. As you can see the centralized widget didn't offer to much complexity.

The goal should be that in the stupendous amount of ui files the developer didn't have to define ui specific paddings, ...
Comment 8 Heiko Tietze 2019-10-02 07:25:57 UTC
Wouldn't such a template work for, let's say, 50 dialogs while we have approx. 1000? Caolan's linting idea has also some charm.
Comment 9 Heiko Tietze 2019-11-21 15:10:44 UTC
This looks more like a meta ticket. We could resolve as moved since Andreas works on the topic with individual ticket but I don't want to loose Caolan's comment 6. So adjusting the summary.