refactor to {fg,bg}_{normal,focus}_inactive

This commit is contained in:
Nooo37 2021-09-27 14:59:09 +02:00
parent 23e228802c
commit 8ad1be28b0
5 changed files with 36 additions and 26 deletions

View File

@ -36,8 +36,10 @@ theme.tabbar_bg_normal = "#000000" -- background color of the focused client on
theme.tabbar_fg_normal = "#ffffff" -- foreground color of the focused client on the tabbar theme.tabbar_fg_normal = "#ffffff" -- foreground color of the focused client on the tabbar
theme.tabbar_bg_focus = "#1A2026" -- background color of unfocused clients on the tabbar theme.tabbar_bg_focus = "#1A2026" -- background color of unfocused clients on the tabbar
theme.tabbar_fg_focus = "#ff0000" -- foreground color of unfocused clients on the tabbar theme.tabbar_fg_focus = "#ff0000" -- foreground color of unfocused clients on the tabbar
theme.tabbar_bg_inactive = nil -- background color of the current client on the tabbar when unfocused theme.tabbar_bg_focus_inactive = nil -- background color of the focused client on the tabbar when inactive
theme.tabbar_fg_inactive = nil -- foreground color of the current client on the tabbar when unfocused theme.tabbar_fg_focus_inactive = nil -- foreground color of the focused client on the tabbar when inactive
theme.tabbar_bg_normal_inactive = nil -- background color of unfocused clients on the tabbar when inactive
theme.tabbar_fg_normal_inactive = nil -- foreground color of unfocused clients on the tabbar when inactive
-- mstab -- mstab
theme.mstab_bar_ontop = false -- whether you want to allow the bar to be ontop of clients theme.mstab_bar_ontop = false -- whether you want to allow the bar to be ontop of clients

View File

