Skip to content

Commit

Permalink
Fix bug in Look & Feel page.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlex94 committed Nov 12, 2024
1 parent fc5309b commit b4e6eaf
Showing 1 changed file with 15 additions and 35 deletions.
50 changes: 15 additions & 35 deletions waterfox/browser/components/preferences/content/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const gThemePane = {
// Animations
{ id: 'userChrome.decoration.disable_panel_animate', type: 'bool' },
{ id: 'userChrome.decoration.disable_sidebar_animate', type: 'bool' },

// == Interface Components ===============================================
// Tab Bar
{ id: 'userChrome.tab.photon_like_contextline', type: 'bool' },
Expand All @@ -75,18 +75,18 @@ const gThemePane = {
{ id: 'userChrome.rounding.square_tab', type: 'bool' },
{ id: 'userChrome.tab.bottom_rounded_corner', type: 'bool' },
{ id: 'userChrome.tab.squareTabCorners', type: 'bool' },

// Nav Bar
{ id: 'userChrome.rounding.square_button', type: 'bool' },

// Panels
{ id: 'userChrome.rounding.square_panel', type: 'bool' },
{ id: 'userChrome.rounding.square_panelitem', type: 'bool' },
{ id: 'userChrome.rounding.square_menupopup', type: 'bool' },
{ id: 'userChrome.rounding.square_menuitem', type: 'bool' },
{ id: 'userChrome.rounding.square_field', type: 'bool' },
{ id: 'userChrome.rounding.square_checklabel', type: 'bool' },

// == Autohide & Hidden ==================================================
// Tab Bar
{ id: 'userChrome.autohide.tab', type: 'bool' },
Expand All @@ -103,19 +103,19 @@ const gThemePane = {
{ id: 'userChrome.autohide.bookmarkbar', type: 'bool' },
{ id: 'userChrome.hidden.bookmarkbar_icon', type: 'bool' },
{ id: 'userChrome.hidden.bookmarkbar_label', type: 'bool' },

// Panels
{ id: 'userChrome.hidden.disabled_menu', type: 'bool' },

// Sidebar
{ id: 'userChrome.autohide.sidebar', type: 'bool' },
{ id: 'userChrome.hidden.sidebar_header', type: 'bool' },

// == Center =============================================================
// Tab Bar
{ id: 'userChrome.centered.tab', type: 'bool' },
{ id: 'userChrome.centered.tab.label', type: 'bool' },

// Nav Bar
{ id: 'userChrome.centered.urlbar', type: 'bool' },
]
Expand All @@ -132,7 +132,7 @@ const gThemePane = {
pref: 'userChrome.centered.tab',
},
]
},
},

get presets() {
return [
Expand All @@ -141,7 +141,7 @@ const gThemePane = {
on: [
{ id: 'userChrome.tab.connect_to_window', value: true },
{ id: 'userChrome.tab.color_like_toolbar', value: true },

{ id: 'userChrome.tab.lepton_like_padding', value: false },
{ id: 'userChrome.tab.photon_like_padding', value: true },

Expand Down Expand Up @@ -169,7 +169,7 @@ const gThemePane = {
on: [
{ id: 'userChrome.tab.connect_to_window', value: true },
{ id: 'userChrome.tab.color_like_toolbar', value: true },

{ id: 'userChrome.tab.lepton_like_padding', value: true },
{ id: 'userChrome.tab.photon_like_padding', value: false },

Expand Down Expand Up @@ -197,7 +197,7 @@ const gThemePane = {
on: [
{ id: 'userChrome.tab.connect_to_window', value: false },
{ id: 'userChrome.tab.color_like_toolbar', value: false },

{ id: 'userChrome.tab.lepton_like_padding', value: false },
{ id: 'userChrome.tab.photon_like_padding', value: false },

Expand Down Expand Up @@ -232,7 +232,7 @@ const gThemePane = {
{ id: 'userContent.page.proton_color.system_accent', value: false },
{ id: 'widget.non-native-theme.use-theme-accent', value: false },
],

'1': [
{ id: 'userChrome.theme.proton_color.dark_blue_accent', value: false },
{ id: 'userContent.page.proton_color.dark_blue_accent', value: false },
Expand All @@ -249,7 +249,7 @@ const gThemePane = {
{ id: 'widget.non-native-theme.use-theme-accent', value: true },
]
}
},
},

init() {
// Initialize prefs
Expand All @@ -268,7 +268,7 @@ const gThemePane = {
const button = document.getElementById(preset.id)
if (button) {
button.addEventListener('click', event => {
for (const pref of preset['on']) {
for (const pref of preset.on) {
PrefUtils.set(pref.id, pref.value)
}
})
Expand All @@ -288,26 +288,6 @@ const gThemePane = {
popup.addEventListener('mouseout', this)
}

// Init theme customizations
const waterfoxCustomizations = document.getElementById(
'waterfoxUserChromeCustomizations'
)
if (waterfoxCustomizations) {
const presetBox = document.getElementById('waterfoxUserChromePresets')
presetBox.hidden = userChromeEnabled === 2
const themeGroup = document.getElementById(
'waterfoxUserChromeCustomizations'
)
themeGroup.hidden = userChromeEnabled === 2

this._prefObservers.push(
PrefUtils.addObserver(this.WATERFOX_THEME_PREF, isEnabled => {
presetBox.hidden = isEnabled === 2
themeGroup.hidden = isEnabled === 2
})
)
}

// Init AccentColor
this.initAccentColor()

Expand Down Expand Up @@ -398,7 +378,7 @@ const gThemePane = {
for (const pref of this.accentPrefs[menulist.value]) {
PrefUtils.set(pref.id, pref.value)
}
}
}
})
},

Expand Down

0 comments on commit b4e6eaf

Please sign in to comment.