-
Notifications
You must be signed in to change notification settings - Fork 920
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Vertical tab settings to brave://settings (uplift to 1.51.x) (#1…
…8183) * Uplift of #18146 (squashed) to beta * Resurrect "Use vertical tabs" Context menu Base on our latest design guide, we need "Use vertical tabs" menu. * Build fix trial --------- Co-authored-by: sangwoo.ko <sangwoo108@gmail.com>
- Loading branch information
1 parent
79cd4f6
commit a2f27a1
Showing
13 changed files
with
168 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
browser/resources/settings/brave_appearance_page/tabs.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
<!-- This file will be converted into tabs.html.js using //tools/grit/preprocess_if_expr --> | ||
<style include="settings-shared iron-flex"> | ||
.border { | ||
border-top: var(--cr-separator-line); | ||
border-bottom: var(--cr-separator-line); | ||
} | ||
|
||
.settings-box { | ||
padding: 0 | ||
} | ||
</style> | ||
|
||
<div class="cr-row">$i18n{appearanceSettingsTabsSection}</div> | ||
<div class="list-frame"> | ||
<!-- Vertical Tab strip --> | ||
<template is="dom-if" if="[[isVerticalTabStripFeatureEnabled()]]"> | ||
<settings-toggle-button | ||
class="cr-row list-item" | ||
pref="{{prefs.brave.tabs.vertical_tabs_enabled}}" | ||
label="$i18n{appearanceSettingsTabsUseVerticalTabs}"> | ||
</settings-toggle-button> | ||
<template | ||
is="dom-if" | ||
if="[[prefs.brave.tabs.vertical_tabs_enabled.value]]"> | ||
<div class="cr-row"> | ||
<settings-checkbox | ||
class="cr-row list-item" | ||
pref="{{prefs.brave.tabs.vertical_tabs_show_title_on_window}}" | ||
label="$i18n{appearanceSettingsTabsShowWindowTitle}"> | ||
</settings-checkbox> | ||
</div> | ||
<div class="cr-row"> | ||
<settings-checkbox | ||
class="cr-row list-item" | ||
pref="{{prefs.brave.tabs.vertical_tabs_floating_enabled}}" | ||
label="$i18n{appearanceSettingsTabsFloatOnMouseOver}"> | ||
</settings-checkbox> | ||
</div> | ||
</template> <!-- vertical_tabs_enabled.value --> | ||
</template> <!-- isVerticalTabStripFeatureEnabled()--> | ||
|
||
<!-- Tab search button visibility --> | ||
<settings-toggle-button | ||
pref="{{prefs.brave.tabs_search_show}}" | ||
class="cr-row list-item" | ||
label="$i18n{showSearchTabsBtn}"> | ||
</settings-toggle-button> | ||
|
||
<!-- Tab speaker icons function --> | ||
<settings-toggle-button | ||
pref="{{prefs.brave.tabs.mute_indicator_not_clickable}}" | ||
class="cr-row list-item" | ||
label="$i18n{braveDisableClickableMuteIndicators}"> | ||
</settings-toggle-button> | ||
|
||
<!-- Tab hover mode --> | ||
<div class="cr-row list-item settings-box"> | ||
<div class="flex"> | ||
<div class="label">$i18n{appearanceSettingsTabHoverMode}</div> | ||
</div> | ||
<settings-dropdown-menu | ||
pref="{{prefs.brave.tabs.hover_mode}}" | ||
menu-options="[[tabTooltipModes_]]"> | ||
</settings-dropdown-menu> | ||
</div> | ||
</div> <!-- .list-frame --> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// Copyright (c) 2023 The Brave Authors. All rights reserved. | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this file, | ||
// You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
import {PolymerElement} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js' | ||
import {I18nMixin, I18nMixinInterface} from 'chrome://resources/cr_elements/i18n_mixin.js' | ||
import {PrefsMixin, PrefsMixinInterface} from '../prefs/prefs_mixin.js' | ||
import '../settings_shared.css.js' | ||
import '../settings_vars.css.js' | ||
import {getTemplate} from './tabs.html.js' | ||
import { loadTimeData } from '../i18n_setup.js' | ||
|
||
const SettingsBraveAppearanceTabsElementBase = PrefsMixin(I18nMixin(PolymerElement)) as { | ||
new (): PolymerElement & I18nMixinInterface & PrefsMixinInterface | ||
} | ||
|
||
export class SettingsBraveAppearanceTabsElement extends SettingsBraveAppearanceTabsElementBase { | ||
static get is() { | ||
return 'settings-brave-appearance-tabs' | ||
} | ||
|
||
static get template() { | ||
return getTemplate() | ||
} | ||
|
||
private isVerticalTabStripFeatureEnabled() { | ||
return loadTimeData.getBoolean('verticalTabStripFeatureEnabled') | ||
} | ||
|
||
private tabTooltipModes_ = [ | ||
{ value: 1, name: this.i18n('appearanceSettingsTabHoverModeCard') }, | ||
{ | ||
value: 2, | ||
name: this.i18n('appearanceSettingsTabHoverModeCardWithPreview') | ||
}, | ||
{ value: 0, name: this.i18n('appearanceSettingsTabHoverModeTooltip') } | ||
] | ||
|
||
} | ||
|
||
customElements.define(SettingsBraveAppearanceTabsElement.is, SettingsBraveAppearanceTabsElement) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.