mirror of
https://github.com/Alex313031/thorium.git
synced 2025-01-09 19:37:30 -03:00
add tab hover card flag
This commit is contained in:
parent
1dc0e9e0ce
commit
cc3c37747e
5 changed files with 26 additions and 3 deletions
|
@ -175,7 +175,10 @@ Disable fetching Field Trials/Variations Patch - https://github.com/ungoogled-so
|
|||
|
||||
Enable double click to close tab flag - https://github.com/bigfoxtail/brave-core/commit/acec5efcbaa98722611f551712f051fb343af120
|
||||
- Found by @gz83, modified by me.
|
||||
|
||||
|
||||
Enable disabling tab hover cards patch - https://github.com/ungoogled-software/ungoogled-chromium/blob/master/patches/extra/ungoogled-chromium/add-flag-for-tab-hover-cards.patch
|
||||
- Credit win32ss for alerting me to this patch.
|
||||
|
||||
Enable close confirmation patch - https://github.com/ungoogled-software/ungoogled-chromium/blob/master/patches/extra/ungoogled-chromium/add-flag-for-close-confirmation.patch
|
||||
- Modified by me.
|
||||
|
||||
|
|
|
@ -100,6 +100,16 @@ const FeatureEntry::Choice kForceGpuMemAvailableMbChoices[] = {
|
|||
"force-gpu-mem-available-mb", "1024"},
|
||||
};
|
||||
|
||||
const FeatureEntry::Choice kTabHoverCardChoices[] = {
|
||||
{flags_ui::kGenericExperimentChoiceDefault, "", ""},
|
||||
{"None",
|
||||
"tab-hover-cards",
|
||||
"none"},
|
||||
{"Tooltip",
|
||||
"tab-hover-cards",
|
||||
"tooltip"},
|
||||
};
|
||||
|
||||
const FeatureEntry::Choice kCloseConfirmation[] = {
|
||||
{flags_ui::kGenericExperimentChoiceDefault, "", ""},
|
||||
{"Show confirmation with last window",
|
||||
|
|
|
@ -114,6 +114,10 @@
|
|||
"Double Click to Close Tab",
|
||||
"Enables double clicking a tab to close it.",
|
||||
kOsDesktop, SINGLE_VALUE_TYPE("double-click-close-tab")},
|
||||
{"tab-hover-cards",
|
||||
"Tab Hover Cards",
|
||||
"Allows removing the tab hover cards or using a tooltip as a replacement.",
|
||||
kOsDesktop, MULTI_VALUE_TYPE(kTabHoverCardChoices)},
|
||||
|
||||
#if !BUILDFLAG(IS_ANDROID)
|
||||
{"media-router",
|
||||
|
|
|
@ -709,8 +709,12 @@ void Tab::OnGestureEvent(ui::GestureEvent* event) {
|
|||
}
|
||||
|
||||
std::u16string Tab::GetTooltipText(const gfx::Point& p) const {
|
||||
// Tab hover cards replace tooltips for tabs.
|
||||
return std::u16string();
|
||||
// Tab hover cards don't replace tooltips for tabs in all cases.
|
||||
if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("tab-hover-cards") == "tooltip") {
|
||||
return GetTooltipText(data_.title, GetAlertStateToShow(data_.alert_state));
|
||||
} else {
|
||||
return std::u16string();
|
||||
}
|
||||
}
|
||||
|
||||
void Tab::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
|
|
|
@ -1660,6 +1660,8 @@ void TabStrip::OnMouseEventInTab(views::View* source,
|
|||
}
|
||||
|
||||
void TabStrip::UpdateHoverCard(Tab* tab, HoverCardUpdateType update_type) {
|
||||
if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("tab-hover-cards") == "tooltip" ||
|
||||
base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII("tab-hover-cards") == "none") return;
|
||||
tab_container_->UpdateHoverCard(tab, update_type);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue