bookmarks side bar - 2 things i cannot solve
-
@adacom So you already have
jdhooks.js
called frombrowser.html
just beforebundle.js
, right? Then you can install the code I gave you like any other JS mod—it uses the jdhooks API but it is still a regular mod you have to enable/disable frombrowser.html
. -
@potmeklecbohdan
things are very simple when you know the answer but can be extremely complicated when the solution is a mystery
so let me be clear - i am totally lost
i have jdhooks.js in the dir with browser.html - it is called by a line in that file placed before bundle.js
that bit i have worked out - i have a line of code you posted - i can save that as anything - lets call it spacing.js - do i save that in the same dir as jdhooks.js - if so then i have tried that and nothing changes
so humour me or educate me what am i doing wrong
-
@adacom I personally would put it in the same dir as other mods, but that doesn’t matter at all. You just need to call it from
browser.html
(this is what I think you forgot). -
@potmeklecbohdan
i did indeed forget that or if i understand you i did but still nothing
some screenshots
part of browser.html
par of the resources dir
spacing.js
assuming i have the correct code for jdhooks.js - think i have followed but it still does not work
what am i missing
-
@adacom Two possibilities come to my mind
- I use the
onUIReady
event so maybe (I don’t know when exactly it fires) you need to close and reopen the bookmarks panel (it may have loaded before the spacing changes) - using the event may cause that the code is never executed so this would need more experimenting
So just try re-opening the panel (I want to know the result) and (if it worked or not) try only this code
vivaldi.jdhooks.require('common_VivaldiTreeList').defaultProps.rowHeight = 16;
The last (if I were doing this on my computer, the first) option is checking the console for errors.
- I use the
-
@potmeklecbohdan
some strange results
the posative news - closing and opening the bookmarks panel reduces the line spacing as you suggest - not 100% sure if all is good after that - need to look at some things - see next note
i then ran your new code and things are not correct - the bookmarks spacing is correct at boot however the vivaldi window has moved about 20px to the right and i cannot pick it up and move it - i dont run if full screen mode so i should be able to
also it does not seem to close down correctly - after close down - the next time i open it i get a message its still running but asks if i want to force it to open - thats both lines of code - i also got the the same window when i posted the picture below - i had t click it away to continue
so in summary - the 1st code works after closing and opening the bookmarks pane
the 2nd code is perfect for the bookmarks panel but creates other problems
both sets of code prompt the message in the picture above
-
@adacom OK, first success. Use the first version then.
Does the message still appear if you kill Vivaldi from task manager (then start it, reopen the bookmarks panel, close V and start it once again)?
-
@potmeklecbohdan
Does the message still appear if you kill Vivaldi from task manager (then start it, reopen the bookmarks panel, close V and start it once again)?
yes that works - i am not seeing the message now - i have to say i may have reported it wrong - am going to run each script on separate laptops so i dont get confused
i was seeing other problems with the second script - or think i was - pinned bookmarks disappeared and side scroll bar did not work - but all that may have been me trying too many things
at the moment the 1st script seems the best - closing and opening the bookmarks is easy enough if thats how it has to be
you said something about timing - could a delay be added in the js for the spacing
-
@adacom said:
you said something about timing - could a delay be added in the js for the spacing
That wouldn’t help in any way—the spacing is reduced when the UI is completely loaded, so you can delay it however you want and you’ll always come late (you need to catch the moment when V has already all its internal classes but the tree is not loaded yet).
-
@potmeklecbohdan - ahhh ok - maybe theres a way forward with your second thoughts/code - if not then the solution you have is way ahead of anything done before
i guess it depends how driven you are to make things work perfectly
that said the solution you have is not far off perfect
-
@adacom I’ve just tried the second version again—it works and I don’t see any V processes after closing it (though I only opened a new window, w/o restarting V). Maybe you could try it once more (if you want). I think that
- it could be an error that appears sometimes (so you maybe won’t get it again)
- maybe the stupid thing at
chrome://settings/system
(“continue running…”) has to be turned off, it always causes only problems
-
@potmeklecbohdan said in bookmarks side bar - 2 things i cannot solve:
@adacom I’ve just tried the second version again—it works and I don’t see any V processes after closing it (though I only opened a new window, w/o restarting V). Maybe you could try it once more (if you want). I think that
- it could be an error that appears sometimes (so you maybe won’t get it again)
- maybe the stupid thing at
chrome://settings/system
(“continue running…”) has to be turned off, it always causes only problems
how odd - just changed to the second version and it seems fine - way beyond my understanding - but will run with the 2nd version and post back either way
have to add thanks - i just have the width of the bookmarks panel to solve - i can reduce it but it reverts back to its natural width from time to time - its a js mod so i am lost
that said i can do it with css and the same thing happens
if you fancy another challenge i will post more details
-
@adacom Sorry, I didn’t find a way to reduce the minimum width. I may try it later—when I get bored—but not now.
-
@adacom OK, I found it now, but it’s playing with the minified file:
- backup
bundle.js
- open
bundle.js
, search for||260
- (you found the default value (I think), you’re not interested in this one)
- a few characters before that is another
260
, change it to something that even you find small - save
bundle.js
- launch Vivaldi
I hope I’ll find a better way to get this, but for now this works (and I got a little impatient with Vivaldi
).
- backup
-
See https://forum.vivaldi.net/post/368697. Many thanks @den_po.
-
So I finally got to rewriting the spacing mod to a regular hook. Here’s the code:
// Change spacing of tree views (needs CSS to make it look nice) vivaldi.jdhooks.hookClass('common_VivaldiTreeList', cls => { cls.defaultProps.rowHeight = 16; return cls; });
-
@potmeklecbohdan 9 May 2020, 14:32
Excellent, that did it for me - much appreciated. For anyone having several windows open at the same time and having a bookmark panel open in (at least) one, it may be essential to reduce the panel width to also be able to valuate actual tab content.
I take the opportunity to rant a little to developers....
In earlier versions of V the minimum width was smaller and I wonder what reasoning was behind the change?
In ancy case, it really should be user defined - a principle I thought was a key priority for the developers of Vivaldi...
With this feature re-established, a user who finds the panel too narrow for (and that's important) whatever window/tab configuration in relation to screen real-estate and chosen font/icon size, it can be adjusted according to user priorities.
Another guiding principle for the browser development ought to be the realisation that user priorities probably extend way beyond what programmers might encounter or have fantasy to explore of situations (hence the need for the realisation).
However, for me the bottom-line remains: many thanks to developers - and the important tinker contributions - for coming up with Vivaldi.
Cheers!
-
CSS hack stopped working in vivaldi 4.0. now it's just reduces webpage space without shrinking the bookmarks bar.
is there a possible solution?/* moves main window left to fill gap left by reducing left toolbar */ #webview-container { margin-left: -33px !important; }