MozillaZine

[Ext] Classic Theme Restorer

Announce and Discuss the Latest Theme and Extension Releases.
Aris

User avatar
 
Posts: 3203
Joined: February 27th, 2011, 10:14 am

Post Posted September 25th, 2018, 12:41 am

About the appmenu:
Currently I can not test Waterfox in my Windows 7 VM, but Firefox 56 developer edition shows different results for pane width in 100dpi/125dpi modes.

100dpi
Image

125dpi
Image


EDIT
The hint with CTR 1.7.5 -> 1.7.6 did the trick. The HiDPI icon changes caused the glitch. Next update will fix appmenu width issues.

Oomingmak
 
Posts: 176
Joined: July 10th, 2004, 7:46 pm
Location: UK

Post Posted September 27th, 2018, 12:00 am

Aris wrote:Next update will fix appmenu width issues.

I can confirm that the appmenu width issues are now fully resolved in v1.7.7.7. Many thanks for that.

I have had to re-do my appmenu icon replacing css as a result of this change, but using a css example that you previously gave me, I've managed to get it working (after a bit of trial and error).

There's just one issue with the appmenu Bookmarks icon. This is the css that I'm using to change the icon:

Code: Select all
@media (min-resolution: 1.1dppx) {
 menupopup #appmenu_bookmarks:not(:-moz-lwtheme) .menu-iconic-icon
 {list-style-image: url("icon-path-goes-here.png") !important; }
 }

It changes the icon fine, but unfortunately it has all sorts of unwanted effects on icons in its sub-menus. How can I limit the scope of the above command so that it only applies to the top-level appmenu second pane? I tried adding appmenuSecondaryPane in various different places, but couldn't get it right.

Aris

User avatar
 
Posts: 3203
Joined: February 27th, 2011, 10:14 am

Post Posted September 27th, 2018, 12:09 am

I use this code to set appmenu icons for HiDPI modes to not affect submenu icons.
Code: Select all
#appmenu-popup #appmenu_bookmarks > .menu-iconic-left > .menu-iconic-icon


">" causes the usage of the next sub-node within a node. You can easily see node structures of an ui item inside DOM Inspector, if you like.

Oomingmak
 
Posts: 176
Joined: July 10th, 2004, 7:46 pm
Location: UK

Post Posted September 27th, 2018, 12:21 am

Aris wrote:I use this code to set appmenu icons for HiDPI modes to not affect submenu icons.
Code: Select all
#appmenu-popup #appmenu_bookmarks > .menu-iconic-left > .menu-iconic-icon


">" causes the usage of the next sub-node within a node. You can easily see node structures of an ui item inside DOM Inspector, if you like.

Wow, you reply so quickly! Don't you ever sleep? :wink:

Thank you. It works!

I had already tried using ">" after I read about children vs descendants on css-tricks. The trouble was that I was trying to work around the :not(:-moz-lwtheme) part of the command, because I foolishly thought that it was a required part of the css (along with the @media bit) in order to work with icons in for HiDPI modes. lol. ](*,)

