mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 15:31:56 +00:00
removed c99isms
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@30175 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9da9dae16e
commit
a4fb383863
3 changed files with 33 additions and 13 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2010-04-16 Riccardo Mottola <rmottola@users.sf.net>
|
||||||
|
|
||||||
|
* Source/GSToolbarCustomizationPalette.m
|
||||||
|
* Source/GSToolbarView.m
|
||||||
|
removed c99isms
|
||||||
|
|
||||||
2010-04-15 Eric Wasylishen <ewasylishen@gmail.com>
|
2010-04-15 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
* Source/NSSegmentedCell.m:
|
* Source/NSSegmentedCell.m:
|
||||||
|
|
|
@ -99,11 +99,16 @@
|
||||||
// Loop over all subviews
|
// Loop over all subviews
|
||||||
while ((layoutedView = [e nextObject]) != nil)
|
while ((layoutedView = [e nextObject]) != nil)
|
||||||
{
|
{
|
||||||
[(id)layoutedView layout];
|
NSRect frame;
|
||||||
NSRect frame = [layoutedView frame];
|
NSSize size;
|
||||||
NSSize size = frame.size;
|
float height;
|
||||||
float height = size.height;
|
float width;
|
||||||
float width = size.width;
|
|
||||||
|
[(id)layoutedView layout];
|
||||||
|
frame = [layoutedView frame];
|
||||||
|
size = frame.size;
|
||||||
|
height = size.height;
|
||||||
|
width = size.width;
|
||||||
|
|
||||||
if ((hAccumulator + width) <= maxWidth)
|
if ((hAccumulator + width) <= maxWidth)
|
||||||
{
|
{
|
||||||
|
@ -236,11 +241,14 @@
|
||||||
[_defaultTemplateView setAutoresizingMask:NSViewWidthSizable | NSViewMaxYMargin];
|
[_defaultTemplateView setAutoresizingMask:NSViewWidthSizable | NSViewMaxYMargin];
|
||||||
|
|
||||||
{
|
{
|
||||||
|
NSRect dtvFrame;
|
||||||
|
NSRect cvFrame;
|
||||||
|
|
||||||
// for now, _defaultTemplateView isn't implemented, so remove it
|
// for now, _defaultTemplateView isn't implemented, so remove it
|
||||||
NSRect dtvFrame = [_defaultTemplateView frame];
|
dtvFrame = [_defaultTemplateView frame];
|
||||||
[_defaultTemplateView removeFromSuperview];
|
[_defaultTemplateView removeFromSuperview];
|
||||||
// expand _customizationView to fill the space
|
// expand _customizationView to fill the space
|
||||||
NSRect cvFrame = [_customizationView frame];
|
cvFrame = [_customizationView frame];
|
||||||
cvFrame.size.height += dtvFrame.size.height;
|
cvFrame.size.height += dtvFrame.size.height;
|
||||||
cvFrame.origin.y -= dtvFrame.size.height;
|
cvFrame.origin.y -= dtvFrame.size.height;
|
||||||
[_customizationView setFrame:cvFrame];
|
[_customizationView setFrame:cvFrame];
|
||||||
|
@ -265,6 +273,11 @@
|
||||||
NSToolbarDisplayMode tag = [toolbar displayMode];
|
NSToolbarDisplayMode tag = [toolbar displayMode];
|
||||||
NSToolbarSizeMode size = [toolbar sizeMode];
|
NSToolbarSizeMode size = [toolbar sizeMode];
|
||||||
id delegate = [toolbar delegate];
|
id delegate = [toolbar delegate];
|
||||||
|
NSView *toolbarView;
|
||||||
|
NSRect toolbarFrame;
|
||||||
|
NSPoint bottomCenter;
|
||||||
|
NSRect windowFrame;
|
||||||
|
NSPoint topCenter;
|
||||||
|
|
||||||
[_allowedItems removeAllObjects];
|
[_allowedItems removeAllObjects];
|
||||||
[_defaultItems removeAllObjects];
|
[_defaultItems removeAllObjects];
|
||||||
|
@ -325,12 +338,12 @@
|
||||||
_toolbar = toolbar;
|
_toolbar = toolbar;
|
||||||
|
|
||||||
// position the customization window centered just below the toolbar
|
// position the customization window centered just below the toolbar
|
||||||
NSView *toolbarView = [_toolbar _toolbarView];
|
toolbarView = [_toolbar _toolbarView];
|
||||||
NSRect toolbarFrame = [toolbarView convertRect:[toolbarView bounds] toView:nil];
|
toolbarFrame = [toolbarView convertRect:[toolbarView bounds] toView:nil];
|
||||||
NSPoint bottomCenter = NSMakePoint(toolbarFrame.origin.x + (toolbarFrame.size.width/2), toolbarFrame.origin.y);
|
bottomCenter = NSMakePoint(toolbarFrame.origin.x + (toolbarFrame.size.width/2), toolbarFrame.origin.y);
|
||||||
bottomCenter = [[toolbarView window] convertBaseToScreen:bottomCenter];
|
bottomCenter = [[toolbarView window] convertBaseToScreen:bottomCenter];
|
||||||
NSRect windowFrame = [_customizationWindow frame];
|
windowFrame = [_customizationWindow frame];
|
||||||
NSPoint topCenter = NSMakePoint(windowFrame.origin.x + (windowFrame.size.width/2), windowFrame.origin.y + windowFrame.size.height);
|
topCenter = NSMakePoint(windowFrame.origin.x + (windowFrame.size.width/2), windowFrame.origin.y + windowFrame.size.height);
|
||||||
windowFrame.origin.x += bottomCenter.x-topCenter.x;
|
windowFrame.origin.x += bottomCenter.x-topCenter.x;
|
||||||
windowFrame.origin.y += bottomCenter.y-topCenter.y;
|
windowFrame.origin.y += bottomCenter.y-topCenter.y;
|
||||||
[_customizationWindow setFrame:windowFrame display:NO];
|
[_customizationWindow setFrame:windowFrame display:NO];
|
||||||
|
|
|
@ -393,6 +393,7 @@ static void initSystemExtensionsColors(void)
|
||||||
NSString *identifier = [item itemIdentifier];
|
NSString *identifier = [item itemIdentifier];
|
||||||
NSToolbar *toolbar = [self toolbar];
|
NSToolbar *toolbar = [self toolbar];
|
||||||
NSArray *allowedItemIdentifiers = [[toolbar delegate] toolbarAllowedItemIdentifiers: toolbar];
|
NSArray *allowedItemIdentifiers = [[toolbar delegate] toolbarAllowedItemIdentifiers: toolbar];
|
||||||
|
int newIndex;
|
||||||
|
|
||||||
// don't accept any dragging if the customization palette isn't running for this toolbar
|
// don't accept any dragging if the customization palette isn't running for this toolbar
|
||||||
if (![toolbar customizationPaletteIsRunning] || ![allowedItemIdentifiers containsObject: identifier])
|
if (![toolbar customizationPaletteIsRunning] || ![allowedItemIdentifiers containsObject: identifier])
|
||||||
|
@ -424,7 +425,7 @@ static void initSystemExtensionsColors(void)
|
||||||
draggedItemIndex = NSNotFound;
|
draggedItemIndex = NSNotFound;
|
||||||
}
|
}
|
||||||
|
|
||||||
int newIndex = [self _insertionIndexAtPoint: [info draggingLocation]];
|
newIndex = [self _insertionIndexAtPoint: [info draggingLocation]];
|
||||||
|
|
||||||
if (draggedItemIndex != NSNotFound)
|
if (draggedItemIndex != NSNotFound)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue