thinner-tabbar-toolbar-bookmarkbar-downloadbar.patch 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. ## This patch makes the tabbar, toolbar, bookmarkbar, and downloadbar thinner.
  2. #
  3. # These are the values that I'm comfortable with, adjust to your liking.
  4. #
  5. # Even though the download items are set to 24px, that's really a minimum.
  6. # Their height is based on the height of two rows of text using your current
  7. # font, so that could vary depending on your settings.
  8. --- a/chrome/browser/ui/layout_constants.cc
  9. +++ b/chrome/browser/ui/layout_constants.cc
  10. @@ -33,13 +33,13 @@ int GetLayoutConstant(LayoutConstant con
  11. case BOOKMARK_BAR_HEIGHT:
  12. // The fixed margin ensures the bookmark buttons appear centered relative
  13. // to the white space above and below.
  14. - static constexpr int kBookmarkBarAttachedVerticalMargin = 4;
  15. + static constexpr int kBookmarkBarAttachedVerticalMargin = 0;
  16. return GetLayoutConstant(BOOKMARK_BAR_BUTTON_HEIGHT) +
  17. kBookmarkBarAttachedVerticalMargin;
  18. case BOOKMARK_BAR_BUTTON_HEIGHT:
  19. - return touch_ui ? 36 : 28;
  20. + return touch_ui ? 36 : 24;
  21. case BOOKMARK_BAR_NTP_HEIGHT:
  22. - return touch_ui ? GetLayoutConstant(BOOKMARK_BAR_HEIGHT) : 39;
  23. + return touch_ui ? GetLayoutConstant(BOOKMARK_BAR_HEIGHT) : 27;
  24. case WEB_APP_MENU_BUTTON_SIZE:
  25. return 24;
  26. case WEB_APP_PAGE_ACTION_ICON_SIZE:
  27. @@ -47,15 +47,15 @@ int GetLayoutConstant(LayoutConstant con
  28. // stretching the container view.
  29. return 16;
  30. case LOCATION_BAR_BUBBLE_FONT_VERTICAL_PADDING:
  31. - return 2;
  32. + return 0;
  33. case LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET:
  34. return 1;
  35. case LOCATION_BAR_CHILD_INTERIOR_PADDING:
  36. - return 3;
  37. + return 1;
  38. case LOCATION_BAR_ELEMENT_PADDING:
  39. return touch_ui ? 3 : 2;
  40. case LOCATION_BAR_HEIGHT:
  41. - return touch_ui ? 36 : 28;
  42. + return touch_ui ? 36 : 24;
  43. case LOCATION_BAR_ICON_SIZE:
  44. return touch_ui ? 20 : 16;
  45. case TAB_AFTER_TITLE_PADDING:
  46. @@ -65,7 +65,7 @@ int GetLayoutConstant(LayoutConstant con
  47. case TAB_ALERT_INDICATOR_ICON_WIDTH:
  48. return touch_ui ? 12 : 16;
  49. case TAB_HEIGHT:
  50. - return (touch_ui ? 41 : 34) + GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP);
  51. + return (touch_ui ? 41 : 30) + GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP);
  52. case TAB_PRE_TITLE_PADDING:
  53. return 8;
  54. case TAB_STACK_DISTANCE:
  55. @@ -79,7 +79,7 @@ int GetLayoutConstant(LayoutConstant con
  56. return 0;
  57. return 1;
  58. case TOOLBAR_BUTTON_HEIGHT:
  59. - return touch_ui ? 48 : 28;
  60. + return touch_ui ? 48 : 24;
  61. case TOOLBAR_ELEMENT_PADDING:
  62. return touch_ui ? 0 : 4;
  63. case TOOLBAR_STANDARD_SPACING:
  64. @@ -109,7 +109,7 @@ gfx::Insets GetLayoutInsets(LayoutInset
  65. }
  66. case TOOLBAR_INTERIOR_MARGIN:
  67. - return touch_ui ? gfx::Insets() : gfx::Insets(4, 8);
  68. + return touch_ui ? gfx::Insets() : gfx::Insets(0, 8);
  69. }
  70. NOTREACHED();
  71. return gfx::Insets();
  72. --- a/chrome/browser/ui/views/download/download_item_view.cc
  73. +++ b/chrome/browser/ui/views/download/download_item_view.cc
  74. @@ -129,7 +129,7 @@ constexpr int kProgressIndicatorSize = 2
  75. // The vertical distance between the item's visual upper bound (as delineated
  76. // by the separator on the right) and the edge of the shelf.
  77. -constexpr int kTopBottomPadding = 6;
  78. +constexpr int kTopBottomPadding = 0;
  79. // The minimum vertical padding above and below contents of the download item.
  80. // This is only used when the text size is large.
  81. @@ -593,7 +593,7 @@ gfx::Size DownloadItemView::CalculatePre
  82. }
  83. // The normal height of the item which may be exceeded if text is large.
  84. - constexpr int kDefaultDownloadItemHeight = 48;
  85. + constexpr int kDefaultDownloadItemHeight = 24;
  86. return gfx::Size(width, std::max(kDefaultDownloadItemHeight,
  87. 2 * kMinimumVerticalPadding + height));
  88. }