Without the :not part, it just works the same as usual (albeit wrapped within @media (min-resolution: 1.1dppx) { ..... }.

Thanks again!

MarcosD2
 
Posts: 33
Joined: August 4th, 2016, 10:49 am

Post Posted October 26th, 2018, 6:49 am

Hello, Aris and everybody.

I've created a thread about migrating my userChrome.css from 62.0.3 to 63.0+: viewtopic.php?p=14813240#p14813240

Can you help me? Maybe it'd be useful to other folks having the same trouble.

Thanks in advance.

Aris

User avatar
 
Posts: 3203
Joined: February 27th, 2011, 10:14 am

Post Posted October 26th, 2018, 7:11 am


MarcosD2
 
Posts: 33
Joined: August 4th, 2016, 10:49 am

Post Posted October 29th, 2018, 4:41 am

Problem solved.

This is my folder structure in 63.0+ version:

Image

Thanks!!!!

kltpzyxmrm
 
Posts: 100
Joined: June 16th, 2015, 10:59 am

Post Posted November 1st, 2018, 3:00 pm

Hi Aris,

I know how you feel about custom button support, but this is not technically a custom button problem, I believe.

I am using CUSTOM CSS FOR FX MASTER v2.2.0, with some added .css provided by you. I also have a set of 16 custom buttons. Here are 2 examples to show you the structure

LaunchProfDFirefoxButton_Movable.uc.js
Code: Select all
(function () {
  if (location != "chrome://browser/content/browser.xul") return;

  /* CustomizableUI
     http://developer.mozilla.org/docs/Mozilla/JavaScript_code_modules/CustomizableUI.jsm
     http://developer.mozilla.org/docs/Mozilla/JavaScript_code_modules/CustomizableUI.jsm/API-provided_widgets
  */

  try {
    CustomizableUI.createWidget({
      id: "open_profile_folder_button",
      type: "button",
      defaultArea: CustomizableUI.AREA_MENUBAR,
   // defaultArea: CustomizableUI.AREA_NAVBAR,
      label: "Open Profile Folder",
      tooltiptext: "Open Profile Folder\n\nL: Open Profile Folder",
      onCommand: function (aEvent) {
        var file = Components.classes["@mozilla.org/file/directory_service;1"].
          getService(Components.interfaces.nsIProperties).
          get("ProfD", Components.interfaces.nsIFile);
        file.launch();
      },
    });
  } catch (e) {};

  var ios = Components.classes["@mozilla.org/network/io-service;1"].
    getService(Components.interfaces.nsIIOService);
  var sss = Components.classes["@mozilla.org/content/style-sheet-service;1"].
    getService(Components.interfaces.nsIStyleSheetService);
  var dataUrl = "data:image/png;base64," +
"iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAACXBIWXMAAAsTAAALEwEAmpwYAAAClUlEQVQ4y22TTUhUURiGn3PvmXvnJ0cjw7EpNCfQUNOQDCOyBPujXYtaRkW1klrVokW0KVdBRb+LVlFgQbQvdBOVRX9IaSk1adOomTp3ZuzOnXNaiNqYz+5w4Dnvefk+oWch/v07A4OD/Mnl+BchBKFgkEhpKdFV5RQVhQvuJYDnedzt6qInOYYoKcFTGg+N1hqlNUYuxzLPY1PZSk4cPEAkUl4o0FozkZ1hbEMDsmodeSGYmZ7GdabRCGRoGaNa8brvA+kbtzh76iTFxcULAsMwCPkkX+7dZ6a6GlpaUD3dqPdvERqMyrXI7W3ougYePn7EzpcvaW9vB8AAkFJypqODt1cuYb57Q8D24x8f5fbRI7y7fpVrrVupePEMlXJIRiL09Pbied5CAoBAIEBV1Vr8wiBkWUyZPlZFo9TW1VNRUUlvPM50PscYkJycxPM8pJSzCQpbB8OUIOXsQWsmfk+g8opSvx/DcbBNEyFEYYI5DMAfCJC3bS5c7OTOzZvkLQvRtIkZKQkkEsSam/D5fEsJBAII2jbRQ4exLR8ByyLruvSNjPDt6ROaU1Ps270bwzCWEmgU4GSzDPd/ZDj5EyOvyKdSMBwnlnY4ffwYsViscA4WS9xsBv38GQ1OihXhMCHbpmZjAzuam9ne2jr/eoEgnU6TSCSwDIOgZWEpzf4tLWxubGTNmtWUlZURDIbmy5v/tNZau67L+c5Our9+w1dbz9TWbcRf9VLU94HM+Dh7ouVcPneOcDj8X14JoJTil5tD7dpLMhjkx+fP6JLleG3tpAe/4CRHcF2XpZBzGye14s2DLtxMGu3mQIAjBGYmQ3HTRizLt6RAaK21Uor+gQE+DQ3hLVpn0zSpjlWxvrqmoLw5/gKZHgkULJzGRAAAAABJRU5ErkJggg==";
  var css = "#open_profile_folder_button {";
  css += 'list-style-image: url("' + dataUrl + '") !important;';
  css += "-moz-image-region: rect(0, 16px, 16px, 0) !important;";
  css += "}";
  var uri = ios.newURI("data:text/css," + encodeURIComponent(css), null, null);
  if (!sss.sheetRegistered(uri, sss.USER_SHEET)) {
    sss.loadAndRegisterSheet(uri, sss.USER_SHEET);
  }
})();

About.uc.js
Code: Select all
(function () {
  if (location != "chrome://browser/content/browser.xul") return;

  /* CustomizableUI
     http://developer.mozilla.org/docs/Mozilla/JavaScript_code_modules/CustomizableUI.jsm
     http://developer.mozilla.org/docs/Mozilla/JavaScript_code_modules/CustomizableUI.jsm/API-provided_widgets
  */

  try {
    CustomizableUI.createWidget({
      id: "about_about_button", // should match id below
      type: "custom",
      defaultArea: CustomizableUI.AREA_MENUBAR,
   // defaultArea: CustomizableUI.AREA_NAVBAR,
      onBuild: function (aDocument) {
        var XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
        var toolbaritem = aDocument.createElementNS(XUL_NS, "toolbarbutton");
        toolbaritem.onclick = function (aEvent) {
          if (aEvent.button == 0) {
            var url = "about:about";
            for (var i = 0; i < gBrowser.tabContainer.childNodes.length; i++) {
              if (gBrowser.tabContainer.childNodes[i].linkedBrowser.currentURI.spec == url) {
                gBrowser.selectedTab = gBrowser.tabContainer.childNodes[i];
                return;
              }
            }
            gBrowser.selectedTab = gBrowser.addTab(url, {
  triggeringPrincipal: Services.scriptSecurityManager.getSystemPrincipal(),
});
          } else if (aEvent.button == 1) {
            gCustomizeMode.enter();
          } else if (aEvent.button == 2) {
            document.getElementById("menu_preferences").click();
          }
        };
        toolbaritem.oncontextmenu = function (aEvent) {
          aEvent.preventDefault();
          aEvent.stopPropagation();
          aEvent.stopImmediatePropagation();
        };
        var dataUrl = "data:image/x-icon;base64," +
          "AAABAAEAGBgAAAEACADIBgAAFgAAACgAAAAYAAAAMAAAAAEACAAAAAAAAAAAAAAAAAAAAA" +
          "AAAAAAAAAAAACTk5MAioqKAIODgwCCgoIAgICAAHBwcABNTU0AGBgYAG2UlABeq6sAVbS0" +
          "AFO0tABUs7MAVLS0AFGysgBAlJQAIlRUAAYGBgBOTk4AQ5WVAC/NzQAi5uYAIObmACHl5Q" +
          "Ag29sAINTUACDQ0AAg0dEAIdDQACDY2AAg4uIAIebmAB/k5AAXubkACmJiAAEBAQA9PT0A" +
          "LJSUABTd3QAG//8ABP//AAT4+AAEvb0ABJWVAASEhAAEiIgABJSUAASLiwAEsbEABOnpAA" +
          "T9/QACy8sAAGpqAAAAAAA7OzsAKZKSABDc3AAC//8AAP//AADs7AAAcHAAACEhAAAKCgAA" +
          "NTUAAAICAAAMDAAAV1cAAMvLAAD9/QAAaWkAAODgAABfXwAAGRkAABcXAAB0dAAACQkAAA" +
          "cHAABHRwAAsrIAAMrKAABnZwAAxsYAADo6AAABAQAAIiIAAKamAAA7OwAALi4AAIyMAAD8" +
          "/AAAaGgAALCwAAApKQAAAwMAADIyAAC9vQAAVVUAABERAAAjIwAAdnYAAPDwAACPjwAAHR" +
          "0AAA8PAABISAAA0NAAAHV1AAAaGgAAYmIAAOPjAAAVFQAAWloAAN7eAACYmAAAHx8AAEpK" +
          "AADS0gAAQkIAAA0NAABsbAAA6uoAALa2AAAqKgAABQUAACgoAACCggAA+fkAAPj4AADc3A" +
          "AABAQAADg4AACXlwAAyckAAFBQAAAUFAAAZmYAAPLyAAC8vAAAHh4AAE1NAABvbwAAYGAA" +
          "ACcnAAAODgAA6ekAAJKSAAAtLQAAWVkAAD4+AAAcHAAABgYAAP7+AAL+/gAAnZ0AAHNzAA" +
          "ATEwAA5+cAAPr6AAL7+wAA09MAAHJyAADd3QAATEwAABYWAADExAAA8/MAAvPzAAC/vwAA" +
          "ICAAAIaGAADBwQAApaUAAO3tAALn5wAApKQAAKGhAADCwgAAUlIAAGtrAADh4QAC7+8AAM" +
          "fHAACcnAAA5eUAAHx8AACiogA5OTkAJpCQAA/Z2QAC9vYAAOjoAADPzwAA7u4AAPv7AAD0" +
          "9AAA0dEAANvbAAD19QAAyMgAKCgoABhwcAAJq6sAAcXFAADFxQAAw8MADg4OAAU2NgABU1" +
          "MAAF5eAABLSwAAJiYAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" +
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" +
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" +
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAANTU1NTU1NTU1NTU1NTU1NT" +
          "U1NTU1NTU1zc7PjUdHR0dHR0dHR0dHR0dHR0fQ0dI1x8jJysukpKTLpMukpKTLpMukpKTM" +
          "toU1uru8vb6fv7+hwMHBwcJGw7+/xMV/xoc1Njc4tLV9Skq2nzo6OrdVuEpquTtEQ0U1Nj" +
          "c4ra49NTVWrzo6OrCxPjU1srNEQ1o1Njc4pqc/NTWoqTo6qqKbNTU1q6xET1A1Njc4np9N" +
          "NTVuoHihoqOBNTU1pKVEQ0U1Njc4mEZaNTWPhZmam4E1NVOBnJ1EQ1o1Njc4OZCRNTVMkp" +
          "OUlUFdNZaKWZdEQ1o1Njc4OYiJNTVdiouMjY4+NY9oOjpEQ0U1Njc4OX+ANTWBgoM7hIWG" +
          "NYaHOjpEQ1o1Njc4OTo6SXs1fH1+UVJLU1RVOjpET1A1Njc4OTo6dXY1cnd4eXpdTF5fOj" +
          "pEQ0U1Njc4OTo6RW41SW9wcXI1YXN0OjpEQ1o1Njc4OTo6ZWY1Z2hpakk1a2xtOjpEQ1o1" +
          "Njc4OTo6W1xdTF5fYGE1YmNkOjpEQ0U1Njc4OTo6UVJLU1RVVkFTV1hZOjpEQ1o1Njc4OT" +
          "o6RkdINUlKS0BMTU46OjpET1A1Njc4OTo6Ozw9NT4/QDVBQkM6OjpEQ0U1JCUmJygoKSor" +
          "LC0uLCwvMDEoKCgyMzQ1EhMUFRYWFxgZGhobHBobHR4WHxYgISIjBQgJCgsLDA0LDQsLDA" +
          "0LDQsLDA0ODxARAAABAgMDAwMDAwMDAwMDAwMDAwMEBQYHAAAAAAAAAAAAAAAAAAAAAAAA" +
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" +
          "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
        var props = {
          id: "about_about_button",
          class: "toolbarbutton-1 chromeclass-toolbar-additional",
          label: "About",
          tooltiptext: "About\n\nL: About About\nM: Customize\nR: Options",
          style: 'list-style-image: url("' + dataUrl + '");',
        };
        for (var p in props) toolbaritem.setAttribute(p, props[p]);
        return toolbaritem;
      },
    });
  } catch (e) {};
})();

I also have userChrome.xml
Code: Select all
<?xml version="1.0"?>
<!-- Copyright (c) 2017 Haggai Nuchi
Available for use under the MIT License:
https://opensource.org/licenses/MIT
 -->

<!-- Run userChrome.js/userChrome.xul and .uc.js/.uc.xul/.css files  -->
<bindings xmlns="http://www.mozilla.org/xbl">
    <binding id="js" extends="chrome://global/content/bindings/toolbarbutton.xml#menu">
        <implementation>
            <constructor><![CDATA[
                if(window.userChromeJsMod) return;
                window.userChromeJsMod = true;
               
                var chromeFiles = FileUtils.getDir("UChrm", []).directoryEntries;
                var xulFiles = [];
                var sss = Cc['@mozilla.org/content/style-sheet-service;1'].getService(Ci.nsIStyleSheetService);
               
                while(chromeFiles.hasMoreElements()) {
                    var file = chromeFiles.getNext().QueryInterface(Ci.nsIFile);
                    var fileURI = Services.io.newFileURI(file);
                   
                    if(file.isFile()) {
                        if(/(^userChrome|\.uc)\.js$/i.test(file.leafName)) {
                            Services.scriptloader.loadSubScriptWithOptions(fileURI.spec, {target: window, ignoreCache: true});
                        }
                        else if(/(^userChrome|\.uc)\.xul$/i.test(file.leafName)) {
                            xulFiles.push(fileURI.spec);
                        }
                        else if(/\.as\.css$/i.test(file.leafName)) {
                            if(!sss.sheetRegistered(fileURI, sss.AGENT_SHEET))
                                sss.loadAndRegisterSheet(fileURI, sss.AGENT_SHEET);
                        }
                        else if(/^(?!(userChrome|userContent)\.css$).+\.css$/i.test(file.leafName)) {
                            if(!sss.sheetRegistered(fileURI, sss.USER_SHEET))
                                sss.loadAndRegisterSheet(fileURI, sss.USER_SHEET);
                        }
                    }
                }
               
                setTimeout(function loadXUL() {
                    if(xulFiles.length > 0) {
                        document.loadOverlay(xulFiles.shift(), null);
                        setTimeout(loadXUL, 5);
                    }
                }, 0);
            ]]></constructor>
        </implementation>
    </binding>
</bindings>

I have seven different profiles, among which I have no problem freely exchanging Chrome folders, with everything working in "almost" perfect harmony.

My problem is that I want to build a new profile, but when I transfer the chrome folder to the new profile, all my custom buttons are absent from the toolbar.

Morat gave me this code so I could test using a userchrome.css with nothing but the code.

Code: Select all
/* Firefox userChrome.css */

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

    toolbarbutton#alltabs-button {
      -moz-binding: url("userChrome.xml#js");
    }

