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

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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/views/download/download_item_view.cc
  9. +++ b/chrome/browser/ui/views/download/download_item_view.cc
  10. @@ -120,14 +120,14 @@
  11. // The vertical distance between the item's visual upper bound (as delineated
  12. // by the separator on the right) and the edge of the shelf.
  13. -constexpr int kTopBottomPadding = 6;
  14. +constexpr int kTopBottomPadding = 0;
  15. // The minimum vertical padding above and below contents of the download item.
  16. // This is only used when the text size is large.
  17. constexpr int kMinimumVerticalPadding = 2 + kTopBottomPadding;
  18. // The normal height of the item which may be exceeded if text is large.
  19. -constexpr int kDefaultDownloadItemHeight = 48;
  20. +constexpr int kDefaultDownloadItemHeight = 24;
  21. // Amount of time between accessible alert events.
  22. constexpr auto kAccessibleAlertInterval = base::TimeDelta::FromSeconds(30);
  23. --- a/chrome/browser/ui/layout_constants.cc
  24. +++ b/chrome/browser/ui/layout_constants.cc
  25. @@ -33,13 +33,13 @@
  26. case BOOKMARK_BAR_HEIGHT:
  27. // The fixed margin ensures the bookmark buttons appear centered relative
  28. // to the white space above and below.
  29. - static constexpr int kBookmarkBarAttachedVerticalMargin = 4;
  30. + static constexpr int kBookmarkBarAttachedVerticalMargin = 0;
  31. return GetLayoutConstant(BOOKMARK_BAR_BUTTON_HEIGHT) +
  32. kBookmarkBarAttachedVerticalMargin;
  33. case BOOKMARK_BAR_BUTTON_HEIGHT:
  34. - return touch_ui ? 36 : 28;
  35. + return touch_ui ? 36 : 24;
  36. case BOOKMARK_BAR_NTP_HEIGHT:
  37. - return touch_ui ? GetLayoutConstant(BOOKMARK_BAR_HEIGHT) : 39;
  38. + return touch_ui ? GetLayoutConstant(BOOKMARK_BAR_HEIGHT) : 27;
  39. case WEB_APP_MENU_BUTTON_SIZE:
  40. return 24;
  41. case WEB_APP_PAGE_ACTION_ICON_SIZE:
  42. @@ -47,17 +47,17 @@
  43. // stretching the container view.
  44. return 16;
  45. case LOCATION_BAR_BUBBLE_FONT_VERTICAL_PADDING:
  46. - return 2;
  47. + return 0;
  48. case LOCATION_BAR_BUBBLE_ANCHOR_VERTICAL_INSET:
  49. return 1;
  50. case LOCATION_BAR_CHILD_INTERIOR_PADDING:
  51. - return 3;
  52. + return 1;
  53. case LOCATION_BAR_ELEMENT_PADDING:
  54. return touch_ui ? 3 : 2;
  55. case LOCATION_BAR_HEIGHT:
  56. if (OmniboxFieldTrial::RichAutocompletionTwoLineOmnibox())
  57. return touch_ui ? 52 : 40;
  58. - return touch_ui ? 36 : 28;
  59. + return touch_ui ? 36 : 24;
  60. case LOCATION_BAR_ICON_SIZE:
  61. return touch_ui ? 20 : 16;
  62. case TAB_AFTER_TITLE_PADDING:
  63. @@ -67,7 +67,7 @@
  64. case TAB_ALERT_INDICATOR_ICON_WIDTH:
  65. return touch_ui ? 12 : 16;
  66. case TAB_HEIGHT:
  67. - return (touch_ui ? 41 : 34) + GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP);
  68. + return (touch_ui ? 41 : 30) + GetLayoutConstant(TABSTRIP_TOOLBAR_OVERLAP);
  69. case TAB_PRE_TITLE_PADDING:
  70. return 8;
  71. case TAB_STACK_DISTANCE:
  72. @@ -75,7 +75,7 @@
  73. case TABSTRIP_TOOLBAR_OVERLAP:
  74. return 1;
  75. case TOOLBAR_BUTTON_HEIGHT:
  76. - return touch_ui ? 48 : 28;
  77. + return touch_ui ? 48 : 24;
  78. case TOOLBAR_ELEMENT_PADDING:
  79. return touch_ui ? 0 : 4;
  80. case TOOLBAR_STANDARD_SPACING:
  81. @@ -103,7 +103,7 @@
  82. }
  83. case TOOLBAR_INTERIOR_MARGIN:
  84. - return touch_ui ? gfx::Insets() : gfx::Insets(4, 8);
  85. + return touch_ui ? gfx::Insets() : gfx::Insets(0, 8);
  86. }
  87. NOTREACHED();
  88. return gfx::Insets();