Bug 24907 (suse9907) - Truncated labels in qt and ncurses
Summary: Truncated labels in qt and ncurses
Status: VERIFIED MOVED
Alias: suse9907
Product: SUSE Linux 10.1
Classification: openSUSE
Component: YaST2 (show other bugs)
Version: unspecified
Hardware: i386 Linux
: P3 - Medium : Normal (vote)
Target Milestone: ---
Assignee: Stefan Hundhammer
QA Contact: Klaus Kämpf
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-08-28 15:55 UTC by Martin Vidner
Modified: 2006-07-21 07:30 UTC (History)
0 users

See Also:
Found By: Other
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Screenshot in qt (49.90 KB, image/png)
2001-08-28 15:56 UTC, Martin Vidner
Details
Screenshot in ncurses (12.57 KB, image/png)
2001-08-28 15:56 UTC, Martin Vidner
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Vidner 2001-08-28 15:55:49 UTC
In the attached screenshots, the label above the second selection box is
supposed to display the string selected in the first selection box. But the
label is truncated to the length of the shorter string in the first box.

The source of this dialog is modules/y2c_nfs_server/ui.ycp, function
ExportsDialog().
Comment 1 Martin Vidner 2001-08-28 15:56:24 UTC
Created attachment 8931 [details]
Screenshot in qt
Comment 2 Martin Vidner 2001-08-28 15:56:45 UTC
Created attachment 8932 [details]
Screenshot in ncurses
Comment 3 Stefan Hundhammer 2001-08-28 16:21:40 UTC
You are talking about the "table" widget, not the SelectionBox, right? This is 
what is used in this code example.


Comment 4 Martin Vidner 2001-08-28 16:25:19 UTC
Oops, of course, the lower one is a table.
Comment 5 Stefan Hundhammer 2001-08-28 16:29:30 UTC
This is a layout problem, not an UI problem:

Since the table itself does not have a caption above it (it has column headers 
instead), you are using a Label widget to simulate that. The label widget, 
however, does NOT resize itself when its label (its value) is changed, so it 
sticks to its initial size.

You can either make the label large enough when you create it (specify 
`opt(`hstretch) should do the trick) or put it inside a ReplacePoint and then 
replace the entire widget rather than change its label. ReplaceWidget() unlike 
ChangeWidget() causes a re-layout of the dialog.

BTW this is a feature, not a bug: Geometry management is expensive, so we 
don't do that upon every single ChangeWidget() call.
Comment 6 Martin Vidner 2001-08-28 16:52:49 UTC
OK, hstretch worked.

Please mention this in the layout tutorial, the difference between ChangeWidget
and ReplaceWidget as well as the trick with reserving enough space beforehand.

By the way, the original code reserved a fixed-width space which did not work
because the space shrunk as the label got a new shorter value. Not the way to
go.
Comment 7 Martin Vidner 2006-07-21 07:28:42 UTC
(found in SL 7.3 pre, moving just to make it public)
Comment 8 Martin Vidner 2006-07-21 07:30:47 UTC
UI::RecalcLayout now exists for such situations