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

 
 

You are not allowed to post comments on this tracker with your current authentication level.

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

Submitted by:  Wolfgang Sourdeau <wolfgang>
Submitted on:  Wed 30 Nov 2005 09:49:44 PM UTC  
 
Category: Gui/AppKitSeverity: 3 - Normal
Item Group: BugStatus: Fixed
Privacy: PublicAssigned to: Quentin Mathé <qmathe>
Open/Closed: Closed

(Jump to the original submission 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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>
Project MemberIn charge of this item.
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>

 

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

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 7 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sat 11 Feb 2006 04:30:48 PM UTCqmatheStatusReady For Test=>Fixed
  Open/ClosedOpen=>Closed
Fri 03 Feb 2006 04:30:12 PM UTCqmatheStatusIn Progress=>Ready For Test
Thu 15 Dec 2005 05:03:08 PM UTCqmatheStatusNone=>In Progress
Mon 05 Dec 2005 12:59:43 AM UTCqmatheAssigned toNone=>qmathe
Thu 01 Dec 2005 10:00:37 PM UTCwolfgangAttached File-=>Added toolbar-2.diff, #3158
Wed 30 Nov 2005 09:49:45 PM UTCwolfgangAttached File-=>Added toolbarfixes.diff, #3153

Back to the top


Powered by Savane 3.1-cleanup1