@ -8,18 +8,20 @@ local bg_normal = beautiful.tabbar_bg_normal or beautiful.bg_normal or "#ffffff"
local fg_normal = beautiful.tabbar_fg_normal or beautiful.fg_normal or "#000000" local fg_normal = beautiful.tabbar_fg_normal or beautiful.fg_normal or "#000000"
local bg_focus = beautiful.tabbar_bg_focus or beautiful.bg_focus or "#000000" local bg_focus = beautiful.tabbar_bg_focus or beautiful.bg_focus or "#000000"
local fg_focus = beautiful.tabbar_fg_focus or beautiful.fg_focus or "#ffffff" local fg_focus = beautiful.tabbar_fg_focus or beautiful.fg_focus or "#ffffff"
local bg_inactive = beautiful.tabbar_bg_inactive or bg_focus local bg_focus_inactive = beautiful.tabbar_bg_focus_inactive or bg_focus
local fg_inactive = beautiful.tabbar_fg_inactive or fg_focus local fg_focus_inactive = beautiful.tabbar_fg_focus_inactive or fg_focus
local bg_normal_inactive = beautiful.tabbar_bg_normal_inactive or bg_normal
local fg_normal_inactive = beautiful.tabbar_fg_normal_inactive or fg_normal
local font = beautiful.tabbar_font or beautiful.font or "Hack 15" local font = beautiful.tabbar_font or beautiful.font or "Hack 15"
local size = beautiful.tabbar_size or 40 local size = beautiful.tabbar_size or 40
local position = beautiful.tabbar_position or "bottom" local position = beautiful.tabbar_position or "bottom"
local function create(c, focused_bool, buttons, inactive_bool) local function create(c, focused_bool, buttons, inactive_bool)
local bg_temp = bg_normal local bg_temp = inactive_bool and bg_normal_inactive or bg_normal
local fg_temp = fg_normal local fg_temp = inactive_bool and fg_normal_inactive or fg_normal
if focused_bool then if focused_bool then
bg_temp = inactive_bool and bg_inactive or bg_focus bg_temp = inactive_bool and bg_focus_inactive or bg_focus
fg_temp = inactive_bool and fg_inactive or fg_focus fg_temp = inactive_bool and fg_focus_inactive or fg_focus
end end
local wid_temp = wibox.widget({ local wid_temp = wibox.widget({
{ {

View File

@ -7,8 +7,10 @@ local bg_normal = beautiful.tabbar_bg_normal or beautiful.bg_normal or "#ffffff"
local fg_normal = beautiful.tabbar_fg_normal or beautiful.fg_normal or "#000000" local fg_normal = beautiful.tabbar_fg_normal or beautiful.fg_normal or "#000000"
local bg_focus = beautiful.tabbar_bg_focus or beautiful.bg_focus or "#000000" local bg_focus = beautiful.tabbar_bg_focus or beautiful.bg_focus or "#000000"
local fg_focus = beautiful.tabbar_fg_focus or beautiful.fg_focus or "#ffffff" local fg_focus = beautiful.tabbar_fg_focus or beautiful.fg_focus or "#ffffff"
local bg_inactive = beautiful.tabbar_bg_inactive or bg_focus local bg_focus_inactive = beautiful.tabbar_bg_focus_inactive or bg_focus
local fg_inactive = beautiful.tabbar_fg_inactive or fg_focus local fg_focus_inactive = beautiful.tabbar_fg_focus_inactive or fg_focus
local bg_normal_inactive = beautiful.tabbar_bg_normal_inactive or bg_normal
local fg_normal_inactive = beautiful.tabbar_fg_normal_inactive or fg_normal
local font = beautiful.tabbar_font or beautiful.font or "Hack 15" local font = beautiful.tabbar_font or beautiful.font or "Hack 15"
local size = beautiful.tabbar_size or 20 local size = beautiful.tabbar_size or 20
local position = beautiful.tabbar_position or "top" local position = beautiful.tabbar_position or "top"
@ -16,11 +18,11 @@ local position = beautiful.tabbar_position or "top"
local function create(c, focused_bool, buttons, inactive_bool) local function create(c, focused_bool, buttons, inactive_bool)
local flexlist = wibox.layout.flex.horizontal() local flexlist = wibox.layout.flex.horizontal()
local title_temp = c.name or c.class or "-" local title_temp = c.name or c.class or "-"
local bg_temp = bg_normal local bg_temp = inactive_bool and bg_normal_inactive or bg_normal
local fg_temp = fg_normal local fg_temp = inactive_bool and fg_normal_inactive or fg_normal
if focused_bool then if focused_bool then
bg_temp = inactive_bool and bg_inactive or bg_focus bg_temp = inactive_bool and bg_focus_inactive or bg_focus
fg_temp = inactive_bool and fg_inactive or fg_focus fg_temp = inactive_bool and fg_focus_inactive or fg_focus
end end
local text_temp = wibox.widget.textbox() local text_temp = wibox.widget.textbox()
text_temp.align = "center" text_temp.align = "center"

View File

@ -10,8 +10,10 @@ local bg_normal = beautiful.tabbar_bg_normal or beautiful.bg_normal or "#ffffff"
local fg_normal = beautiful.tabbar_fg_normal or beautiful.fg_normal or "#000000" local fg_normal = beautiful.tabbar_fg_normal or beautiful.fg_normal or "#000000"
local bg_focus = beautiful.tabbar_bg_focus or beautiful.bg_focus or "#000000" local bg_focus = beautiful.tabbar_bg_focus or beautiful.bg_focus or "#000000"
local fg_focus = beautiful.tabbar_fg_focus or beautiful.fg_focus or "#ffffff" local fg_focus = beautiful.tabbar_fg_focus or beautiful.fg_focus or "#ffffff"
local bg_inactive = beautiful.tabbar_bg_inactive or bg_focus local bg_focus_inactive = beautiful.tabbar_bg_focus_inactive or bg_focus
local fg_inactive = beautiful.tabbar_fg_inactive or fg_focus local fg_focus_inactive = beautiful.tabbar_fg_focus_inactive or fg_focus
local bg_normal_inactive = beautiful.tabbar_bg_normal_inactive or bg_normal
local fg_normal_inactive = beautiful.tabbar_fg_normal_inactive or fg_normal
local font = beautiful.tabbar_font or beautiful.font or "Hack 15" local font = beautiful.tabbar_font or beautiful.font or "Hack 15"
local size = beautiful.tabbar_size or dpi(40) local size = beautiful.tabbar_size or dpi(40)
local border_radius = beautiful.mstab_border_radius local border_radius = beautiful.mstab_border_radius
@ -71,11 +73,11 @@ end
local function create(c, focused_bool, buttons, inactive_bool) local function create(c, focused_bool, buttons, inactive_bool)
-- local flexlist = wibox.layout.flex.horizontal() -- local flexlist = wibox.layout.flex.horizontal()
local title_temp = c.name or c.class or "-" local title_temp = c.name or c.class or "-"
local bg_temp = bg_normal local bg_temp = inactive_bool and bg_normal_inactive or bg_normal
local fg_temp = fg_normal local fg_temp = inactive_bool and fg_normal_inactive or fg_normal
if focused_bool then if focused_bool then
bg_temp = inactive_bool and bg_inactive or bg_focus bg_temp = inactive_bool and bg_focus_inactive or bg_focus
fg_temp = inactive_bool and fg_inactive or fg_focus fg_temp = inactive_bool and fg_focus_inactive or fg_focus
end end
local text_temp = wibox.widget.textbox() local text_temp = wibox.widget.textbox()
text_temp.align = "center" text_temp.align = "center"

View File

@ -8,18 +8,20 @@ local bg_normal = beautiful.tabbar_bg_normal or beautiful.bg_normal or "#ffffff"
local fg_normal = beautiful.tabbar_fg_normal or beautiful.fg_normal or "#000000" local fg_normal = beautiful.tabbar_fg_normal or beautiful.fg_normal or "#000000"
local bg_focus = beautiful.tabbar_bg_focus or beautiful.bg_focus or "#000000" local bg_focus = beautiful.tabbar_bg_focus or beautiful.bg_focus or "#000000"
local fg_focus = beautiful.tabbar_fg_focus or beautiful.fg_focus or "#ffffff" local fg_focus = beautiful.tabbar_fg_focus or beautiful.fg_focus or "#ffffff"
local bg_inactive = beautiful.tabbar_bg_inactive or bg_focus local bg_focus_inactive = beautiful.tabbar_bg_focus_inactive or bg_focus
local fg_inactive = beautiful.tabbar_fg_inactive or fg_focus local fg_focus_inactive = beautiful.tabbar_fg_focus_inactive or fg_focus
local bg_normal_inactive = beautiful.tabbar_bg_normal_inactive or bg_normal
local fg_normal_inactive = beautiful.tabbar_fg_normal_inactive or fg_normal
local font = beautiful.tabbar_font or beautiful.font or "Hack 15" local font = beautiful.tabbar_font or beautiful.font or "Hack 15"
local size = beautiful.tabbar_size or 20 local size = beautiful.tabbar_size or 20
local position = beautiful.tabbar_position or "top" local position = beautiful.tabbar_position or "top"
local function create(c, focused_bool, buttons, inactive_bool) local function create(c, focused_bool, buttons, inactive_bool)
local bg_temp = bg_normal local bg_temp = inactive_bool and bg_normal_inactive or bg_normal
local fg_temp = fg_normal local fg_temp = inactive_bool and fg_normal_inactive or fg_normal
if focused_bool then if focused_bool then
bg_temp = inactive_bool and bg_inactive or bg_focus bg_temp = inactive_bool and bg_focus_inactive or bg_focus
fg_temp = inactive_bool and fg_inactive or fg_focus fg_temp = inactive_bool and fg_focus_inactive or fg_focus
end end
local wid_temp = wibox.widget({ local wid_temp = wibox.widget({