In my regular profiles, the customs buttons are displayed and work normally using only that code, so it's not some kind of conflict with your set.

But if I transfer that chrome folder using that userchrome.ccs to the new profile, only the About.uc.js shown above gets displayed on the toolbar.

If I use your regular set in the new profile without the Morat code, no custom buttons appear.

One of my established profiles is a basic template: no extensions, only options and and about:config tweaks. Your .css and the custom buttons works in it fine.

So the only things I can see that are different from established profiles, and the new one, that would cause this, must have something to do with Firefox options or
some about:config tweaks that I have forgotten to include.

I would really appreciated your help.

Aris

User avatar
 
Posts: 3203
Joined: February 27th, 2011, 10:14 am

Post Posted November 1st, 2018, 3:36 pm

The issue might be the script/startup cache, try to clean it: https://github.com/Aris-t2/CustomJSforF ... ery-change

Also I can ensure, if you follow the instructions on this page, you will be able to get everything to work on any new profile: https://github.com/Aris-t2/CustomJSforFx
Use method 1, it is similar to what you are already using.

Brummelchen
 
Posts: 3893
Joined: March 19th, 2005, 10:51 am

Post Posted November 10th, 2018, 6:35 am

#TabsToolbar .titlebar-placeholder

got

#TabsToolbar .titlebar-spacer

