Changeset 3296


Ignore:
Timestamp:
Oct 6, 2007, 10:23:44 PM (15 years ago)
Author:
livings124
Message:

first commit of updated inspector...images are just placeholders currently

Location:
trunk
Files:
7 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Transmission.xcodeproj/project.pbxproj

    r3283 r3296  
    8383                A21F5C040AF26DD5008CE5CE /* ActionMenuSpeedToDisplayLimitTransformer.m in Sources */ = {isa = PBXBuildFile; fileRef = A21F5C020AF26DD5008CE5CE /* ActionMenuSpeedToDisplayLimitTransformer.m */; };
    8484                A2265F420B5EF5F40093DDA5 /* FileNameCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2265F400B5EF5F40093DDA5 /* FileNameCell.m */; };
     85                A22A067E0CB83507009694FE /* InfoTabBack.tif in Resources */ = {isa = PBXBuildFile; fileRef = A22A067D0CB83507009694FE /* InfoTabBack.tif */; };
     86                A22A06980CB83880009694FE /* InfoTabBorder.tif in Resources */ = {isa = PBXBuildFile; fileRef = A22A06970CB83880009694FE /* InfoTabBorder.tif */; };
    8587                A22A8D560AEEAFA5007E9CB9 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A22A8D540AEEAFA5007E9CB9 /* Localizable.strings */; };
    8688                A22BC9A30C5BBCF100F5FB72 /* BottomBorder.png in Resources */ = {isa = PBXBuildFile; fileRef = A22BC9A20C5BBCF100F5FB72 /* BottomBorder.png */; };
     89                A22D602E0CB67E4A00F67A8B /* InfoTabBackAqua.tif in Resources */ = {isa = PBXBuildFile; fileRef = A22D602C0CB67E4A00F67A8B /* InfoTabBackAqua.tif */; };
    8790                A232D29E0A70903E00973B12 /* Filter.png in Resources */ = {isa = PBXBuildFile; fileRef = A232D29D0A70903E00973B12 /* Filter.png */; };
    8891                A234D0D20C79FB3600A82373 /* NSMenuAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = A234D0D00C79FB3600A82373 /* NSMenuAdditions.m */; };
     
    113116                A261F1DC0A69A1610002815A /* Growl.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A261F1DB0A69A1610002815A /* Growl.framework */; };
    114117                A261F1E40A69A1B10002815A /* Growl.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = A261F1DB0A69A1610002815A /* Growl.framework */; };
     118                A26E75880CB6AA7500226674 /* InfoOptions.png in Resources */ = {isa = PBXBuildFile; fileRef = A26E75870CB6AA7500226674 /* InfoOptions.png */; };
     119                A26E75960CB6AB4800226674 /* InfoGeneral.png in Resources */ = {isa = PBXBuildFile; fileRef = A26E75950CB6AB4800226674 /* InfoGeneral.png */; };
    115120                A2710E770A86796000CE4F7D /* PrefsWindow.m in Sources */ = {isa = PBXBuildFile; fileRef = A2710E750A86796000CE4F7D /* PrefsWindow.m */; };
    116121                A277DA0B0C693D9C00DA2CD4 /* ActionOn.png in Resources */ = {isa = PBXBuildFile; fileRef = A277DA090C693D9C00DA2CD4 /* ActionOn.png */; };
     
    141146                A2D4F0850A915F7200890C32 /* GreenDot.tiff in Resources */ = {isa = PBXBuildFile; fileRef = A2D4F0840A915F7200890C32 /* GreenDot.tiff */; };
    142147                A2DF37070C220D03006523C1 /* CreatorWindowController.m in Sources */ = {isa = PBXBuildFile; fileRef = A2DF37050C220D03006523C1 /* CreatorWindowController.m */; };
     148                A2E23AC60CB5E1930002BB25 /* InfoTabButtonCell.m in Sources */ = {isa = PBXBuildFile; fileRef = A2E23AC40CB5E1930002BB25 /* InfoTabButtonCell.m */; };
    143149                A2E9AA760C249AF400085DCF /* Create.png in Resources */ = {isa = PBXBuildFile; fileRef = A2E9AA750C249AF400085DCF /* Create.png */; };
    144150                A2EF7DEC0C96297400FA9811 /* PurpleDot.png in Resources */ = {isa = PBXBuildFile; fileRef = A2EF7DEB0C96297400FA9811 /* PurpleDot.png */; };
     
    389395                A2265F3F0B5EF5F40093DDA5 /* FileNameCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FileNameCell.h; path = macosx/FileNameCell.h; sourceTree = "<group>"; };
    390396                A2265F400B5EF5F40093DDA5 /* FileNameCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = FileNameCell.m; path = macosx/FileNameCell.m; sourceTree = "<group>"; };
     397                A22A067D0CB83507009694FE /* InfoTabBack.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = InfoTabBack.tif; path = macosx/Images/InfoTabBack.tif; sourceTree = "<group>"; };
     398                A22A06970CB83880009694FE /* InfoTabBorder.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = InfoTabBorder.tif; path = macosx/Images/InfoTabBorder.tif; sourceTree = "<group>"; };
    391399                A22A7EBC0C627FC200E30364 /* Greek */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = Greek; path = macosx/Greek.lproj/InfoPlist.strings; sourceTree = "<group>"; };
    392400                A22A7EBD0C627FC200E30364 /* Greek */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Greek; path = macosx/Greek.lproj/InfoWindow.nib; sourceTree = "<group>"; };
     
    408416                A22BCA320C5D5CDA00F5FB72 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = macosx/Italian.lproj/MessageWindow.nib; sourceTree = "<group>"; };
    409417                A22BCA330C5D5CDA00F5FB72 /* Italian */ = {isa = PBXFileReference; lastKnownFileType = wrapper.nib; name = Italian; path = macosx/Italian.lproj/PrefsWindow.nib; sourceTree = "<group>"; };
     418                A22D602C0CB67E4A00F67A8B /* InfoTabBackAqua.tif */ = {isa = PBXFileReference; lastKnownFileType = image.tiff; name = InfoTabBackAqua.tif; path = macosx/Images/InfoTabBackAqua.tif; sourceTree = "<group>"; };
    410419                A232D29D0A70903E00973B12 /* Filter.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Filter.png; path = macosx/Images/Filter.png; sourceTree = "<group>"; };
    411420                A234D0CF0C79FB3600A82373 /* NSMenuAdditions.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = NSMenuAdditions.h; path = macosx/NSMenuAdditions.h; sourceTree = "<group>"; };
     
    449458                A261A8250C6A0D68003BAFDA /* Error.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Error.png; path = macosx/Images/Error.png; sourceTree = "<group>"; };
    450459                A261F1DB0A69A1610002815A /* Growl.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Growl.framework; path = macosx/Growl.framework; sourceTree = "<group>"; };
     460                A26E75870CB6AA7500226674 /* InfoOptions.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = InfoOptions.png; path = macosx/Images/InfoOptions.png; sourceTree = "<group>"; };
     461                A26E75950CB6AB4800226674 /* InfoGeneral.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = InfoGeneral.png; path = macosx/Images/InfoGeneral.png; sourceTree = "<group>"; };
    451462                A2710E740A86796000CE4F7D /* PrefsWindow.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = PrefsWindow.h; path = macosx/PrefsWindow.h; sourceTree = "<group>"; };
    452463                A2710E750A86796000CE4F7D /* PrefsWindow.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = PrefsWindow.m; path = macosx/PrefsWindow.m; sourceTree = "<group>"; };
     
    507518                A2DF37040C220D03006523C1 /* CreatorWindowController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CreatorWindowController.h; path = macosx/CreatorWindowController.h; sourceTree = "<group>"; };
    508519                A2DF37050C220D03006523C1 /* CreatorWindowController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CreatorWindowController.m; path = macosx/CreatorWindowController.m; sourceTree = "<group>"; };
     520                A2E23AC30CB5E1930002BB25 /* InfoTabButtonCell.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = InfoTabButtonCell.h; path = macosx/InfoTabButtonCell.h; sourceTree = "<group>"; };
     521                A2E23AC40CB5E1930002BB25 /* InfoTabButtonCell.m */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.objc; name = InfoTabButtonCell.m; path = macosx/InfoTabButtonCell.m; sourceTree = "<group>"; };
    509522                A2E9AA750C249AF400085DCF /* Create.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = Create.png; path = macosx/Images/Create.png; sourceTree = "<group>"; };
    510523                A2EF7DEB0C96297400FA9811 /* PurpleDot.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = PurpleDot.png; path = macosx/Images/PurpleDot.png; sourceTree = "<group>"; };
     
    720733                                A257C17F0CAD3003004E121C /* PeerTableView.h */,
    721734                                A257C1800CAD3003004E121C /* PeerTableView.m */,
     735                                A2E23AC30CB5E1930002BB25 /* InfoTabButtonCell.h */,
     736                                A2E23AC40CB5E1930002BB25 /* InfoTabButtonCell.m */,
    722737                        );
    723738                        name = Sources;
     
    821836                                A232D29D0A70903E00973B12 /* Filter.png */,
    822837                                A253F6F20A698970008EE24F /* FilterBarBackground.png */,
     838                                A22D602C0CB67E4A00F67A8B /* InfoTabBackAqua.tif */,
     839                                A22A067D0CB83507009694FE /* InfoTabBack.tif */,
     840                                A22A06970CB83880009694FE /* InfoTabBorder.tif */,
     841                                A26E75950CB6AB4800226674 /* InfoGeneral.png */,
     842                                A26E75870CB6AA7500226674 /* InfoOptions.png */,
    823843                        );
    824844                        name = Resources;
     
    13561376                                A2A6E3A00CA7E4C900F10FEF /* AboutWindow.nib in Resources */,
    13571377                                A2BC19850CA9AF5A00DD302A /* CompleteCheck.png in Resources */,
     1378                                A22D602E0CB67E4A00F67A8B /* InfoTabBackAqua.tif in Resources */,
     1379                                A26E75880CB6AA7500226674 /* InfoOptions.png in Resources */,
     1380                                A26E75960CB6AB4800226674 /* InfoGeneral.png in Resources */,
     1381                                A22A067E0CB83507009694FE /* InfoTabBack.tif in Resources */,
     1382                                A22A06980CB83880009694FE /* InfoTabBorder.tif in Resources */,
    13581383                        );
    13591384                        runOnlyForDeploymentPostprocessing = 0;
     
    14921517                                A21282A80CA6C66800EAEE0F /* StatusBarView.m in Sources */,
    14931518                                A257C1820CAD3003004E121C /* PeerTableView.m in Sources */,
     1519                                A2E23AC60CB5E1930002BB25 /* InfoTabButtonCell.m in Sources */,
    14941520                        );
    14951521                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/macosx/English.lproj/InfoWindow.nib/classes.nib

    r3259 r3296  
    33        {CLASS = FileOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
    44        {CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
     5        {CLASS = ImageBackgroundView; LANGUAGE = ObjC; SUPERCLASS = NSView; },
     6        {CLASS = InfoTabButtonCell; LANGUAGE = ObjC; SUPERCLASS = NSButtonCell; },
    57        {
    68            ACTIONS = {
     
    1719                setSpeedLimit = id;
    1820                setSpeedMode = id;
     21                setTab = id;
    1922            };
    2023            CLASS = InfoWindowController;
    2124            LANGUAGE = ObjC;
    2225            OUTLETS = {
     26                fActivityView = NSView;
    2327                fCommentView = NSTextView;
    2428                fCompletedFromTrackerField = NSTextField;
     
    4448                fFileTableStatusField = NSTextField;
    4549                fFileUncheckItem = NSMenuItem;
     50                fFilesView = NSView;
    4651                fHashField = NSTextField;
    4752                fHaveField = NSTextField;
    4853                fImageView = NSImageView;
     54                fInfoView = NSView;
    4955                fKnownField = NSTextField;
    5056                fLeechersField = NSTextField;
    5157                fNameField = NSTextField;
     58                fOptionsView = NSView;
    5259                fPeerTable = NSTableView;
     60                fPeersView = NSView;
    5361                fPexCheck = NSButton;
    5462                fPiecesControl = NSSegmentedControl;
     
    6674                fStateField = NSTextField;
    6775                fSwarmSpeedField = NSTextField;
    68                 fTabView = NSTabView;
     76                fTabBackBar = ImageBackgroundView;
     77                fTabMatrix = NSMatrix;
    6978                fTorrentLocationField = NSTextField;
    7079                fTrackerField = NSTextField;
  • trunk/macosx/English.lproj/InfoWindow.nib/info.nib

    r2832 r3296  
    77        <key>IBEditorPositions</key>
    88        <dict>
     9                <key>1030</key>
     10                <string>297 229 360 384 0 0 1680 1028 </string>
     11                <key>1057</key>
     12                <string>505 337 360 389 0 0 1680 1028 </string>
     13                <key>1066</key>
     14                <string>665 601 349 202 0 0 1680 1028 </string>
    915                <key>549</key>
    10                 <string>565 283 174 149 0 0 1152 842 </string>
     16                <string>870 359 174 149 0 0 1680 1028 </string>
     17                <key>965</key>
     18                <string>229 571 370 310 0 0 1680 1028 </string>
     19                <key>995</key>
     20                <string>301 527 370 332 0 0 1680 1028 </string>
    1121        </dict>
    1222        <key>IBFramework Version</key>
    1323        <string>446.1</string>
    1424        <key>IBLockedObjects</key>
    15         <array>
    16                 <integer>5</integer>
    17         </array>
     25        <array/>
    1826        <key>IBLockedTabItems</key>
    1927        <array>
     
    2331        <array>
    2432                <integer>5</integer>
     33                <integer>1066</integer>
    2534        </array>
    2635        <key>IBSystem Version</key>
  • trunk/macosx/InfoWindowController.h

    r3259 r3296  
    2626#import "Torrent.h"
    2727#import "FileOutlineView.h"
     28#import "ImageBackgroundView.h"
    2829#import "PiecesView.h"
    2930#import <transmission.h>
     
    3435    NSImage * fAppIcon, * fLockImage;
    3536   
     37    #warning need?
    3638    BOOL fCanResizeVertical;
    3739   
    38     IBOutlet NSTabView * fTabView;
     40    IBOutlet NSView * fInfoView, * fActivityView, * fPeersView, * fFilesView, * fOptionsView;
     41    NSView * fCurrentView;
     42    IBOutlet NSMatrix * fTabMatrix;
     43    IBOutlet ImageBackgroundView * fTabBackBar;
    3944
    4045    IBOutlet NSImageView * fImageView;
     
    7277- (void) updateInfoStats;
    7378
     79- (void) setTab: (id) sender;
     80
    7481- (void) setNextTab;
    7582- (void) setPreviousTab;
  • trunk/macosx/InfoWindowController.m

    r3264 r3296  
    3434#define TAB_OPTIONS_IDENT @"Options"
    3535
    36 //15 spacing at the bottom of each tab
    37 #define TAB_INFO_HEIGHT 268.0
    38 #define TAB_ACTIVITY_HEIGHT 290.0
    39 #define TAB_OPTIONS_HEIGHT 158.0
    40 #define TAB_RESIZABLE_MIN_HEIGHT 279.0
     36#define TAB_MIN_HEIGHT 250
    4137
    4238#define PIECES_CONTROL_PROGRESS 0
     
    4844
    4945#define INVALID -99
     46
     47typedef enum
     48{
     49    TAB_INFO_TAG = 0,
     50    TAB_ACTIVITY_TAG,
     51    TAB_PEERS_TAG,
     52    TAB_FILES_TAG,
     53    TAB_OPTIONS_TAG,
     54} tabTag;
    5055
    5156@interface InfoWindowController (Private)
     
    5560- (void) updateInfoPeers;
    5661- (void) updateInfoFiles;
    57 - (void) updateInfoSettings;
     62- (void) updateInfoOptions;
    5863
    5964- (void) setWindowForTab: (NSString *) identifier animate: (BOOL) animate;
     
    7277    NSPanel * window = (NSPanel *)[self window];
    7378   
    74     [window setFrameAutosaveName: @"InspectorWindowFrame"];
    75     [window setFrameUsingName: @"InspectorWindowFrame"];
     79    /*[window setFrameAutosaveName: @"InspectorWindowFrame"];
     80    [window setFrameUsingName: @"InspectorWindowFrame"];*/
    7681   
    7782    [window setBecomesKeyOnlyIfNeeded: YES];
    7883    [window setAcceptsMouseMovedEvents: YES];
    7984   
    80     //select tab
     85    //set selected tab
     86    fCanResizeVertical = NO;
    8187    NSString * identifier = [[NSUserDefaults standardUserDefaults] stringForKey: @"InspectorSelected"];
    82    
    83     if (!identifier || [fTabView indexOfTabViewItemWithIdentifier: identifier] == NSNotFound)
    84         identifier = TAB_INFO_IDENT;
    85    
    86     fCanResizeVertical = [identifier isEqualToString: TAB_PEERS_IDENT] || [identifier isEqualToString: TAB_FILES_IDENT];
    87    
    88     [fTabView selectTabViewItemWithIdentifier: identifier];
    89     [self setWindowForTab: identifier animate: NO];
     88    int tag;
     89    if ([identifier isEqualToString: TAB_INFO_IDENT])
     90        tag = TAB_INFO_TAG;
     91    else if ([identifier isEqualToString: TAB_ACTIVITY_IDENT])
     92        tag = TAB_ACTIVITY_TAG;
     93    else if ([identifier isEqualToString: TAB_PEERS_IDENT])
     94        tag = TAB_PEERS_TAG;
     95    else if ([identifier isEqualToString: TAB_FILES_IDENT])
     96        tag = TAB_FILES_TAG;
     97    else if ([identifier isEqualToString: TAB_OPTIONS_IDENT])
     98        tag = TAB_OPTIONS_TAG;
     99    else //safety
     100    {
     101        [[NSUserDefaults standardUserDefaults] setObject: TAB_INFO_IDENT forKey: @"InspectorSelected"];
     102        tag = TAB_INFO_TAG;
     103    }
     104    [fTabMatrix selectCellWithTag: tag];
     105    [self setTab: nil];
     106   
     107    //set tab images and tooltips
     108    [fTabBackBar setBackgroundImage: [NSImage imageNamed: @"InfoTabBorder.tif"]];
     109    [[fTabMatrix cellWithTag: TAB_INFO_TAG] setImage: [NSImage imageNamed: @"InfoGeneral.png"]];
     110    [[fTabMatrix cellWithTag: TAB_OPTIONS_TAG] setImage: [NSImage imageNamed: @"InfoOptions.png"]];
     111   
     112    [fTabMatrix setToolTip: NSLocalizedString(@"General Info", "Inspector -> tab tooltip")
     113                    forCell: [fTabMatrix cellWithTag: TAB_INFO_TAG]];
     114    [fTabMatrix setToolTip: NSLocalizedString(@"Activity", "Inspector -> tab tooltip")
     115                    forCell: [fTabMatrix cellWithTag: TAB_ACTIVITY_TAG]];
     116    [fTabMatrix setToolTip: NSLocalizedString(@"Peers", "Inspector -> tab tooltip")
     117                    forCell: [fTabMatrix cellWithTag:  TAB_PEERS_TAG]];
     118    [fTabMatrix setToolTip: NSLocalizedString(@"Files", "Inspector -> tab tooltip")
     119                    forCell: [fTabMatrix cellWithTag: TAB_FILES_TAG]];
     120    [fTabMatrix setToolTip: NSLocalizedString(@"Options", "Inspector -> tab tooltip")
     121                    forCell: [fTabMatrix cellWithTag: TAB_OPTIONS_TAG]];
    90122   
    91123    //initially sort peer table by IP
     
    113145{
    114146    if (fCanResizeVertical)
    115         [[NSUserDefaults standardUserDefaults] setFloat: [[[fTabView selectedTabViewItem] view] frame].size.height
    116                                                 forKey: @"InspectorHeight"];
     147        [[NSUserDefaults standardUserDefaults] setFloat: [fCurrentView frame].size.height forKey: @"InspectorContentHeight"];
    117148   
    118149    [[NSNotificationCenter defaultCenter] removeObserver: self];
     
    340371- (void) updateInfoStats
    341372{
    342     NSString * ident = [[fTabView selectedTabViewItem] identifier];
    343     if ([ident isEqualToString: TAB_ACTIVITY_IDENT])
    344         [self updateInfoActivity];
    345     else if ([ident isEqualToString: TAB_PEERS_IDENT])
    346         [self updateInfoPeers];
    347     else if ([ident isEqualToString: TAB_INFO_IDENT])
    348         [self updateInfoGeneral];
    349     else if ([ident isEqualToString: TAB_FILES_IDENT])
    350         [self updateInfoFiles];
    351     else if ([ident isEqualToString: TAB_OPTIONS_IDENT])
    352         [self updateInfoSettings];
    353     else;
     373    switch ([fTabMatrix selectedTag])
     374    {
     375        case TAB_INFO_TAG:
     376            [self updateInfoGeneral];
     377            break;
     378        case TAB_ACTIVITY_TAG:
     379            [self updateInfoActivity];
     380            break;
     381        case TAB_PEERS_TAG:
     382            [self updateInfoPeers];
     383            break;
     384        case TAB_FILES_TAG:
     385            [self updateInfoFiles];
     386            break;
     387        case TAB_OPTIONS_TAG:
     388            [self updateInfoOptions];
     389            break;
     390    }
    354391}
    355392
     
    493530}
    494531
    495 - (void) updateInfoSettings
     532- (void) updateInfoOptions
    496533{
    497534    if ([fTorrents count] == 0)
     
    625662    if (action == @selector(revealFile:))
    626663    {
    627         if (![[[fTabView selectedTabViewItem] identifier] isEqualToString: TAB_FILES_IDENT])
     664        if ([fTabMatrix selectedTag] != TAB_FILES_TAG)
    628665            return NO;
    629666       
     
    722759}
    723760
    724 - (void) setWindowForTab: (NSString *) identifier animate: (BOOL) animate
     761/*- (void) setWindowForTab: (NSString *) identifier animate: (BOOL) animate
    725762{
    726763    [self updateInfoStats];
     
    773810   
    774811    fCanResizeVertical = canResizeVertical;
     812}*/
     813
     814- (void) setTab: (id) sender
     815{
     816    [self updateInfoStats];
     817   
     818    BOOL oldCanResizeVertical = fCanResizeVertical;
     819   
     820    NSView * view;
     821    NSString * identifier;
     822    switch ([fTabMatrix selectedTag])
     823    {
     824        case TAB_INFO_TAG:
     825            view = fInfoView;
     826            identifier = TAB_INFO_IDENT;
     827            fCanResizeVertical = NO;
     828            break;
     829        case TAB_ACTIVITY_TAG:
     830            view = fActivityView;
     831            identifier = TAB_ACTIVITY_IDENT;
     832            fCanResizeVertical = NO;
     833           
     834            [fPiecesView updateView: YES];
     835            break;
     836        case TAB_PEERS_TAG:
     837            view = fPeersView;
     838            identifier = TAB_PEERS_IDENT;
     839            fCanResizeVertical = YES;
     840            break;
     841        case TAB_FILES_TAG:
     842            view = fFilesView;
     843            identifier = TAB_FILES_IDENT;
     844            fCanResizeVertical = YES;
     845            break;
     846        case TAB_OPTIONS_TAG:
     847            view = fOptionsView;
     848            identifier = TAB_OPTIONS_IDENT;
     849            fCanResizeVertical = NO;
     850            break;
     851        default:
     852            return;
     853    }
     854   
     855    [[NSUserDefaults standardUserDefaults] setObject: identifier forKey: @"InspectorSelected"];
     856   
     857    NSWindow * window = [self window];
     858   
     859    float oldHeight = 0;
     860    if (fCurrentView)
     861    {
     862        if (fCurrentView == view)
     863            return;
     864       
     865        [fCurrentView setHidden: YES];
     866        [fCurrentView removeFromSuperview];
     867       
     868        oldHeight = [fCurrentView frame].size.height;
     869    }
     870   
     871    NSRect windowRect = [window frame], viewRect = [view frame];
     872   
     873    //save old size
     874    if (oldCanResizeVertical)
     875        [[NSUserDefaults standardUserDefaults] setFloat: [fCurrentView frame].size.height forKey: @"InspectorContentHeight"];
     876   
     877    if (fCanResizeVertical)
     878    {
     879        float height = [[NSUserDefaults standardUserDefaults] floatForKey: @"InspectorContentHeight"];
     880        if (height != 0)
     881            viewRect.size.height = MAX(height, TAB_MIN_HEIGHT);
     882    }
     883   
     884    float difference = (viewRect.size.height - oldHeight) * [window userSpaceScaleFactor];
     885    windowRect.origin.y -= difference;
     886    windowRect.size.height += difference;
     887   
     888    if (fCanResizeVertical)
     889    {
     890        if (!oldCanResizeVertical)
     891        {
     892            [window setMinSize: NSMakeSize([window minSize].width, windowRect.size.height - viewRect.size.height + TAB_MIN_HEIGHT)];
     893            [window setMaxSize: NSMakeSize(FLT_MAX, FLT_MAX)];
     894        }
     895    }
     896    else
     897    {
     898        [window setMinSize: NSMakeSize([window minSize].width, windowRect.size.height)];
     899        [window setMaxSize: NSMakeSize(FLT_MAX, windowRect.size.height)];
     900    }
     901   
     902    viewRect.size.width = windowRect.size.width;
     903    [view setFrame: viewRect];
     904   
     905    [window setFrame: windowRect display: YES animate: fCurrentView != nil];
     906    [[window contentView] addSubview: view];
     907    [view setHidden: NO];
     908   
     909    fCurrentView = view;
    775910}
    776911
    777912- (void) setNextTab
    778913{
    779     if ([fTabView selectedTabViewItem] == [fTabView tabViewItemAtIndex: [fTabView numberOfTabViewItems] - 1])
    780         [fTabView selectFirstTabViewItem: nil];
    781     else
    782         [fTabView selectNextTabViewItem: nil];
     914    int tag = [fTabMatrix selectedTag]+1;
     915    if (tag >= [fTabMatrix numberOfColumns])
     916        tag = 0;
     917   
     918    [fTabMatrix selectCellWithTag: tag];
     919    [self setTab: nil];
    783920}
    784921
    785922- (void) setPreviousTab
    786923{
    787     if ([fTabView selectedTabViewItem] == [fTabView tabViewItemAtIndex: 0])
    788         [fTabView selectLastTabViewItem: nil];
    789     else
    790         [fTabView selectPreviousTabViewItem: nil];
     924    int tag = [fTabMatrix selectedTag]-1;
     925    if (tag < 0)
     926        tag = [fTabMatrix numberOfColumns]-1;
     927   
     928    [fTabMatrix selectCellWithTag: tag];
     929    [self setTab: nil];
    791930}
    792931
     
    10281167}
    10291168
    1030 - (void) mouseMoved: (NSEvent *) event
     1169/*- (void) mouseMoved: (NSEvent *) event
    10311170{
    10321171    [fFileOutline setHoverRowForEvent: [[[fTabView selectedTabViewItem] identifier] isEqualToString: TAB_FILES_IDENT]
    10331172                                        ? event : nil];
    1034 }
     1173}*/
    10351174
    10361175- (void) setPiecesView: (id) sender
Note: See TracChangeset for help on using the changeset viewer.