Bug 46583 - borders tabpage UI doesn't display border properties nicely when lines are different
Summary: borders tabpage UI doesn't display border properties nicely when lines are di...
Status: ASSIGNED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: Other All
: medium enhancement
Assignee: shrey_223
URL:
Whiteboard:
Keywords: difficultyInteresting, easyHack, skillCpp, topicUI
: 39336 (view as bug list)
Depends on:
Blocks: Writer-Styles-Paragraph Borders-Tab
  Show dependency treegraph
 
Reported: 2012-02-24 09:58 UTC by Jon Grossart
Modified: 2025-02-28 10:40 UTC (History)
9 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Grossart 2012-02-24 09:58:27 UTC
Problem description: If you add a custom border to a style, it works correctly and you have have different sizes to each (i.e., top and bottom). However, if you go back in to re-edit them, the UI shows both as being the default of 0.05 pt even if you changed them. If you keep top and bottom at the same value, the UI reloads the modified value correctly. This may be a bigger problem with other settings as well, but I only noticed it with borders.

Steps to reproduce:
1. set an H1 style in Writer
2. modify the style to have a border top and bottom
3. change the thickness of them
4. save changes ("OK")
5. re-edit style
6. make the top and bottom border different
7. save changes ("OK")
8. re-edit style

Current behavior:
4. style updates "correctly" (oh my...so many bugs in styles ATM).
5. borders width show up correctly allowing re-editing
7. different thickness borders show up "correctly"
8. border widths reset to 0.05pt instead of pulling up the custom values you set it to. There is no way to get those values back correctly via UI.

Expected behavior:
8. the customs widths you put in would be shown again for each item you set it with.

Platform (if different from the browser): 
              
Browser: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.2) Gecko/20100101 Firefox/10.0.2
Comment 1 Michael Stahl (allotropia) 2012-05-23 04:05:38 UTC

svtools/source/control/ctrlbox.cxx
cui/source/tabpages/border.cxx
Comment 2 Michael Stahl (allotropia) 2012-05-23 04:16:36 UTC
oops, pushed wrong key, let me complete that...

this problem has nothing to do with styles but is a general
problem of the borders tabpage, which already existed in OOo:
if the border lines are different, then it will not display
the properties nicely; this is difficult to do anyway with
a single width/style/color control.

what could be done easily though is to update the width/style/color
control when the user selects an individual line, to display
the properties of that line.

the tab page already has 4 different padding(line spacing)
controls, it would be possible to do the same for
the lines but it needs up to 6 controls (when the dialog
is for a Table there are inner and outer lines),
and it is going to become very cluttered.

some input from UX would be nice, what is the best way
to go here?

AFAIR the dialog is implemented in these files:

svtools/source/control/ctrlbox.cxx
cui/source/tabpages/border.cxx
Comment 3 Jon Grossart 2012-05-23 16:10:05 UTC
While I can agree that it needs some work, I still think it is a bug rather than an enhancement. If I apply a special style that hits this issue, there is no way to edit it without recreating it. I can't imaging that was ever the "correct behavior" as intended.
Comment 4 Michael Stahl (allotropia) 2012-08-20 20:31:49 UTC
*** Bug 39336 has been marked as a duplicate of this bug. ***
Comment 5 Björn Michaelsen 2013-10-04 18:46:43 UTC
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility.

see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Comment 6 Cédric Bosdonnat 2014-01-20 09:00:27 UTC Comment hidden (noise)
Comment 7 Robinson Tryon (qubit) 2015-12-14 06:22:32 UTC Comment hidden (obsolete)
Comment 8 Jon Grossart 2015-12-20 22:58:06 UTC
Tested in LibO 3.3.0, so setting to inherited.

Also, a better description of the behaviour I would expect:

On click of a button styling (all 4 edges, sides, etc.), it would set those boarders on at the current settings for parameters.

On first click of an edge on the preview, it would load the current settings into the parameters. Once loaded, subsequent click on that edge would toggle the state.

Clicking on a different edge would restart the process.
Comment 9 Robinson Tryon (qubit) 2016-02-18 14:52:15 UTC Comment hidden (obsolete)
Comment 10 Xisco Faulí 2020-03-09 13:29:00 UTC
Please add keyword 'needsUXEval' and CC 'libreoffice-ux-advise@lists.freedesktop.org' if input from UX is needed.
Comment 11 shrey_223 2025-02-20 19:16:57 UTC
In border.cxx, GetVisibleWidth returns a single width value if all visible borders have the same width, the Reset function initializes the UI based on the current border settings. The LinesChanged_Impl handles changes when a border line is selected. However, these functions don't track which specific border is selected, leading to the assumption that all borders have the same properties.

And do we also need to take into account multiple selection as checking whether a particular key is pressed the selected borders should be applied with same properties ?? but currently i think only previously selected border is getting selected.

So I think one of the possible solution could be, Instead of just taking the width from the first selected border, we need to check all selected borders. so iterate over all selected borders,If they all have the same width, display it. If not, show a mixed state indicator and when applying changes from the UI to the borders, if the width control is in a mixed state, we shouldn't change the widths of the selected borders. Only when a specific width is chosen should it apply to all selected borders.

So, Introduce a member variable, say m_aSelectedBorders, a set of svx::FrameBorderType, to keep track of which borders are selected. This requires modifying the SvxBorderTabPage class declaration.

In the LinesChanged_Impl method, on clicking a border, check if the Shift key is pressed. If so, toggle the selection in m_aSelectedBorders; otherwise, clear and add the new selection. 

In SelStyleHdl_Impl, when updating the controls, iterate over m_aSelectedBorders to check if all have the same width. If they do, display the value; otherwise, show an asterisk. This requires a boolean flag, let's say m_bMixedWidth declared in the SvxBorderTabPage class to track the state.

And also Modify the width control (like m_xLineWidthMF) to show the asterisk when m_bMixedWidth is true. and a function let's say applychange check m_bMixedWidth before applying the width. If mixed, don't change widths unless the user enters a new value, which then applies to all selected borders.

Sorry for long comment, I just want to know Am I heading towards right direction ??
Comment 12 Heiko Tietze 2025-02-24 09:25:07 UTC
Hossein, please advice.