bugGNUstep - Bugs: bug #15112, NSToolbar has wrong behaviour in...

Group
 
 

bug #15112: NSToolbar has wrong behaviour in IconOnly and LabelOnly modes (patch attached)

Submitter:  Wolfgang Sourdeau <wolfgang>
Submitted:  Wed 30 Nov 2005 09:49:44 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Fixed
Privacy:  Public Assigned to:  qmathe
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Sat 11 Feb 2006 04:30:48 PM UTC, comment #8: 

I'm closing this bug (no issues have been reported since my last update).

Quentin Mathé <qmathe>
Group Member
Fri 03 Feb 2006 04:30:12 PM UTC, comment #7: 

Fixed in SVN r22424.

I have committed a fix to correct the bug you were probably intending to report with:
GSToolbarView:
- the generated menus for toolbars were given entries for unlabelled
standard items: separators, spaces and flexible spaces

2006-02-03  Quentin Mathe <qmathe@club-internet.fr>

    * Source/NSToolbarItem.m (-[GSToolbarButtonCell setImagePosition:]):
    New method to override NSButtonCell behavior. It should be the last commit
    needed to correct bug #15112 (reported by Wolfgang Sourdeau). Precisely it
    eliminates the default title set with separator or space toolbar
    items and the image release with toolbar items which include one (both
    issues occurs when NSToolbarDisplayModeLabelnOnly is set).

Everything should behave correctly now. Please test whether it is the case. I will probable close this bug in next days if nothing wrong is reported.

Thanks,
Quentin.

Quentin Mathé <qmathe>
Group Member
Fri 03 Feb 2006 12:15:34 PM UTC, comment #6: 

I have fixed bug reported about NSCell, but more properly I modified NSButtonCell.m

2006-02-03  Quentin Mathe <qmathe@club-internet.fr>

    * Source/NSButtonCell.m (-setImagePosition:): Fixed the title lost (reset to
    the default one) which was wrongly occuring when the image position is
    switched to 'NSNoImage' (partial fix for bug #15112, based on an NSCell
    patch by Wolfgang Sourdeau).

Quentin Mathé <qmathe>
Group Member
Thu 15 Dec 2005 10:06:22 PM UTC, comment #5: 

For the first part of the bug report about GSToolbarView, I have to say I'm unable to reproduce this wrong behaviour. However it is possible I haven't well understood your bug description or I need more informations to reproduce it...

In current implementation, only items which return non nil value for both -menuFormRepresentation and -_defaultMenuFormRepresentation are added to the menu of clipped items. Finally -menuFormRepresentation returns nil by default for any items and -_defaultMenuFormRepresentation is overriden by NSToolbarItem subclasses like GSToolbarSeparatorItem, GSToolbarSpaceItem and GSToolbarFlexibleSpaceItem to return nil. That's why special items you mention shouldn't be present in the clipped items menu (and they aren't in my tests).

I put some NSLog in -returnMenu method, here is what I get for example:
item <NSToolbarItem: 8355dd8>
menuItem <NSMenuItem: 82dde90>
item <GSToolbarSeparatorItem: 835a308>
item <GSToolbarCustomizeToolbarItem: 835a5f0>
menuItem <NSMenuItem: 822f020>
item <GSToolbarFlexibleSpaceItem: 8370330>

Menu items are created only for <NSToolbarItem: 8355dd8> and <GSToolbarCustomizeToolbarItem: 835a5f0> but not the others.



Quentin Mathé <qmathe>
Group Member
Thu 15 Dec 2005 05:03:08 PM UTC, comment #4: 

2005-12-15  Quentin Mathe <qmathe@club-internet.fr>

    * Source/NSToolbarItem.m:
    (-[GSToolbarButton layout]): Don't set button based items width to their
    label width when NSToolbarDisplayModeIconOnly is active (based on patch
    by Wolfgang Sourdeau, partial fix for bug #15112). Removed superfuous code
    which substracted label height to button width in
    NSToolbarDisplayModeIconOnly case.
    (-initWithItemIdentifier:): Removed logical operator 'not' wrongly used
    with GSToolbarSeparatorItemIdentifier class identity test, it
    prevented any separator items to be inited therefore used (patch by
    Wolfgang Sourdeau, partial fix for bug #15112).

Quentin Mathé <qmathe>
Group Member
Mon 05 Dec 2005 12:59:43 AM UTC, comment #3: 

Thanks for submitting these patches Wolfgang. I'm going to apply them.
Just a minor comment, you may have submitted them with the patches tracker: <https://savannah.gnu.org/patch/?group=gnustep>

Quentin.

Quentin Mathé <qmathe>
Group Member
Thu 01 Dec 2005 10:00:37 PM UTC, comment #2: 

So here is the second patch. Apply this one only after you applied the other one, here are the changes:

ItemBackViewSmallHeight, ItemBackViewSmallWidth set from 50 to 36

GSToolbarButton's layout method:
layoutedHeight and ..Width do not need to be recomputed in case NSToolbarDisplayModeIconOnly: since no text will be drawn.
The modifications to the default values above were made because the previous code was doing a useless correction on layoutedWidth.

So this all should be fine now.

Wolfgang Sourdeau <wolfgang>
Thu 01 Dec 2005 07:07:12 PM UTC, comment #1: 

I did a small bug myself in this patch. I will submit you another one to be applied on top of it. Just don't apply this one yet...

Wolfgang Sourdeau <wolfgang>
Wed 30 Nov 2005 09:49:44 PM UTC, original submission:  

This patch was already posted to bug-gnustep. Reposted here for correct bug management practice.

This patch fixes the following problems:

GSToolbarView:
- the generated menus for toolbars were given entries for unlabelled
  standard items: separators, spaces and flexible spaces

NSCell:
- whenever the cell type would change, the _contents ivar would be set
  to @"title". I changed it to do that only when _contents is unset.
  Besides, I was not sure if setting @"title" was very useful but I let
  it that way in case there was a reason. This fixes the case where
  NSToolbar with displayMode set to LabelOnly would redefine the item
  labels to "title".

NSToolbarItem:
- in GSToolbarButton's layout method:
  the size for the cell of labelled toolbar items would take the label
  size into account even when the toolbar display mode was set to
  IconOnly.
- in NSToolbarItem's initWithItemIdentifier: method:
  a double negation in the test on itemIdentifier was causing the item
  to never be reinited to a GSToolbarSeparatorItem.

Wolfgang Sourdeau <wolfgang>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #2489:  toolbar-2.diff added by wolfgang (1KiB - text/plain)
file #2506:  toolbarfixes.diff added by wolfgang (6KiB - text/plain - fixes for the bugs mentioned above)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 7 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-02-11 qmathe StatusReady For Test Fixed
    Open/ClosedOpen Closed
2006-02-03 qmathe StatusIn Progress Ready For Test
2005-12-15 qmathe StatusNone In Progress
2005-12-05 qmathe Assigned toNone qmathe
2005-12-01 wolfgang Attached File- Added toolbar-2.diff, #3158
2005-11-30 wolfgang Attached File- Added toolbarfixes.diff, #3153

Back to the top

Powered by Savane 3.13-d3ae.
Corresponding source code