add new calendar widget with ics file support, fix some bugs and added some game rules so steam games fullscreen isn't as annoying

This commit is contained in:
Rene
2022-08-29 11:06:38 +02:00
parent f2e6709f6b
commit e5cdb33eec
27 changed files with 1804 additions and 121 deletions

View File

@@ -18,6 +18,8 @@ local gshape = require('gears.shape')
local gobject = require('gears.object')
local mousegrabber = mousegrabber
local rubato = require("src.lib.rubato")
local overflow = { mt = {} }
-- Determine the required space to draw the layout's children and, if necessary,
@@ -305,6 +307,9 @@ end
-- @tparam number scroll_factor The scroll factor.
-- @propemits true false
overflow.rubato_timed = rubato.timed { duration = 0.2 }
local first_call = true
function overflow:set_scroll_factor(factor)
local current = self._private.scroll_factor
local interval = self._private.used_in_dir - self._private.avail_in_dir
@@ -318,10 +323,22 @@ function overflow:set_scroll_factor(factor)
return
end
self._private.scroll_factor = math.min(1, math.max(factor, 0))
self:emit_signal("widget::layout_changed")
self:emit_signal("property::scroll_factor", factor)
local function update_scroll()
self._private.scroll_factor = overflow.rubato_timed.pos
self:emit_signal("widget::layout_changed")
self:emit_signal("property::scroll_factor", factor)
end
-- Make sure it only subscribes once
if first_call then
overflow.rubato_timed:subscribe(update_scroll)
--first_call = false
end
-- Set the target to the new target + remaining target from last scroll. This makes it scroll faster and correctly.
overflow.rubato_timed.target = math.min(1,
math.max(factor + (overflow.rubato_timed.target - overflow.rubato_timed.pos), 0))
end
function overflow:get_scroll_factor()