a lot of stuff
This commit is contained in:
@@ -17,28 +17,28 @@ awful.titlebar.enable_tooltip = true
|
||||
awful.titlebar.fallback_name = 'Client'
|
||||
|
||||
local double_click_event_handler = function(double_click_event)
|
||||
if double_click_timer then
|
||||
double_click_timer:stop()
|
||||
double_click_timer = nil
|
||||
double_click_event()
|
||||
return
|
||||
end
|
||||
double_click_timer = gears.timer.start_new(
|
||||
0.20,
|
||||
function()
|
||||
double_click_timer = nil
|
||||
return false
|
||||
end
|
||||
)
|
||||
if double_click_timer then
|
||||
double_click_timer:stop()
|
||||
double_click_timer = nil
|
||||
double_click_event()
|
||||
return
|
||||
end
|
||||
double_click_timer = gears.timer.start_new(
|
||||
0.20,
|
||||
function()
|
||||
double_click_timer = nil
|
||||
return false
|
||||
end
|
||||
)
|
||||
end
|
||||
|
||||
local create_click_events = function (c)
|
||||
local create_click_events = function(c)
|
||||
local buttons = gears.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
function ()
|
||||
double_click_event_handler(function ()
|
||||
function()
|
||||
double_click_event_handler(function()
|
||||
if c.floating then
|
||||
c.float = false
|
||||
return
|
||||
@@ -52,7 +52,7 @@ local create_click_events = function (c)
|
||||
awful.button(
|
||||
{},
|
||||
3,
|
||||
function ()
|
||||
function()
|
||||
c:activate { context = 'titlebar', action = 'mouse_resize' }
|
||||
end
|
||||
)
|
||||
@@ -60,12 +60,12 @@ local create_click_events = function (c)
|
||||
return buttons
|
||||
end
|
||||
|
||||
local createresize_click_events = function (c)
|
||||
local createresize_click_events = function(c)
|
||||
local buttons = gears.table.join(
|
||||
awful.button(
|
||||
{},
|
||||
1,
|
||||
function ()
|
||||
function()
|
||||
c:activate { context = 'titlebar', action = 'mouse_resize' }
|
||||
end
|
||||
)
|
||||
@@ -73,21 +73,21 @@ local createresize_click_events = function (c)
|
||||
return buttons
|
||||
end
|
||||
|
||||
local create_titlebar = function (c, bg, size)
|
||||
local create_titlebar = function(c, bg, size)
|
||||
local titlebar = awful.titlebar(c, {
|
||||
position = "left",
|
||||
bg = bg,
|
||||
size = size
|
||||
})
|
||||
|
||||
titlebar : setup {
|
||||
titlebar:setup {
|
||||
{
|
||||
{
|
||||
{
|
||||
awful.titlebar.widget.closebutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Red200"],
|
||||
shape = function (cr, height, width)
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
id = "closebutton"
|
||||
@@ -96,7 +96,7 @@ local create_titlebar = function (c, bg, size)
|
||||
awful.titlebar.widget.maximizedbutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Yellow200"],
|
||||
shape = function (cr, height, width)
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
id = "maximizebutton"
|
||||
@@ -105,22 +105,22 @@ local create_titlebar = function (c, bg, size)
|
||||
awful.titlebar.widget.minimizebutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Green200"],
|
||||
shape = function (cr, height, width)
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
id = "minimizebutton"
|
||||
},
|
||||
spacing = dpi(10),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
id = "spacing"
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
id = "spacing"
|
||||
},
|
||||
margins = dpi(8),
|
||||
widget = wibox.container.margin,
|
||||
id = "margin"
|
||||
},
|
||||
{
|
||||
buttons = create_click_events(c),
|
||||
layout = wibox.layout.flex.vertical
|
||||
buttons = create_click_events(c),
|
||||
layout = wibox.layout.flex.vertical
|
||||
},
|
||||
{
|
||||
{
|
||||
@@ -132,26 +132,26 @@ local create_titlebar = function (c, bg, size)
|
||||
layout = wibox.layout.align.vertical,
|
||||
id = "main"
|
||||
}
|
||||
hover_signal(titlebar.main.margin.spacing.closebutton, color.color["Red200"])
|
||||
hover_signal(titlebar.main.margin.spacing.maximizebutton, color.color["Yellow200"])
|
||||
hover_signal(titlebar.main.margin.spacing.minimizebutton, color.color["Green200"])
|
||||
Hover_signal(titlebar.main.margin.spacing.closebutton, color.color["Red200"])
|
||||
Hover_signal(titlebar.main.margin.spacing.maximizebutton, color.color["Yellow200"])
|
||||
Hover_signal(titlebar.main.margin.spacing.minimizebutton, color.color["Green200"])
|
||||
end
|
||||
|
||||
local create_titlebar_dialog = function(c, bg, size)
|
||||
local titlebar = awful.titlebar(c, {
|
||||
local titlebar = awful.titlebar(c, {
|
||||
position = "left",
|
||||
bg = bg,
|
||||
size = size
|
||||
})
|
||||
|
||||
titlebar : setup {
|
||||
titlebar:setup {
|
||||
{
|
||||
{
|
||||
{
|
||||
awful.titlebar.widget.closebutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Red200"],
|
||||
shape = function (cr, height, width)
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
id = "closebutton"
|
||||
@@ -160,22 +160,22 @@ local create_titlebar_dialog = function(c, bg, size)
|
||||
awful.titlebar.widget.minimizebutton(c),
|
||||
widget = wibox.container.background,
|
||||
bg = color.color["Green200"],
|
||||
shape = function (cr, height, width)
|
||||
shape = function(cr, height, width)
|
||||
gears.shape.rounded_rect(cr, width, height, 4)
|
||||
end,
|
||||
id = "minimizebutton"
|
||||
},
|
||||
spacing = dpi(10),
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
id = "spacing"
|
||||
layout = wibox.layout.fixed.vertical,
|
||||
id = "spacing"
|
||||
},
|
||||
margins = dpi(8),
|
||||
widget = wibox.container.margin,
|
||||
id = "margin"
|
||||
},
|
||||
{
|
||||
buttons = create_click_events(c),
|
||||
layout = wibox.layout.flex.vertical
|
||||
buttons = create_click_events(c),
|
||||
layout = wibox.layout.flex.vertical
|
||||
},
|
||||
{
|
||||
{
|
||||
@@ -187,33 +187,33 @@ local create_titlebar_dialog = function(c, bg, size)
|
||||
layout = wibox.layout.align.vertical,
|
||||
id = "main"
|
||||
}
|
||||
hover_signal(titlebar.main.margin.spacing.closebutton, color.color["Red200"])
|
||||
hover_signal(titlebar.main.margin.spacing.minimizebutton, color.color["Green200"])
|
||||
Hover_signal(titlebar.main.margin.spacing.closebutton, color.color["Red200"])
|
||||
Hover_signal(titlebar.main.margin.spacing.minimizebutton, color.color["Green200"])
|
||||
end
|
||||
|
||||
local create_titlebar_borderhack = function (c, bg, position)
|
||||
local create_titlebar_borderhack = function(c, bg, position)
|
||||
local borderhack = awful.titlebar(c, {
|
||||
position = position,
|
||||
bg = bg,
|
||||
size = "2"
|
||||
})
|
||||
borderhack : setup {
|
||||
borderhack:setup {
|
||||
{
|
||||
bg = bg,
|
||||
widget = wibox.container.background
|
||||
},
|
||||
{
|
||||
buttons = createresize_click_events(c),
|
||||
layout = wibox.layout.flex.vertical
|
||||
},
|
||||
nil,
|
||||
layout = wibox.layout.align.vertical
|
||||
}
|
||||
{
|
||||
buttons = createresize_click_events(c),
|
||||
layout = wibox.layout.flex.vertical
|
||||
},
|
||||
nil,
|
||||
layout = wibox.layout.align.vertical
|
||||
}
|
||||
|
||||
local old_wibox, old_cursor
|
||||
borderhack:connect_signal(
|
||||
"mouse::enter",
|
||||
function ()
|
||||
function()
|
||||
local w = mouse.current_client
|
||||
if w then
|
||||
old_cursor, old_wibox = w.cursor, w
|
||||
@@ -224,7 +224,7 @@ local create_titlebar_borderhack = function (c, bg, position)
|
||||
|
||||
borderhack:connect_signal(
|
||||
"mouse::leave",
|
||||
function ()
|
||||
function()
|
||||
if old_wibox then
|
||||
old_wibox.cursor = old_cursor
|
||||
old_wibox = nil
|
||||
@@ -234,8 +234,8 @@ local create_titlebar_borderhack = function (c, bg, position)
|
||||
|
||||
end
|
||||
|
||||
local draw_titlebar = function (c)
|
||||
if c.type == 'normal' and not c.requests_no_titlebar then
|
||||
local draw_titlebar = function(c)
|
||||
if c.type == 'normal' and not c.requests_no_titlebar then
|
||||
create_titlebar_borderhack(c, "#121212AA", "right")
|
||||
create_titlebar_borderhack(c, "#121212AA", "top")
|
||||
create_titlebar_borderhack(c, "#121212AA", "bottom")
|
||||
@@ -267,7 +267,7 @@ end
|
||||
|
||||
client.connect_signal(
|
||||
"property::maximized",
|
||||
function (c)
|
||||
function(c)
|
||||
if c.maximized then
|
||||
Theme.titlebar_maximized_button_normal = icondir .. "unmaximize.svg"
|
||||
Theme.titlebar_maximized_button_active = icondir .. "unmaximize.svg"
|
||||
@@ -282,7 +282,7 @@ client.connect_signal(
|
||||
|
||||
client.connect_signal(
|
||||
"request::titlebars",
|
||||
function (c)
|
||||
function(c)
|
||||
if c.maximized then
|
||||
Theme.titlebar_maximized_button_normal = icondir .. "unmaximize.svg"
|
||||
Theme.titlebar_maximized_button_active = icondir .. "unmaximize.svg"
|
||||
@@ -304,7 +304,7 @@ client.connect_signal(
|
||||
|
||||
client.connect_signal(
|
||||
'property::floating',
|
||||
function (c)
|
||||
function(c)
|
||||
if c.floating and not c.maximized then
|
||||
if c.class == "Steam" then
|
||||
awful.titlebar.hide(c, 'left')
|
||||
|
||||
Reference in New Issue
Block a user