Horizontal size of toolbar icon

Discuss all "Back to Top" issues or request new features.

Horizontal size of toolbar icon

Postby george38 » Sun Sep 15, 2013 2:32 pm

Is there a way I can edit the text in the toolbar icon to take up less horizontal space? Or can I remove text (without doing same to other icons on the same toolbar)? Or might you create an Option to edit the icon text in settings? I'd probably prefer 'top/bottom' instead of "Go to top/bottom" (eliminating "Go to"). I know how to use Notepad to open the XPI file; I can't figure out what to do inside there to make the edit (I was hoping LOL to just find the text & change it). I did google myself but didn't find a solution. Thank you.
george38
 
Posts: 4
Joined: Sun Sep 15, 2013 2:10 pm

Re: Horizontal size of toolbar icon

Postby cbaker_admin » Sun Sep 15, 2013 8:34 pm

Yes, it is a fairly simple matter to edit the locale file if you are comfortable doing so. The file you want to edit is named backtotop.dtd. It is contained in the BackToTop extension file located in your Fx [profile]/extensions directory. The extension file is named {3C9A65A6-9563-4485-BA4A-4BCD698BCFB4}.xpi.

The easiest way to edit the file would be to use the 7-zip utility open the .xpi. Then you can navigate to the .dtd file and open it for editing by selecting, right-clicking, and 'Edit' (the default editor is Notepad, I believe. If not, you can configure 7zip to use it.). Once you open {3C9A65A6-9563-4485-BA4A-4BCD698BCFB4}.xpi, the full path to the .dtd file is:

chrome\locale\en-US\backtotop.dtd

I believe the line you want to change is the one that reads:
Code: Select all
<!ENTITY backtotop.unicon                  "Go to top/bottom">
which is line number 46.

Once you save the changes, 7zip will ask you if you want to update the archive. Answer 'yes' and you should be good to go.
cbaker_admin
Site Admin
 
Posts: 4427
Joined: Sun Nov 27, 2005 10:51 pm
Location: Glendale, AZ USA

Re: Horizontal size of toolbar icon

Postby george38 » Mon Sep 16, 2013 12:13 am

Thank you. Everything made sense to me & went fine till the very end when the 7zip message was Access Denied.
george38
 
Posts: 4
Joined: Sun Sep 15, 2013 2:10 pm

Re: Horizontal size of toolbar icon

Postby cbaker_admin » Mon Sep 16, 2013 2:09 am

Did you attempt the edit with Fx open? The browser must be closed to release any locks on the extension files.
cbaker_admin
Site Admin
 
Posts: 4427
Joined: Sun Nov 27, 2005 10:51 pm
Location: Glendale, AZ USA

Re: Horizontal size of toolbar icon

Postby george38 » Mon Sep 16, 2013 3:45 am

LOL I just returned to let you know I just thought of that & accomplished the task (earlier I was following your directions too robotically).

Will this change 'stick' if/when the extension is updated? If not, do you know of a way to accomplish this in userChrome.css ?
george38
 
Posts: 4
Joined: Sun Sep 15, 2013 2:10 pm

Re: Horizontal size of toolbar icon

Postby cbaker_admin » Mon Sep 16, 2013 5:18 pm

Will this change 'stick' if/when the extension is updated?

No. You would have to manually change it. But at least you now know how :wink:

If not, do you know of a way to accomplish this in userChrome.css ?

Again, no. If anything it would be modifying userChrome.js (userChrome.css is for styling the UI, i.e., color, size, positioning, etc.). I'm not even sure if userChrome.js is still supported. Even it it is, I wouldn't know what to put in there to accomplish what you want. I would imagine you would have to write a JavaScript function that would require more than just a few lines of code.
cbaker_admin
Site Admin
 
Posts: 4427
Joined: Sun Nov 27, 2005 10:51 pm
Location: Glendale, AZ USA

Re: Horizontal size of toolbar icon

Postby george38 » Mon Sep 16, 2013 6:59 pm

Thank you for your replies. My primary goal was to edit the text. IF that wasn't possible, then I would have preferred no label vs the default label in the extension (& other extensions). Before you provided your solution, the Mozilla forum provided a solution that removed an individual label without removing all toolbar labels as can be done in Tools/Customize (universal change). So your solution is preferable (except for their solution wouldn't be changed by updates). Their solution was done in userChrome.css; also a contributor in Stylish forum thought people had edited (vs removed) extension labels in the past using userChrome.css & he/she wrote & tested 2 solutions but was surprised they didn't work.

FYI here is the userChrome.css method provided in Mozilla forum (that removes, not edits, a label):
You should still see that icon as only the label text would be hidden.

@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"); /* only needed once */

toolbar[mode="full"] #b2tTBUnicon { min-width:0px !important; }
toolbar[mode="full"] #b2tTBUnicon .toolbarbutton-icon { margin-top:-20px !important; }
toolbar[mode="full"] #b2tTBUnicon .toolbarbutton-text { display:none !important; }
george38
 
Posts: 4
Joined: Sun Sep 15, 2013 2:10 pm


Return to Back to Top

Who is online

Users browsing this forum: No registered users and 3 guests

cron