You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add custom icons in folder tree in Thunderbird 115 #399
The current version (6.2) for Thunderbird 115 doesn't currently support the custom icons in the tree; I want to add this feature back, but the tree is completely different, so also the storage of the previous customization is likely lost, as I was using folder properties to make Thunderbird itself take care of storing this information.
However the good news is that in the previous version (5.17.1) I added a hidden backup routine [for Thunderbird 102 and older only] that converts this information to be recovered later. I will be able to read in the file to restore this information oncv I have implemented custom icons again - see the notes from the version log:
Automatically back up the custom folder icons for future restoration in Thunderbird 115. On startup, QuickFolders will automatically backup custom icons on the folder tree (all folder URLs and the locations of their icons) in the file quickFolders-FolderTree.json which will be stored in the profile/extensions folder. This will be only done once automatically.
The backup function can be also invoked manually via the QuickFolders debug menu - to access, click on QuickFolders tools button while holding down SHIFT, and then select Debug / Backup folder tree icons.
note that the automatic backup only happens once, straight after QuickFolders 5.17.1 is installed.
Here is a first test version - it should at least be able to read and display the icons that were defined in QuickFolders 4.17.1 or 4.18 (previous version did not store the icon information in a separate file).
To do next:
add context menu item to folder tree for adding / removing icons.
To test the version above, download the zip file, drag the file into Thunderbird Add-ons Manager, do not extract contents or if won't install. Please do not try adding / removing icons via the UI, it is not yet supported. Need to work out how to do this exactly using the API. If you want to add icons, have a look at the file: your_profile/extensions/quickFolders-FolderTree.json .
I STRONGLY recommendbacking up this file before experimenting, especially if you already have a lot of custom icons defined. I take no responsibilty for breaking your icon setup until this feature is fully released, but the format of this file should not change, so you can always get back to what you had if you back up the file.
Added storage feature. You can now use the QuickFolders Commands > Customize Icon command and it will update the folder tree icon (only on the current tab, note that folder trees are multiple instances across multiple Thunderbird folder tabs, which is something I need to deal with later in detail) - and then store the changed icon in the quickFolders-FolderTree.json file. This means the change will be persisted and loaded when Thunderbird is restarted.
Still to do next:
context menu item in folder tree for adding / removing icons.
To test the version above, download the zip file, drag the file into Thunderbird Add-ons Manager, do not extract contents or if won't install. Once you added icons, check the contents of your_profile/extensions/quickFolders-FolderTree.json .
I added the context menu item for adding an icon to the folder tree. I still need to make this "intelligent" and allow deleting an icon as well. Since we are only allowed a single menu item in any context menu this needs to be either "toggled" to show remove icon if there is an icon configured for the folder, or a popup menu with 2 choices: remove icon and modify icon.
For the moment, we only have an option to add (or change) the icon in this test version, no removal. Will have to think about how best to implement this.
To test the version above, download the zip file, drag the file into Thunderbird Add-ons Manager, do not extract contents or if won't install. Once you added icons, check the contents of your_profile/extensions/quickFolders-FolderTree.json .
It appears with prerelease version 111 the tree doesn't update after adding an icon, (we have to invoke a Repair tree icons from the tools menu) so I need to post another fix here ASAP. Investigating this now. @MarcoAtRome was interested in this feature specifically and reported it not fully working with pre65
I added a context menu item for removing the icon. Also changed the selector to use double-quotes instead of single quotes to find the correct row in the folder tree.
I also added code that could selectively hide / show the "remove icon" item, but as it runs in the background page it cannot currently know / find out whether the folder has the icon set or not (API doesn't give us direct access to the object). So I will have to write an experimental API function that asks the experimental code whether the folder has the icon before it updates the menu (and shows / hides the menu item).
This is the code that toggles while the menu is shown:
messenger.menus.onShown.addListener(async(info,tab)=>{letselectedFolder=info?.selectedFolder||null;letselectedAccount=info?.selectedAccount||null;if(isDebug){debugger;console.log("QuickFolders [debug.tbmenu]\n menus.onShown() - folderpane context menu:",selectedFolder,info);}constisServer=selectedAccount ? true : false;// we need to check whether an icon is configured already:lethasIcon=true;// query the icon somehow.if(hasIcon){awaitmessenger.menus.update(idRemove,{visible: true});}else{awaitmessenger.menus.update(idRemove,{visible: false});}if(!isServer&&!selectedFolder){awaitmessenger.menus.update(idToggle,{visible: false});awaitmessenger.menus.update(idRemove,{visible: false});}messenger.menus.refresh();});
To test the version above, download the zip file, drag the file into Thunderbird Add-ons Manager, do not extract contents or if won't install. Since I changed the format of the selector, removing old icons may only work if you restart Thunderbird after first installation.
After another full day work, I managed to add the remove icon command and also improve the interface. Previously setting icon would change the icon on the selected folder (the one with blue background), this means if somebody right-clicked on a different folder, that folder would not be affected by the new icon / change. I fixed this by determining the real folder URI through an experimental API and passing that URI back to the legacy code - thus translating from the API folder to the legacy folder that is needed on the back-end. I also made setting the icon work on the accounts in the tree.
The command now applies to the folder that was clicked, as expected by the user.
I also added code that checks whether there was already a custom icon declare on the clicked folder, and only then shows the "remove icon" command. In that case a single command is shown in the menu; otherwise there will be 2 commands, Customize icon and remove icon underneath a popup node "QuickFolders". This is done automatically by the API (Add-ons are not allowed adding 2 separate items to the context menu):
Ok biggest Problem here: the icon changes of the style sheet only work on one folder tab - and I think it is the last one. every folder tab has its own stylesheet so I wasted a couple of hour scratching my head not seeing the folder tree updating while another (3rd Thunderbird tab) took all the changes. This is one of the complexities of the new architecture in Tb115, so I still need to add code that propagates the changes through all tabs that have folder trees...
The feature now supports updating the folder tree icons in all tabs (when multiple folders are open in other tabs) when a new icon is added / modified or removed.
Activity
RealRaven2000 commentedon Oct 4, 2023
Working on this, a tryout version is going to come very soon. Here is a screenshot of 6.3pre48:
RealRaven2000 commentedon Oct 5, 2023
Here is a first test version - it should at least be able to read and display the icons that were defined in QuickFolders 4.17.1 or 4.18 (previous version did not store the icon information in a separate file).
To do next:
QuickFolders-mx-6.3pre57.zip
To test the version above, download the zip file, drag the file into Thunderbird Add-ons Manager, do not extract contents or if won't install. Please do not try adding / removing icons via the UI, it is not yet supported. Need to work out how to do this exactly using the API. If you want to add icons, have a look at the file:
your_profile/extensions/quickFolders-FolderTree.json .
I STRONGLY recommend backing up this file before experimenting, especially if you already have a lot of custom icons defined. I take no responsibilty for breaking your icon setup until this feature is fully released, but the format of this file should not change, so you can always get back to what you had if you back up the file.
RealRaven2000 commentedon Oct 5, 2023
PS: I initially forgot to add the file (prerelase 57) in the comment above, so if you want to test it, please visit the Github to install it.
RealRaven2000 commentedon Oct 5, 2023
Added storage feature. You can now use the QuickFolders Commands > Customize Icon command and it will update the folder tree icon (only on the current tab, note that folder trees are multiple instances across multiple Thunderbird folder tabs, which is something I need to deal with later in detail) - and then store the changed icon in the quickFolders-FolderTree.json file. This means the change will be persisted and loaded when Thunderbird is restarted.
Still to do next:
QuickFolders-mx-6.3pre63.zip
To test the version above, download the zip file, drag the file into Thunderbird Add-ons Manager, do not extract contents or if won't install. Once you added icons, check the contents of your_profile/extensions/quickFolders-FolderTree.json .
RealRaven2000 commentedon Oct 5, 2023
I added the context menu item for adding an icon to the folder tree. I still need to make this "intelligent" and allow deleting an icon as well. Since we are only allowed a single menu item in any context menu this needs to be either "toggled" to show remove icon if there is an icon configured for the folder, or a popup menu with 2 choices: remove icon and modify icon.
For the moment, we only have an option to add (or change) the icon in this test version, no removal. Will have to think about how best to implement this.
QuickFolders-mx-6.3pre65.zip
To test the version above, download the zip file, drag the file into Thunderbird Add-ons Manager, do not extract contents or if won't install. Once you added icons, check the contents of your_profile/extensions/quickFolders-FolderTree.json .
issue #399 - folder tree icons, #407 customizable icon size
issue #399 - icons in folder tree
issue #399 - icons in folder tree, #412 Dragging to Current Folder po…
RealRaven2000 commentedon Oct 23, 2023
It appears with prerelease version 111 the tree doesn't update after adding an icon, (we have to invoke a Repair tree icons from the tools menu) so I need to post another fix here ASAP. Investigating this now. @MarcoAtRome was interested in this feature specifically and reported it not fully working with pre65
RealRaven2000 commentedon Oct 23, 2023
I added a context menu item for removing the icon. Also changed the selector to use double-quotes instead of single quotes to find the correct row in the folder tree.
QuickFolders-mx-6.3pre116.zip
I also added code that could selectively hide / show the "remove icon" item, but as it runs in the background page it cannot currently know / find out whether the folder has the icon set or not (API doesn't give us direct access to the object). So I will have to write an experimental API function that asks the experimental code whether the folder has the icon before it updates the menu (and shows / hides the menu item).
This is the code that toggles while the menu is shown:
To test the version above, download the zip file, drag the file into Thunderbird Add-ons Manager, do not extract contents or if won't install. Since I changed the format of the selector, removing old icons may only work if you restart Thunderbird after first installation.
RealRaven2000 commentedon Oct 24, 2023
After another full day work, I managed to add the remove icon command and also improve the interface. Previously setting icon would change the icon on the selected folder (the one with blue background), this means if somebody right-clicked on a different folder, that folder would not be affected by the new icon / change. I fixed this by determining the real folder URI through an experimental API and passing that URI back to the legacy code - thus translating from the API folder to the legacy folder that is needed on the back-end. I also made setting the icon work on the accounts in the tree.
The command now applies to the folder that was clicked, as expected by the user.
I also added code that checks whether there was already a custom icon declare on the clicked folder, and only then shows the "remove icon" command. In that case a single command is shown in the menu; otherwise there will be 2 commands, Customize icon and remove icon underneath a popup node "QuickFolders". This is done automatically by the API (Add-ons are not allowed adding 2 separate items to the context menu):
QuickFolders-mx-6.3pre127.zip
To test the version above, download the zip file, drag the file into Thunderbird Add-ons Manager, do not extract contents or if won't install.
RealRaven2000 commentedon Oct 24, 2023
@MarcoAtRome see previous comment for next version.
issue #399 - folder tree icons
issue #399 - dark theme support
RealRaven2000 commentedon Oct 24, 2023
Ok biggest Problem here: the icon changes of the style sheet only work on one folder tab - and I think it is the last one. every folder tab has its own stylesheet so I wasted a couple of hour scratching my head not seeing the folder tree updating while another (3rd Thunderbird tab) took all the changes. This is one of the complexities of the new architecture in Tb115, so I still need to add code that propagates the changes through all tabs that have folder trees...
RealRaven2000 commentedon Oct 26, 2023
The feature now supports updating the folder tree icons in all tabs (when multiple folders are open in other tabs) when a new icon is added / modified or removed.
QuickFolders-mx-6.3pre144.zip
To test the version above, download the zip file, drag the file into Thunderbird Add-ons Manager, do not extract contents or if won't install.
issue #399 - folder tree icons
issue #399 - folder tree icons, issue #420
added screenshots to issue #399
RealRaven2000 commentedon Oct 30, 2023
Implemented in 6.3 - Published 30/10/2023