add theming select back
This commit is contained in:
parent
ba1df39624
commit
86c038ec57
5 changed files with 35 additions and 3 deletions
|
@ -716,6 +716,16 @@ class Localuser{
|
|||
regen();
|
||||
})
|
||||
}
|
||||
{
|
||||
const tas=settings.addButton("Themes & sounds");
|
||||
{
|
||||
const themes=["Dark","WHITE","Light"];
|
||||
tas.addSelect("Theme:",_=>{
|
||||
localStorage.setItem("theme",themes[_]);
|
||||
setTheme();
|
||||
},themes,{defaultIndex:themes.indexOf(localStorage.getItem("theme"))});
|
||||
}
|
||||
}
|
||||
settings.show();
|
||||
}
|
||||
/**
|
||||
|
|
|
@ -195,7 +195,7 @@ class SelectInput implements OptionsElement{
|
|||
span.textContent=this.label;
|
||||
div.append(span);
|
||||
const select=document.createElement("select");
|
||||
select.selectedIndex=this.index;
|
||||
|
||||
select.onchange=this.onChange.bind(this);
|
||||
for(const thing of this.options){
|
||||
const option = document.createElement("option");
|
||||
|
@ -203,6 +203,7 @@ class SelectInput implements OptionsElement{
|
|||
select.appendChild(option);
|
||||
}
|
||||
this.select=new WeakRef(select);
|
||||
select.selectedIndex=this.index;
|
||||
div.append(select);
|
||||
return div;
|
||||
}
|
||||
|
@ -374,6 +375,11 @@ class Options implements OptionsElement{
|
|||
this.options.push(options);
|
||||
return options;
|
||||
}
|
||||
addSelect(label:string,onSubmit:(str:number)=>void,selections:string[],{defaultIndex=0}={}){
|
||||
const select=new SelectInput(label,onSubmit,selections,this,{defaultIndex});
|
||||
this.options.push(select);
|
||||
return select;
|
||||
}
|
||||
addFileInput(label:string,onSubmit:(files:FileList)=>void,{}={}){
|
||||
const FI=new FileInput(label,onSubmit,this,{});
|
||||
this.options.push(FI);
|
||||
|
|
|
@ -1248,7 +1248,7 @@ span {
|
|||
}
|
||||
.settingbuttons{
|
||||
padding-top:.075in;
|
||||
width: 1.5in;
|
||||
width: 1.75in;
|
||||
border-right: solid var(--message-bg-hover);
|
||||
gap:.04in;
|
||||
flex-grow: 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue