Skip to content

Commit

Permalink
issue #329 - fixed inconsistent menu font size
Browse files Browse the repository at this point in the history
  • Loading branch information
RealRaven2000 committed Dec 21, 2022
1 parent 407b19a commit f24975e
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 35 deletions.
38 changes: 18 additions & 20 deletions chrome/content/quickfolders-interface.js
Expand Up @@ -1987,11 +1987,12 @@ QuickFolders.Interface = {
QI.addPopupSet( {popupId:popupId, folder:folder, entry:entry, offset:offset, button:button, noCommands:noCommands, event:evt} );
}
}
else
else {
util.logDebugOptional("interface,popupmenus", "showPopup(" + button.id + ", " + popupId + ", NO EVENT)");
}

let p = button.ownerDocument.getElementById(popupId);
if(!p) p=button.firstChild;
if (!p) p=button.firstChild;

if (p) {
document.popupNode = button;
Expand Down Expand Up @@ -2069,18 +2070,12 @@ QuickFolders.Interface = {
}
}


util.logDebugOptional("popupmenus", "Open popup menu: " + p.tagName + "\nid: " + p.id);
// make it easy to find calling button / label / target element
p.targetNode = button;

let verticalOffset = QI.verticalMenuOffset; // was -1, Tb60 now -2
// if (prefs.isDebugOption("popupmenus")) debugger;
var isContextMenu = true; // was true; test for [Bug 26575]
if (p.openPopup)
p.openPopup(button, "after_start", 0, verticalOffset, isContextMenu, false, evt);
else
p.showPopup(button, 0, verticalOffset, "context", "bottomleft", "topleft"); // deprecated method
let verticalOffset = QI.verticalMenuOffset;
p.openPopup(button, "after_start", 0, verticalOffset, true, false, evt);
}

// Alt+Down highlight the first folder
Expand Down Expand Up @@ -3984,7 +3979,7 @@ QuickFolders.Interface = {
}

// else { ...see below... }
let menupopup = document.createXULElement ? document.createXULElement("menupopup") : document.createElement("menupopup"),
let menupopup = document.createXULElement("menupopup"),
menuitem;

menupopup.setAttribute("id", popupId);
Expand Down Expand Up @@ -4233,7 +4228,7 @@ QuickFolders.Interface = {
// create menu items / elements anbd force inject XUL to deal with menu problems.
// @cl: [class] use wildcard * for omitting classname (the exception)
createIconicElement: function createIconicElement(tagName, cl) {
let el = document.createXULElement ? document.createXULElement(tagName) : document.createElement(tagName);
let el = document.createXULElement(tagName);
el.setAttribute("xmlns", "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
if (cl != "*") {
if (!cl)
Expand Down Expand Up @@ -4748,10 +4743,8 @@ QuickFolders.Interface = {
// remove and add the popup to register ignorekeys removal
menupopup = palette.appendChild(palette.removeChild(menupopup));
let searchBox = QI.FindFolderBox;
if (typeof menupopup.openPopup == "undefined")
menupopup.showPopup(searchBox, 0, -1,"context","bottomleft","topleft");
else
menupopup.openPopup(searchBox,"after_start", 0, -1, true, false);
menupopup.openPopup(searchBox,"after_start", 0, -1, true, false);
// menupopup.showPopup(searchBox, 0, -1,"context","bottomleft","topleft");

if (event.preventDefault) event.preventDefault();
if (event.stopPropagation) event.stopPropagation();
Expand Down Expand Up @@ -5305,10 +5298,8 @@ QuickFolders.Interface = {
}

if (!forceSingleURI) {
if (typeof menupopup.openPopup == "undefined")
menupopup.showPopup(searchBox, 0, -1,"context","bottomleft","topleft");
else
menupopup.openPopup(searchBox,"after_start", 0, -1,true,false); // ,evt
// menupopup.showPopup(searchBox, 0, -1,"context","bottomleft","topleft");
menupopup.openPopup(searchBox,"after_start", 0, -1,true,false); // ,evt
}
// v-- [Bug 26665] support VK_ENTER even with multiple matches
if (matches.length == 1 || (matches.length>0 && forceFind) ) {
Expand Down Expand Up @@ -6325,6 +6316,13 @@ QuickFolders.Interface = {
styleEngine.setElementStyle(ss, btnSelector
+ "[background-image].selected-folder","border-bottom-color", colActiveBG, true);
}

// =============
// MENU FONT SIZE
// [issue 329] inconsistent menu font size
styleEngine.setElementStyle(ss, "#QuickFolders-FoldersBox .QuickFolders-folder-popup * > label", "font-size", prefs.ButtonFontSize + "px");
styleEngine.setElementStyle(ss, "#QuickFolders-Category-Box popupset * > label", "font-size", prefs.ButtonFontSize + "px");


// =================
// CUSTOM RADIUS
Expand Down
9 changes: 9 additions & 0 deletions chrome/content/quickfolders-layout.css
Expand Up @@ -57,6 +57,15 @@ toolbar .folderBarContainer toolbarbutton[disabled="true"] > label {
-moz-context-properties: fill;
}

#QuickFolders-FoldersBox .QuickFolders-folder-popup * > label {
font-size: 12px;
}

#QuickFolders-Category-Box popupset * > label {
font-size: 12px;
}



#QuickFolders-ToolbarPopup menuitem image {
fill: var(--toolbarbutton-icon-fill, currentColor);
Expand Down
32 changes: 17 additions & 15 deletions chrome/content/scripts/qf-messenger.js
Expand Up @@ -86,21 +86,7 @@ async function onLoad(activatedWhileWindowOpen) {
</vbox>
</hbox>
<popupset id="QuickFolders-Palette" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<menupopup id="QuickFolders-PalettePopup"
class="QuickFolders-folder-popup"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onclick="QuickFolders.Interface.clickHandler(event,this);">
</menupopup>
<menupopup id="QuickFolders-FindPopup"
class="menu-iconic widerMenu"
position="after_start"
oncommand="QuickFolders.Interface.selectFound(this, event);"
onkeypress="QuickFolders.Interface.foundInput(this, event);"
onblur="QuickFolders.Interface.findPopupBlur(this, event);"
ignorekeys="false">
</menupopup>
</popupset>
<popupset id="QuickFolders-QuickMovePopupSet">
<menupopup id="QuickFolders-quickMoveMenu">
Expand Down Expand Up @@ -531,6 +517,22 @@ async function onLoad(activatedWhileWindowOpen) {
onclick="QuickFolders.Interface.quickMoveHelp(this);"
/>
</hbox>
<popupset id="QuickFolders-Palette" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<menupopup id="QuickFolders-PalettePopup"
class="QuickFolders-folder-popup"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
onclick="QuickFolders.Interface.clickHandler(event,this);">
</menupopup>
<menupopup id="QuickFolders-FindPopup"
class="menu-iconic widerMenu"
position="after_start"
oncommand="QuickFolders.Interface.selectFound(this, event);"
onkeypress="QuickFolders.Interface.foundInput(this, event);"
onblur="QuickFolders.Interface.findPopupBlur(this, event);"
ignorekeys="false">
</menupopup>
</popupset>
</hbox>
</vbox>
</hbox>
Expand Down

0 comments on commit f24975e

Please sign in to comment.