Updated the settings dialog button styling.

This commit is contained in:
Jas Singh
2024-07-26 23:58:16 -07:00
parent 932006f760
commit 77c79a2d99
5 changed files with 90 additions and 44 deletions

View File

@@ -1,3 +1,24 @@
import { Opt } from "lib/option";
export type Unit = "imperial" | "metric"; export type Unit = "imperial" | "metric";
export type PowerOptions = "sleep" | "reboot" | "logout" | "shutdown"; export type PowerOptions = "sleep" | "reboot" | "logout" | "shutdown";
export type NotificationAnchor = "top" | "top right" | "top left" | "bottom" | "bottom right" | "bottom left"; export type NotificationAnchor = "top" | "top right" | "top left" | "bottom" | "bottom right" | "bottom left";
export type RowProps<T> = {
opt: Opt<T>
title: string
note?: string
type?:
| "number"
| "color"
| "float"
| "object"
| "string"
| "enum"
| "boolean"
| "img"
| "font"
enums?: string[]
max?: number
min?: number
subtitle?: string
}

View File

@@ -25,24 +25,26 @@ window.settings-dialog {
button.close { button.close {
color: $bar-menus-iconbuttons-passive; color: $bar-menus-iconbuttons-passive;
image { image {
font-size: 2em; font-size: 2em;
} }
&:hover { &:hover {
color: $bar-menus-iconbuttons-active; color: $bar-menus-buttons-active;
} }
} }
button.reset { button.reset {
color: $bar-menus-iconbuttons-passive; color: $bar-menus-iconbuttons-passive;
padding: $padding*.5; padding: $padding*.5;
image { image {
font-size: 1.25em; font-size: 1.25em;
} }
&:hover { &:hover {
color: $bar-menus-iconbuttons-active; color: $bar-menus-buttons-active;
} }
} }
} }
@@ -159,52 +161,79 @@ window.settings-dialog {
.reset { .reset {
color: $bar-menus-iconbuttons-passive; color: $bar-menus-iconbuttons-passive;
} }
.options-label { .options-label {
color: $bar-menus-text; color: $bar-menus-text;
} }
.options-sublabel { .options-sublabel {
font-size: 0.75em; font-size: 0.75em;
margin-top: 0.2em; margin-top: 0.2em;
color: $bar-menus-dimtext; color: $bar-menus-dimtext;
} }
.inputter-container { .inputter-container {
border-radius: $bar-menus-border-radius * 0.5; border-radius: $bar-menus-border-radius * 0.5;
:first-child { :first-child {
border-radius: $bar-menus-border-radius * 0.5; border-radius: $bar-menus-border-radius * 0.5;
} }
padding: 0.35em 0.35em; padding: 0.35em 0.35em;
background: $surface1; background: $surface1;
margin-right: 1em; margin-right: 1em;
} }
} }
.options-header { .options-header {
margin: 1em 1em; margin: 1em 1em;
.label-name { .label-name {
color: $bar-menus-label; color: $bar-menus-label;
font-size: 0.9em; font-size: 0.9em;
margin-right: 0.5em; margin-right: 0.5em;
} }
} }
.pager-button { .pager-button {
margin: 0.5em 0.75em; margin: 0.5em 0.75em;
&.category label{ &.category label {
font-size: 1.4em; font-size: 1.4em;
} }
&:hover { &:hover {
color: $bar-menus-iconbuttons-active; color: $bar-menus-iconbuttons-active;
} }
&.active { &.active {
color: $bar-menus-iconbuttons-active; color: $bar-menus-iconbuttons-active;
} }
} }
.bar-theme-page { min-height: 40em;
.bar-theme-page {
min-height: 40em;
} }
.settings-menu-stack { .settings-menu-stack {
background: $red; background: $red;
} }
.paged-container { .paged-container {
.reset-options {
color: $bar-menus-iconbuttons-passive;
image:disabled {
color: $bar-menus-buttons-disabled;
}
&:hover {
image {
color: $bar-menus-buttons-active;
}
}
}
scrollbar { scrollbar {
margin-right: 0.2em; margin-right: 0.2em;
min-width: 0.6em; min-width: 0.6em;
@@ -217,15 +246,18 @@ window.settings-dialog {
background: $bar-menus-buttons-default; background: $bar-menus-buttons-default;
} }
} }
selection { selection {
background: $bar-menus-background; background: $bar-menus-background;
} }
switch { switch {
font-size: 10px; font-size: 10px;
&:checked { &:checked {
background: $bar-menus-switch-enabled; background: $bar-menus-switch-enabled;
} }
slider { slider {
background-color: $bar-menus-switch-puck; background-color: $bar-menus-switch-puck;
} }
@@ -264,6 +296,7 @@ dialog {
viewport { viewport {
border-right: .25em solid $bar-menus-border-color; border-right: .25em solid $bar-menus-border-color;
list { list {
row { row {
padding: 0em 1.5em; padding: 0em 1.5em;
@@ -272,6 +305,7 @@ dialog {
background: $bar-menus-buttons-default; background: $bar-menus-buttons-default;
color: $bar-menus-buttons-text; color: $bar-menus-buttons-text;
} }
label { label {
margin: 0.5em 0.5em; margin: 0.5em 0.5em;
font-size: 0.85em; font-size: 0.85em;
@@ -280,6 +314,7 @@ dialog {
} }
} }
stack { stack {
.horizontal .path-bar { .horizontal .path-bar {
button { button {
@@ -295,6 +330,7 @@ dialog {
&:hover { &:hover {
background: transparentize($bar-menus-buttons-active, 0.5); background: transparentize($bar-menus-buttons-active, 0.5);
} }
label { label {
margin: 0em 0.25em; margin: 0em 0.25em;
color: $bar-menus-buttons-text color: $bar-menus-buttons-text
@@ -304,12 +340,13 @@ dialog {
margin: 0em 0.5em; margin: 0em 0.5em;
color: $bar-menus-buttons-text color: $bar-menus-buttons-text
} }
margin: 0.25em; margin: 0.25em;
} }
} }
} }
treeview header button{ treeview header button {
padding: 0.25em; padding: 0.25em;
border: .15em solid $bar-menus-border-color; border: .15em solid $bar-menus-border-color;
} }

View File

@@ -1,25 +1,7 @@
import { Opt } from "lib/option" import { Opt } from "lib/option"
import Gdk from "gi://Gdk" import Gdk from "gi://Gdk"
import icons from "lib/icons" import icons from "lib/icons"
import { RowProps } from "lib/types/options"
export type RowProps<T> = {
opt: Opt<T>
title: string
note?: string
type?:
| "number"
| "color"
| "float"
| "object"
| "string"
| "enum"
| "boolean"
| "img"
| "font"
enums?: string[]
max?: number
min?: number
}
const EnumSetter = (opt: Opt<string>, values: string[]) => { const EnumSetter = (opt: Opt<string>, values: string[]) => {
const lbl = Widget.Label({ label: opt.bind().as(v => `${v}`) }) const lbl = Widget.Label({ label: opt.bind().as(v => `${v}`) })

View File

@@ -1,4 +1,4 @@
export const Label = (name, sub = "") => { export const Label = (name: string, sub = "") => {
return Widget.Box({ return Widget.Box({
vertical: true, vertical: true,
hpack: "start", hpack: "start",

View File

@@ -1,8 +1,14 @@
import { Label } from "./Label"; import { Label } from "./Label";
import { Inputter } from "./Inputter"; import { Inputter } from "./Inputter";
import icons from "lib/icons"; import icons from "lib/icons";
import { RowProps } from "lib/types/options";
export const Option = (props, className = '') => { type Option = {
title: string,
subtitle: string,
}
export const Option = <T>(props: RowProps<T>, className: string = '') => {
return Widget.Box({ return Widget.Box({
class_name: "option-item", class_name: "option-item",
hexpand: true, hexpand: true,
@@ -16,7 +22,7 @@ export const Option = (props, className = '') => {
Inputter(props, className), Inputter(props, className),
Widget.Button({ Widget.Button({
vpack: "center", vpack: "center",
class_name: "reset", class_name: "reset-options",
child: Widget.Icon(icons.ui.refresh), child: Widget.Icon(icons.ui.refresh),
on_clicked: () => props.opt.reset(), on_clicked: () => props.opt.reset(),
sensitive: props.opt.bind().as(v => v !== props.opt.initial), sensitive: props.opt.bind().as(v => v !== props.opt.initial),