Conversation
|
What exactly is your use for this? As you notice, the textbox causes some "weird things" when it tries to "make things look nice". Should we work around that for scrolling? |
|
That looks better than the other gif 👍 |
|
Well, this still has comments in French etc. Do you plan to do anything about that? |
|
I'm trying to change my awesompd as salorium has (when mixing kanji and romaji characters, nothing looks right). However, I cannot seem to figure out how to write it. Also, having the timer modifiable sounds like a convenient idea to me, though the scroll() function can probably be used instead. Height scrolling seems directly related, probably just duplicating code and changing x to y unless somehow text specific (though word/char wrap make it essential). I am hopping there is nothing overly text specific to this layout, (basically moving unconstrained widgets inside of a clipping container). I would like to know how the beginning-->end-->beginning is working(something like tiled). Can we turn that feature off and have blank space on over-scroll? If text specific, what happens with set_ellipsize("none")? I am interested in this, but cannot seem to figure out how to call it. |
|
Exemple : local wtitre= wibox.widget.textbox()
local ctitre = wibox.widget.background()
ctitre:set_widget(wtitre)
ctitre:set_fg ("#87d7d7")
ctitre:set_bg ("#34495e")
local titrefix = wibox.layout.scroll(ctitre,10,50)
layout:add(wibox.layout.constraint(titrefix,"max",300,nil))
wtitre:set_text("Mike Molossa via DJ Chris D - To The Top (Michael Melody Hardstyle Club Mix)")titrefix:expand(true)titrefix:expand(false)titrefix:spaceWidth(70) |
Scroll layout found awesomeWM/awesome#268 github repository awsomeWM/awesome pull request #268 written by salorium This commit is just a backup in case of error before I refine the entire awesompd. After fixing up the layout, I plan to add a Scroll_box function which creates the textbox and scrollbox, and returns an object with bindings for both of them(:set_text,:set_markup,:auto,:scroll,:etc) TODO - [x] find a way to resize text based on pixle length, not chacter count - [x] find a way to smoothly scroll text - [ ] title and album should be seperate scroll_boxes - [ ] title and album scoll_boxes should be in sync (percentage scrolled wise) - [ ] scroll_boxes should be capable of slowing/pausing on beginning/end - [ ] scroll_boxes should be capable of slowing/pausing incrementilly - [ ] scroll_boxes should be capable of "bouncing" left and right. - [ ] Find a way to shorten text the same way pango does with ellipsize to fit the widgit, without having an ellips.
|
Hmm "This branch has conflicts that must be resolved", where ? |
|
@salorium |
9ae258f to
d1bb43e
Compare
|
@blueyed Thank you 👍 |
|
@salorium |
|
Previously children were clipped to the size of their parent. Elv13 wants widgets to be able to draw outside of that, so they now can do that. Add a new function: Note that this only clips the drawing. For input (mouse clicks), the widget will still be considered to have the larger size. |
|
@psychon : Thank you, it work |
d1bb43e to
9ee45e8
Compare
|
Would it be ok to you if I were to rewrite this and do it slightly differently? (Instead of using For this, I'd like to hear your input about what exactly this thing should do. First, am I right in that Does this describe your scroll layout? |
|
@psychon :
Yes, you can
Yes
Yes
Yes
Yes
Yes If the if self._wg ~= wg then
self._x = 0
if self._scrolltimer.started then
self._scrolltimer:stop()
end
endHere I disable autoscroll (widget update exemple :set_text() for textbox) if self._wg > width then
if self._scrolled and not self._scrolltimer.started then
self._scrolltimer:start()
end
endI enable autoscroll, if the width of widget |
|
Ok, here is a first version: https://gist.github.com/psychon/2ff6cebbdf05c012351c Another difference is that this gets a frames-per-second argument instead of the timeout directly. "20 fps" just looks better to my eyes than "redraw every 0.05 seconds". I was lazy and didn't write any setters yet. The local scroll = require("wibox.layout.scroll").horizontal(widget, 20, 30, 10, true, 50, function(elapsed, size, visible_size, speed, extra_space)
size = size + extra_space
local state = ((elapsed * speed) % (2 * size)) / size
local negate = false
if state > 1 then
negate = true
state = state - 1
end
if state < 1/5 or state > 4/5 then
state = state < 1/5 and 0 or 1
else
state = (state - 1/5) * 5/3
if state < 1/3 then
state = 2 * state * state
elseif state < 2/3 then
-- state = 1/3, result = 2/9
-- state = 2/3, result = 7/9
state = 5/3*state - 3/9
else
state = 1 - 2 * (1 - state) * (1 - state)
end
end
if negate then
state = 1 - state
end
return (size - visible_size) * state
end)All arguments are optional and CPU usage seems to be insignificant. Comments on this? Is this ok for you and can this to about everything your version does? |
|
Ok i am tested => https://gist.github.com/psychon/2ff6cebbdf05c012351c#gistcomment-1575916 |
|
Sorry for the broken first version, should be fixed. |
|
Here is a new version of my scroll layout: https://gist.github.com/psychon/2089ff521a51d9f2c77f |
|
My newest version is available in #571. It should be a little slower than what I posted in my last comment, but its memory usage should be better (since it doesn't cache an image of what is drawn). I hope everyone is ok with my version. |
|
Merged now through #571. |







I had a scroll layout :
Please look at this gif for 1 minute