mirror of
https://github.com/transmission/transmission.git
synced 2025-12-25 04:45:56 +00:00
add in placeholder code so that AddMagnetWindow can be localized with a strings file after 2.7
This commit is contained in:
@@ -94,6 +94,67 @@
|
||||
[fLocationField setStringValue: @""];
|
||||
[fLocationImageView setImage: nil];
|
||||
}
|
||||
|
||||
#warning enable after 2.7
|
||||
/*
|
||||
#warning when 10.7-only, switch to auto layout
|
||||
[fMagnetLinkLabel sizeToFit];
|
||||
|
||||
const CGFloat downloadToLabelOldWidth = [fDownloadToLabel frame].size.width;
|
||||
[fDownloadToLabel sizeToFit];
|
||||
const CGFloat changeDestOldWidth = [fChangeDestinationButton frame].size.width;
|
||||
[fChangeDestinationButton sizeToFit];
|
||||
NSRect changeDestFrame = [fChangeDestinationButton frame];
|
||||
changeDestFrame.origin.x -= changeDestFrame.size.width - changeDestOldWidth;
|
||||
[fChangeDestinationButton setFrame: changeDestFrame];
|
||||
|
||||
NSRect downloadToBoxFrame = [fDownloadToBox frame];
|
||||
const CGFloat downloadToBoxSizeDiff = ([fDownloadToLabel frame].size.width - downloadToLabelOldWidth) + (changeDestFrame.size.width - changeDestOldWidth);
|
||||
downloadToBoxFrame.size.width -= downloadToBoxSizeDiff;
|
||||
downloadToBoxFrame.origin.x -= downloadToLabelOldWidth - [fDownloadToLabel frame].size.width;
|
||||
[fDownloadToBox setFrame: downloadToBoxFrame];
|
||||
|
||||
NSRect groupPopUpFrame = [fGroupPopUp frame];
|
||||
NSRect priorityPopUpFrame = [fPriorityPopUp frame];
|
||||
const CGFloat popUpOffset = groupPopUpFrame.origin.x - NSMaxX([fGroupLabel frame]);
|
||||
[fGroupLabel sizeToFit];
|
||||
[fPriorityLabel sizeToFit];
|
||||
NSRect groupLabelFrame = [fGroupLabel frame];
|
||||
NSRect priorityLabelFrame = [fPriorityLabel frame];
|
||||
//first bring them both to the left edge
|
||||
groupLabelFrame.origin.x = MIN(groupLabelFrame.origin.x, priorityLabelFrame.origin.x);
|
||||
priorityLabelFrame.origin.x = MIN(groupLabelFrame.origin.x, priorityLabelFrame.origin.x);
|
||||
//then align on the right
|
||||
const CGFloat labelWidth = MAX(groupLabelFrame.size.width, priorityLabelFrame.size.width);
|
||||
groupLabelFrame.origin.x += labelWidth - groupLabelFrame.size.width;
|
||||
priorityLabelFrame.origin.x += labelWidth - priorityLabelFrame.size.width;
|
||||
groupPopUpFrame.origin.x = NSMaxX(groupLabelFrame) + popUpOffset;
|
||||
priorityPopUpFrame.origin.x = NSMaxX(priorityLabelFrame) + popUpOffset;
|
||||
[fGroupLabel setFrame: groupLabelFrame];
|
||||
[fGroupPopUp setFrame: groupPopUpFrame];
|
||||
[fPriorityLabel setFrame: priorityLabelFrame];
|
||||
[fPriorityPopUp setFrame: priorityPopUpFrame];
|
||||
|
||||
const CGFloat minButtonWidth = 82.0;
|
||||
const CGFloat oldAddButtonWidth = [fAddButton bounds].size.width;
|
||||
const CGFloat oldCancelButtonWidth = [fCancelButton bounds].size.width;
|
||||
#warning add "extra" width that sizeToFit loses
|
||||
[fAddButton sizeToFit];
|
||||
[fCancelButton sizeToFit];
|
||||
NSRect addButtonFrame = [fAddButton frame];
|
||||
NSRect cancelButtonFrame = [fCancelButton frame];
|
||||
CGFloat buttonWidth = MAX(addButtonFrame.size.width, cancelButtonFrame.size.width);
|
||||
buttonWidth = MAX(buttonWidth, minButtonWidth);
|
||||
addButtonFrame.size.width = buttonWidth;
|
||||
cancelButtonFrame.size.width = buttonWidth;
|
||||
const CGFloat addButtonWidthIncrease = buttonWidth - oldAddButtonWidth;
|
||||
addButtonFrame.origin.x -= addButtonWidthIncrease;
|
||||
cancelButtonFrame.origin.x -= addButtonWidthIncrease + (buttonWidth - oldCancelButtonWidth);
|
||||
[fAddButton setFrame: addButtonFrame];
|
||||
[fCancelButton setFrame: cancelButtonFrame];
|
||||
|
||||
[fStartCheck sizeToFit];
|
||||
*/
|
||||
}
|
||||
|
||||
- (void) windowDidLoad
|
||||
|
||||
Reference in New Issue
Block a user