?

for me working in nightly
Code: Select all
/*AGENT_SHEET*/

#TabsToolbar .titlebar-spacer[type="pre-tabs"]
{
    width: 0px !important;
}

#TabsToolbar .titlebar-spacer[type="post-tabs"]
{
    width: 96px !important; /* or > 96 */
}

#edit: could it be?
https://github.com/Aris-t2/CustomCSSfor ... 98818f5385


btw some of you is breaking forum layout here... correct it please!

Aris

User avatar
 
Posts: 3203
Joined: February 27th, 2011, 10:14 am

Post Posted November 12th, 2018, 12:26 am

@Brummelchen

There are multiple cases where the "pre-tabs" and "post-tabs" elements have to get removed. I have not checked all of them yet.

Prof. Martelo
 
Posts: 139
Joined: January 1st, 2010, 10:40 am

Post Posted November 29th, 2018, 8:24 am

In version version 2.2.8 with only this options selected (my default setup) the tabs in the tab toolbar are not aligned with the bottom of the tab.

@import "./config/general_variables.css"; /**/
@import "./config/color_variables_aero.css"; /**/ /* <- 'AeroBlue' colors (Win 7 Aero) */
@import "./css/tabs/tabs_below_navigation_toolbar_fx65.css"; /**/ /* <-- tabs not on top Fx65+ */
@import "./css/toolbars/general_toolbar_colors.css"; /**/

Note: with this option (@import "./css/tabs/tabs_below_navigation_toolbar_fx65_v2.css"; /**/ /* only for multi lined tabs support*/ /* <-- tabs not on top Fx65+ v2 */)
the tabs are aligned, but there is a black bar in the menu bar area that is visible when the menu bar is not selected.

Aris

User avatar
 
Posts: 3203
Joined: February 27th, 2011, 10:14 am

Post Posted November 29th, 2018, 9:44 am

@Prof.Martelo
Looks like the new tab icon is the reason for this glitch with default browser tabs. It will be fixed on next update, use this till then:

Code: Select all
.tabs-newtab-button .toolbarbutton-icon {
  padding: 0px !important;
  margin: 0px !important;
  width: 18px !important;
  height: 18px !important;
}


I know the tabs_below_navigation_toolbar_fx65_v2.css is not reliable and only exists for one very rare case: Fx 65 + tabs not on top + multilined tabs toolbar.
The menubar uses the position absolute/fixed rule there and loses its functionality moving toolbars up and down based on menubars visibily. It is like "either keep menubar" or "remove it completely" (within the css code) when using OS titlebar.

Return to Extension/Theme Releases


Who is online

Users browsing this forum: No registered users and 2 guests