Redesign settings UI and add new settings functionality

Revamps the settings section in Big Picture mode with a tabbed interface for Themes, Display, Privacy, and About panels. Adds theme selection with live preview and persistence, display scale adjustment, privacy controls for clearing data/history/search, and an About panel showing app and environment info. Updates main process to handle theme and display scale changes, and implements corresponding renderer logic and styles.
This commit is contained in:
2025-12-28 11:00:20 +13:00
parent 399e8da5b4
commit 1687f34e9b
4 changed files with 1066 additions and 18 deletions
+332 -2
View File
@@ -386,7 +386,15 @@ body.mouse-active {
}
.bp-section.active {
display: block;
display: flex;
flex-direction: column;
}
/* Special layout for settings section */
#section-settings.active {
display: flex;
flex-direction: column;
height: 100%;
}
@keyframes fadeIn {
@@ -940,7 +948,7 @@ body.mouse-active {
margin-left: auto;
}
/* Settings grid */
/* Settings grid (legacy) */
.settings-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
@@ -984,6 +992,328 @@ body.mouse-active {
color: var(--bp-text);
}
/* New Settings UI */
.settings-tabs {
display: flex;
gap: var(--bp-spacing-sm);
margin-bottom: var(--bp-spacing-lg);
padding-bottom: var(--bp-spacing-md);
border-bottom: 1px solid var(--bp-border);
flex-wrap: wrap;
}
.settings-tab {
display: flex;
align-items: center;
gap: var(--bp-spacing-sm);
padding: var(--bp-spacing-sm) var(--bp-spacing-md);
background: transparent;
border: 2px solid transparent;
border-radius: var(--bp-radius-md);
color: var(--bp-text-muted);
font-size: 1rem;
font-weight: 500;
cursor: pointer;
transition: all var(--bp-transition-fast);
}
.settings-tab:hover {
background: var(--bp-surface);
color: var(--bp-text);
}
.settings-tab.active {
background: var(--bp-surface);
border-color: var(--bp-primary);
color: var(--bp-text);
}
.settings-tab:focus {
outline: none;
border-color: var(--bp-primary);
box-shadow: var(--bp-focus-ring);
}
.settings-tab.focused {
border-color: var(--bp-primary);
box-shadow: var(--bp-focus-ring);
background: var(--bp-surface);
color: var(--bp-text);
}
.settings-tab .material-symbols-outlined {
font-size: 24px;
}
.settings-panels {
flex: 1;
overflow-y: auto;
}
.settings-panel {
display: none;
animation: fadeIn var(--bp-transition-normal);
}
.settings-panel.active {
display: block;
}
.settings-panel-title {
font-size: 1.25rem;
font-weight: 600;
color: var(--bp-text);
margin-bottom: var(--bp-spacing-md);
}
/* Theme Grid */
.theme-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
gap: var(--bp-spacing-md);
}
.theme-card {
display: flex;
flex-direction: column;
align-items: center;
gap: var(--bp-spacing-sm);
padding: var(--bp-spacing-md);
background: var(--bp-surface);
border: 2px solid var(--bp-border);
border-radius: var(--bp-radius-lg);
cursor: pointer;
transition: all var(--bp-transition-fast);
}
.theme-card:hover {
background: var(--bp-surface-hover);
transform: translateY(-2px);
}
.theme-card:focus {
outline: none;
border-color: var(--bp-primary);
box-shadow: var(--bp-focus-ring);
transform: translateY(-2px) scale(1.02);
}
.theme-card.focused {
border-color: var(--bp-primary);
box-shadow: var(--bp-focus-ring);
transform: translateY(-2px) scale(1.02);
}
.theme-card.active {
border-color: var(--bp-accent);
box-shadow: 0 0 0 2px var(--bp-accent);
}
.theme-preview {
width: 100%;
height: 60px;
border-radius: var(--bp-radius-sm);
box-shadow: inset 0 0 0 1px rgba(255,255,255,0.1);
}
.theme-name {
font-size: 0.9rem;
font-weight: 500;
color: var(--bp-text);
}
/* Settings Options */
.settings-option {
display: flex;
align-items: center;
justify-content: space-between;
padding: var(--bp-spacing-md);
background: var(--bp-surface);
border: 1px solid var(--bp-border);
border-radius: var(--bp-radius-md);
margin-bottom: var(--bp-spacing-sm);
}
.option-info {
display: flex;
align-items: center;
gap: var(--bp-spacing-md);
}
.option-info > .material-symbols-outlined {
font-size: 28px;
color: var(--bp-accent);
}
.option-text {
display: flex;
flex-direction: column;
gap: 2px;
}
.option-label {
font-size: 1rem;
font-weight: 600;
color: var(--bp-text);
}
.option-description {
font-size: 0.85rem;
color: var(--bp-text-muted);
}
.option-control {
display: flex;
align-items: center;
gap: var(--bp-spacing-sm);
}
.scale-btn {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
background: var(--bp-surface-hover);
border: 2px solid var(--bp-border);
border-radius: var(--bp-radius-sm);
color: var(--bp-text);
cursor: pointer;
transition: all var(--bp-transition-fast);
}
.scale-btn:hover {
background: var(--bp-primary);
border-color: var(--bp-primary);
}
.scale-btn:focus {
outline: none;
border-color: var(--bp-primary);
box-shadow: var(--bp-focus-ring);
}
.scale-btn.focused {
border-color: var(--bp-primary);
box-shadow: var(--bp-focus-ring);
background: var(--bp-primary);
}
.scale-value {
min-width: 60px;
text-align: center;
font-size: 1.1rem;
font-weight: 600;
color: var(--bp-text);
}
.action-button {
display: flex;
align-items: center;
gap: var(--bp-spacing-sm);
padding: var(--bp-spacing-sm) var(--bp-spacing-md);
background: var(--bp-surface-hover);
border: 2px solid var(--bp-border);
border-radius: var(--bp-radius-md);
color: var(--bp-text);
font-size: 0.95rem;
font-weight: 500;
cursor: pointer;
transition: all var(--bp-transition-fast);
}
.action-button:hover {
background: var(--bp-primary);
border-color: var(--bp-primary);
}
.action-button:focus {
outline: none;
border-color: var(--bp-primary);
box-shadow: var(--bp-focus-ring);
}
.action-button.focused {
border-color: var(--bp-primary);
box-shadow: var(--bp-focus-ring);
background: var(--bp-primary);
}
.action-button.danger:hover {
background: #dc3545;
border-color: #dc3545;
}
/* About Panel */
.about-info {
display: flex;
flex-direction: column;
gap: var(--bp-spacing-lg);
}
.about-logo {
display: flex;
align-items: center;
gap: var(--bp-spacing-md);
padding: var(--bp-spacing-md);
background: var(--bp-surface);
border-radius: var(--bp-radius-lg);
}
.about-logo-img {
width: 64px;
height: 64px;
}
.about-title h3 {
font-size: 1.5rem;
font-weight: 600;
color: var(--bp-text);
margin: 0;
}
.about-title span {
font-size: 0.9rem;
color: var(--bp-text-muted);
}
.about-details {
display: flex;
flex-direction: column;
gap: var(--bp-spacing-xs);
padding: var(--bp-spacing-md);
background: var(--bp-surface);
border-radius: var(--bp-radius-md);
}
.about-row {
display: flex;
justify-content: space-between;
padding: var(--bp-spacing-xs) 0;
border-bottom: 1px solid var(--bp-border);
}
.about-row:last-child {
border-bottom: none;
}
.about-label {
color: var(--bp-text-muted);
font-size: 0.9rem;
}
.about-value {
color: var(--bp-text);
font-weight: 500;
font-size: 0.9rem;
}
.about-actions {
display: flex;
gap: var(--bp-spacing-md);
flex-wrap: wrap;
}
/* Footer controller hints */
.bp-footer {
position: relative;