Changeset 12849


Ignore:
Timestamp:
Sep 6, 2011, 11:31:23 PM (10 years ago)
Author:
livings124
Message:

add a bit more spacing within the torrent cell, and make the code more easily changeable in the future

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/macosx/TorrentCell.m

    r12846 r12849  
    4747#define HEIGHT_STATUS 12.0
    4848
    49 #define PADDING_HORIZONTAL 3.0
    50 #define PADDING_BETWEEN_IMAGE_AND_TITLE 5.0
    51 #define PADDING_BETWEEN_IMAGE_AND_BAR 4.0
     49#define PADDING_HORIZONTAL 5.0
     50#define PADDING_BETWEEN_BUTTONS 4.0
     51#define PADDING_BETWEEN_IMAGE_AND_TITLE (PADDING_HORIZONTAL + 1.0)
     52#define PADDING_BETWEEN_IMAGE_AND_BAR PADDING_HORIZONTAL
    5253#define PADDING_BETWEEN_TITLE_AND_PRIORITY 3.0
    5354#define PADDING_ABOVE_TITLE 4.0
     
    674675    result.size = [string size];
    675676   
    676     result.origin.x = NSMaxX(bounds) - (NSWidth(result) + PADDING_HORIZONTAL * 2.0);
     677    result.origin.x = NSMaxX(bounds) - (PADDING_HORIZONTAL + NSWidth(result));
    677678    result.origin.y = ceil(NSMidY(bounds) - NSHeight(result) * 0.5);
    678679   
     
    743744   
    744745    result.size.width = floor(NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL
    745                         - 2.0 * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH));
     746                        - 2.0 * (PADDING_BETWEEN_BUTTONS + NORMAL_BUTTON_WIDTH));
    746747   
    747748    return result;
     
    754755    result.origin.y = NSMinY(bounds) + PADDING_BETWEEN_BAR_AND_EDGE_MIN;
    755756    result.size.height = NSHeight(bounds) - 2.0 * PADDING_BETWEEN_BAR_AND_EDGE_MIN;
    756     result.size.width = NSMaxX(bounds) - NSMinX(result) - PADDING_HORIZONTAL;
     757    result.size.width = NSMaxX(bounds) - NSMinX(result) - PADDING_BETWEEN_BAR_AND_EDGE_MIN;
    757758   
    758759    return result;
     
    764765    result.size.height = NORMAL_BUTTON_WIDTH;
    765766    result.size.width = NORMAL_BUTTON_WIDTH;
    766     result.origin.x = NSMaxX(bounds) - 2.0 * (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH);
     767    result.origin.x = NSMaxX(bounds) - (PADDING_HORIZONTAL + NORMAL_BUTTON_WIDTH + PADDING_BETWEEN_BUTTONS + NORMAL_BUTTON_WIDTH);
    767768   
    768769    if (![fDefaults boolForKey: @"SmallView"])
     
    770771                            + PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
    771772    else
    772     {
    773773        result.origin.y = ceil(NSMidY(bounds) - NSHeight(result) * 0.5);
    774         result.origin.x -= PADDING_HORIZONTAL;
    775     }
    776774   
    777775    return result;
     
    789787                            + PADDING_BETWEEN_TITLE_AND_PROGRESS + HEIGHT_STATUS + PADDING_BETWEEN_PROGRESS_AND_BAR;
    790788    else
    791     {
    792789        result.origin.y = ceil(NSMidY(bounds) - NSHeight(result) * 0.5);
    793         result.origin.x -= PADDING_HORIZONTAL;
    794     }
    795790   
    796791    return result;
Note: See TracChangeset for help on using the changeset viewer.