Added 3 new styles for bar buttons. (#168)

* Added a new style called split for bar buttons

* Added wavy button styles.

* Added padding configuration

* Update bar padding

* Fix styling for battery style2

* Fix icon only setting for bar

* Update types and options

* Add button style to exported theme props.

* Fix top margin for menus.
This commit is contained in:
Jas Singh
2024-08-24 00:01:21 -07:00
committed by GitHub
parent c0d9c594c9
commit 2908ff7dd6
31 changed files with 459 additions and 58 deletions

View File

@@ -3,6 +3,10 @@ import Gio from "gi://Gio"
import { bash, Notify } from "lib/utils";
import icons from "lib/icons"
const whiteListedThemeProp = [
"theme.bar.buttons.style"
];
export const saveFileDialog = (filePath: string, themeOnly: boolean): void => {
const original_file_path = filePath;
@@ -25,7 +29,10 @@ export const saveFileDialog = (filePath: string, themeOnly: boolean): void => {
for (let key in jsonObject) {
if (typeof jsonObject[key] === 'string' && hexColorPattern.test(jsonObject[key])) {
filteredObject[key] = jsonObject[key];
} else if (whiteListedThemeProp.includes(key)) {
filteredObject[key] = jsonObject[key];
}
}
return filteredObject;
@@ -37,6 +44,11 @@ export const saveFileDialog = (filePath: string, themeOnly: boolean): void => {
let filteredObject = {};
for (let key in jsonObject) {
// do not add key-value pair if its in whiteListedThemeProp
if (whiteListedThemeProp.includes(key)) {
continue;
}
if (!(typeof jsonObject[key] === 'string' && hexColorPattern.test(jsonObject[key]))) {
filteredObject[key] = jsonObject[key];
}
@@ -162,9 +174,12 @@ export const importFiles = (themeOnly: boolean = false): void => {
const filterConfigForThemeOnly = (config: object) => {
let filteredConfig = {};
for (let key in config) {
if (typeof config[key] === 'string' && hexColorPattern.test(config[key])) {
filteredConfig[key] = config[key];
} else if (whiteListedThemeProp.includes(key)) {
filteredConfig[key] = config[key];
}
}
return filteredConfig;
@@ -173,6 +188,10 @@ export const importFiles = (themeOnly: boolean = false): void => {
const filterConfigForNonTheme = (config: object) => {
let filteredConfig = {};
for (let key in config) {
// do not add key-value pair if its in whiteListedThemeProp
if (whiteListedThemeProp.includes(key)) {
continue;
}
if (!(typeof config[key] === 'string' && hexColorPattern.test(config[key]))) {
filteredConfig[key] = config[key];
}