Changeset 92319 in webkit


Ignore:
Timestamp:
Aug 3, 2011 3:42:46 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

Chromium Mac: Fix position of search tickmarks
https://bugs.webkit.org/show_bug.cgi?id=65575

This change adjusts the position of search tickmarks so that they are correctly centered.

Also, insetting the tickmark rect by 5 pixels caused tickmarks on the overlay scrollbar to look very small. I changed this to inset by 4 pixels instead. The tickmark is the same width as the overlay scrollbar which looks much better.

Patch by Sailesh Agrawal <sail@chromium.org> on 2011-08-03
Reviewed by James Robinson.

  • platform/chromium/ScrollbarThemeChromiumMac.mm:

(WebCore::ScrollbarThemeChromiumMac::paint):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r92316 r92319  
     12011-08-03  Sailesh Agrawal  <sail@chromium.org>
     2
     3        Chromium Mac: Fix position of search tickmarks
     4        https://bugs.webkit.org/show_bug.cgi?id=65575
     5
     6        This change adjusts the position of search tickmarks so that they are correctly centered.
     7
     8        Also, insetting the tickmark rect by 5 pixels caused tickmarks on the overlay scrollbar to look very small. I changed this to inset by 4 pixels instead. The tickmark is the same width as the overlay scrollbar which looks much better.
     9
     10        Reviewed by James Robinson.
     11
     12        * platform/chromium/ScrollbarThemeChromiumMac.mm:
     13        (WebCore::ScrollbarThemeChromiumMac::paint):
     14
    1152011-08-03  Sailesh Agrawal  <sail@chromium.org>
    216
  • trunk/Source/WebCore/platform/chromium/ScrollbarThemeChromiumMac.mm

    r92248 r92319  
    492492
    493493        IntRect tickmarkTrackRect(IntPoint(), trackRect(scrollbar, false).size());
    494         // Inset by 2 on the left and 3 on the right.
    495         tickmarkTrackRect.setX(tickmarkTrackRect.x() + 2);
    496         tickmarkTrackRect.setWidth(tickmarkTrackRect.width() - 3);
     494        if (tickmarkTrackRect.width() <= 10) {
     495            // For narrow scrollbars inset by 1 on the left and 3 on the right.
     496            tickmarkTrackRect.setX(tickmarkTrackRect.x() + 1);
     497            tickmarkTrackRect.setWidth(tickmarkTrackRect.width() - 4);
     498        } else {
     499            // For wide scrollbars inset by 2 on the left and 3 on the right.
     500            tickmarkTrackRect.setX(tickmarkTrackRect.x() + 2);
     501            tickmarkTrackRect.setWidth(tickmarkTrackRect.width() - 5);
     502        }
    497503        paintTickmarks(context, scrollbar, tickmarkTrackRect);
    498504
     
    567573    // Inset by 2 on the left and 3 on the right.
    568574    tickmarkTrackRect.setX(tickmarkTrackRect.x() + 2);
    569     tickmarkTrackRect.setWidth(tickmarkTrackRect.width() - 3);
     575    tickmarkTrackRect.setWidth(tickmarkTrackRect.width() - 5);
    570576    paintTickmarks(drawingContext, scrollbar, tickmarkTrackRect);
    571577
Note: See TracChangeset for help on using the changeset viewer.