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:
@@ -1,13 +1,27 @@
|
||||
export const BarItemBox = (child) => {
|
||||
import Gtk from "gi://Gtk?version=3.0";
|
||||
import { Child } from "lib/types/bar";
|
||||
import options from "options";
|
||||
import { ButtonProps } from "types/widgets/button";
|
||||
|
||||
export const BarItemBox = (child: Child): ButtonProps<Gtk.Widget> => {
|
||||
const computeVisible = () => {
|
||||
if (Object.hasOwnProperty.call(child, "isVis")) {
|
||||
if (child.isVis !== undefined) {
|
||||
return child.isVis.bind("value");
|
||||
}
|
||||
return child.isVisible;
|
||||
};
|
||||
|
||||
return Widget.Button({
|
||||
class_name: `bar_item_box_visible ${Object.hasOwnProperty.call(child, "boxClass") ? child.boxClass : ""}`,
|
||||
class_name: options.theme.bar.buttons.style.bind("value").as((style) => {
|
||||
const styleMap = {
|
||||
default: "style1",
|
||||
split: "style2",
|
||||
wave: "style3",
|
||||
wave2: "style4",
|
||||
};
|
||||
|
||||
return `bar_item_box_visible ${styleMap[style]} ${Object.hasOwnProperty.call(child, "boxClass") ? child.boxClass : ""}`;
|
||||
}),
|
||||
child: child.component,
|
||||
visible: computeVisible(),
|
||||
...child.props,
|
||||
|
||||
Reference in New Issue
Block a user