mirror of
https://github.com/Alex313031/thorium.git
synced 2025-01-09 19:37:30 -03:00
mac fix and Th24 UI start
This commit is contained in:
parent
dcc6bec0ac
commit
07bd646449
4 changed files with 132 additions and 10 deletions
|
@ -1098,10 +1098,13 @@ config("thinlto_optimize_default") {
|
|||
ldflags = [ "/opt:lldlto=" + lto_opt_level ]
|
||||
ldflags += [ "-mllvm:-enable-pre=false", ]
|
||||
ldflags += [ "-opt:lldltocgo=" + lto_opt_level ]
|
||||
} else {
|
||||
} else if (is_linux || is_chromeos) {
|
||||
ldflags = [ "-Wl,--lto-O" + lto_opt_level ]
|
||||
ldflags += [ "-Wl,-mllvm,-enable-pre=false", ]
|
||||
ldflags += [ "-Wl,--lto-CGO" + lto_opt_level ]
|
||||
} else {
|
||||
ldflags = [ "-Wl,--lto-O" + lto_opt_level ]
|
||||
ldflags += [ "-Wl,--lto-CGO" + lto_opt_level ]
|
||||
}
|
||||
|
||||
if (toolchain_supports_rust_thin_lto) {
|
||||
|
@ -1136,10 +1139,13 @@ config("thinlto_optimize_max") {
|
|||
ldflags = [ "/opt:lldlto=" + lto_opt_level ]
|
||||
ldflags += [ "-mllvm:-enable-pre=false", ]
|
||||
ldflags += [ "-opt:lldltocgo=" + lto_opt_level ]
|
||||
} else {
|
||||
} else if (is_linux || is_chromeos) {
|
||||
ldflags = [ "-Wl,--lto-O" + lto_opt_level ]
|
||||
ldflags += [ "-Wl,-mllvm,-enable-pre=false", ]
|
||||
ldflags += [ "-Wl,--lto-CGO" + lto_opt_level ]
|
||||
} else {
|
||||
ldflags = [ "-Wl,--lto-O" + lto_opt_level ]
|
||||
ldflags += [ "-Wl,--lto-CGO" + lto_opt_level ]
|
||||
}
|
||||
|
||||
if (toolchain_supports_rust_thin_lto) {
|
||||
|
@ -2391,11 +2397,17 @@ if (is_win) {
|
|||
"-O3",
|
||||
]
|
||||
|
||||
common_optimize_on_ldflags += [
|
||||
"-Wl,-mllvm,-aggressive-ext-opt",
|
||||
"-Wl,-mllvm,-enable-gvn-hoist",
|
||||
"-Wl,-O3",
|
||||
]
|
||||
if (is_mac) {
|
||||
common_optimize_on_ldflags += [
|
||||
"-Wl,-O3",
|
||||
]
|
||||
} else {
|
||||
common_optimize_on_ldflags += [
|
||||
"-Wl,-mllvm,-aggressive-ext-opt",
|
||||
"-Wl,-mllvm,-enable-gvn-hoist",
|
||||
"-Wl,-O3",
|
||||
]
|
||||
}
|
||||
|
||||
if (use_polly == true) {
|
||||
common_optimize_on_ldflags += [
|
||||
|
|
106
other/thorium-2024-ui.patch
Normal file
106
other/thorium-2024-ui.patch
Normal file
|
@ -0,0 +1,106 @@
|
|||
diff --git a/chrome/browser/ui/layout_constants.cc b/chrome/browser/ui/layout_constants.cc
|
||||
index bba403a7e5068..23b719abb0975 100644
|
||||
--- a/chrome/browser/ui/layout_constants.cc
|
||||
+++ b/chrome/browser/ui/layout_constants.cc
|
||||
@@ -1,9 +1,10 @@
|
||||
-// Copyright 2015 The Chromium Authors
|
||||
+// Copyright 2024 The Chromium Authors and Alex313031
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chrome/browser/ui/layout_constants.h"
|
||||
|
||||
+#include "base/command_line.h"
|
||||
#include "base/feature_list.h"
|
||||
#include "base/notreached.h"
|
||||
#include "build/build_config.h"
|
||||
@@ -19,6 +20,7 @@
|
||||
|
||||
int GetLayoutConstant(LayoutConstant constant) {
|
||||
const bool touch_ui = ui::TouchUiController::Get()->touch_ui();
|
||||
+ static const bool thorium_2024 = base::CommandLine::ForCurrentProcess()->HasSwitch("thorium-2024");
|
||||
switch (constant) {
|
||||
case APP_MENU_PROFILE_ROW_AVATAR_ICON_SIZE:
|
||||
return 24;
|
||||
@@ -27,8 +29,7 @@ int GetLayoutConstant(LayoutConstant constant) {
|
||||
case BOOKMARK_BAR_HEIGHT: {
|
||||
// The fixed margin ensures the bookmark buttons appear centered relative
|
||||
// to the white space above and below.
|
||||
- const int bookmark_bar_attached_vertical_margin =
|
||||
- features::IsChromeRefresh2023() ? 6 : 4;
|
||||
+ const int bookmark_bar_attached_vertical_margin = thorium_2024 ? 4 : 6;
|
||||
return GetLayoutConstant(BOOKMARK_BAR_BUTTON_HEIGHT) +
|
||||
bookmark_bar_attached_vertical_margin;
|
||||
}
|
||||
@@ -97,7 +98,7 @@ int GetLayoutConstant(LayoutConstant constant) {
|
||||
return GetLayoutConstant(TAB_HEIGHT) +
|
||||
GetLayoutConstant(TAB_STRIP_PADDING);
|
||||
case TAB_STRIP_PADDING:
|
||||
- return features::IsChromeRefresh2023() ? 6 : 0;
|
||||
+ return thorium_2024 ? 1 : 6;
|
||||
case TAB_SEPARATOR_HEIGHT:
|
||||
// TODO (crbug.com/1451400): ChromeRefresh2023 needs different values for
|
||||
// this constant.
|
||||
diff --git a/chrome/browser/ui/tabs/tab_style.cc b/chrome/browser/ui/tabs/tab_style.cc
|
||||
index aa9cd30374311..96a1ea8faf9d0 100644
|
||||
--- a/chrome/browser/ui/tabs/tab_style.cc
|
||||
+++ b/chrome/browser/ui/tabs/tab_style.cc
|
||||
@@ -1,4 +1,4 @@
|
||||
-// Copyright 2019 The Chromium Authors
|
||||
+// Copyright 2024 The Chromium Authors and Alex313031
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@@ -16,12 +16,12 @@ namespace {
|
||||
// the tab.
|
||||
constexpr int kGM2SeparatorThickness = 1;
|
||||
constexpr int kChromeRefreshSeparatorThickness = 2;
|
||||
-constexpr int kChromeRefreshSeparatorHorizontalMargin = 2;
|
||||
+constexpr int kChromeRefreshSeparatorHorizontalMargin = 1;
|
||||
// TODO (crbug.com/1451400): This constant should be in LayoutConstants.
|
||||
-constexpr int kChromeRefreshSeparatorHeight = 16;
|
||||
+constexpr int kChromeRefreshSeparatorHeight = 20;
|
||||
|
||||
// The padding from the top of the tab to the content area.
|
||||
-constexpr int kChromeRefreshTabVerticalPadding = 6;
|
||||
+constexpr int kChromeRefreshTabVerticalPadding = 8;
|
||||
constexpr int kChromeRefreshTabHorizontalPadding = 8;
|
||||
|
||||
class GM2TabStyle : public TabStyle {
|
||||
diff --git a/ui/views/layout/layout_provider.cc b/ui/views/layout/layout_provider.cc
|
||||
index 3684e27766834..0606853f1f6df 100644
|
||||
--- a/ui/views/layout/layout_provider.cc
|
||||
+++ b/ui/views/layout/layout_provider.cc
|
||||
@@ -1,4 +1,4 @@
|
||||
-// Copyright 2017 The Chromium Authors
|
||||
+// Copyright 2024 The Chromium Authors and Alex313031
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
+#include "base/command_line.h"
|
||||
#include "base/containers/fixed_flat_map.h"
|
||||
#include "base/logging.h"
|
||||
#include "ui/base/ui_base_features.h"
|
||||
@@ -233,6 +234,18 @@ int LayoutProvider::GetCornerRadiusMetric(ShapeContextTokens id,
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
+ static const bool thorium_2024 = base::CommandLine::ForCurrentProcess()->HasSwitch("thorium-2024");
|
||||
+ if (thorium_2024) {
|
||||
+ switch (id) {
|
||||
+ case ShapeContextTokens::kMenuRadius:
|
||||
+ case ShapeContextTokens::kMenuAuxRadius: {
|
||||
+ return 0;
|
||||
+ }
|
||||
+ case ShapeContextTokens::kMenuTouchRadius: {
|
||||
+ return 3;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
ShapeSysTokens token = GetShapeSysToken(id);
|
||||
DCHECK_NE(token, ShapeSysTokens::kDefault)
|
|
@ -34,6 +34,10 @@
|
|||
"The default placement of the tab search button was changed to the left of the tabstrip in M125, but Thorium has reverted this back "
|
||||
"to the original righthand placement. This flag is for people who want the new CR23 left aligned behavior.",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("left-aligned-tab-search-button")},
|
||||
{"thorium-2024",
|
||||
"Enable Experimental Thorium 2024 (Th24) UI",
|
||||
"Enable an experimental \"hybrid\" UI, with the pre-Chrome Refresh 2023 tab height, and square rather than rounded menus.",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("thorium-2024")},
|
||||
{"disable-thorium-dns-config",
|
||||
"Disable Thorium Custom DNS Config",
|
||||
"Disables the custom DNS configuration used by default in Thorium. Useful when this config breaks something, "
|
||||
|
|
|
@ -90,9 +90,9 @@ bool TrackedSplitPreference::EnforceAndReport(
|
|||
helper_.GetAction(value_state);
|
||||
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch("disable-machine-id") ||
|
||||
base::CommandLine::ForCurrentProcess()->HasSwitch("disable-encryption") ||
|
||||
base::CommandLine::ForCurrentProcess()->HasSwitch("revert-from-portable")) {
|
||||
reset_action = TrackedPreferenceHelper::DONT_RESET;
|
||||
base::CommandLine::ForCurrentProcess()->HasSwitch("disable-encryption") ||
|
||||
base::CommandLine::ForCurrentProcess()->HasSwitch("revert-from-portable")) {
|
||||
reset_action = TrackedPreferenceHelper::DONT_RESET;
|
||||
}
|
||||
|
||||
helper_.ReportAction(reset_action);
|
||||
|
|
Loading…
Reference in a new issue