Make Extras menu always visible
parent
1cf7130ad1
commit
ed23a5561c
|
@ -45,7 +45,6 @@ I want to bring good old paint into the modern era.
|
|||
go to **Image > Attributes...** and select Transparent,
|
||||
then Okay, and then **Image > Clear Image** or use the Eraser tool.
|
||||
Images with *any* translucent pixels will open in Transparent mode.
|
||||
* Go to **View > Extras Menu** to enable access to additional features not available in MS Paint
|
||||
* Switch themes from the Extras menu
|
||||
* Create an animated GIF from the current document history.
|
||||
Accessible from the Extras menu or with <kbd>Ctrl+Shift+G</kbd>.
|
||||
|
|
|
@ -176,19 +176,6 @@ function $MenuBar(menus){
|
|||
|
||||
const menu_id = menus_key.replace("&", "").replace(/ /g, "-").toLowerCase();
|
||||
$menu_button.addClass(`${menu_id}-menu-button`);
|
||||
if(menu_id == "extras"){
|
||||
// TODO: refactor shared key string, move to function
|
||||
// if localStorage is not available, the default setting is visible
|
||||
let extras_menu_should_be_visible = true;
|
||||
try {
|
||||
// if localStorage is available, the default setting is invisible (for now)
|
||||
extras_menu_should_be_visible = localStorage["jspaint extras menu visible"] == "true";
|
||||
// eslint-disable-next-line no-empty
|
||||
} catch(e) {}
|
||||
if(!extras_menu_should_be_visible){
|
||||
$menu_button.hide();
|
||||
}
|
||||
}
|
||||
|
||||
$menu_popup.hide();
|
||||
$menu_button.html(_html(menus_key));
|
||||
|
|
14
src/app.js
14
src/app.js
|
@ -151,20 +151,6 @@ $menu_bar.on("info", (_event, info) => {
|
|||
$menu_bar.on("default-info", ()=> {
|
||||
$status_text.default();
|
||||
});
|
||||
|
||||
const $extras_menu_button = $menu_bar.get(0).ownerDocument.defaultView.$(".extras-menu-button");
|
||||
// TODO: DRY with $MenuBar
|
||||
// if localStorage is not available, the default setting is visible
|
||||
let extras_menu_should_start_visible = true;
|
||||
try{
|
||||
// if localStorage is available, the default setting is invisible (for now)
|
||||
// TODO: refactor shared key string
|
||||
extras_menu_should_start_visible = localStorage["jspaint extras menu visible"] == "true"
|
||||
// eslint-disable-next-line no-empty
|
||||
}catch(e){}
|
||||
if(!extras_menu_should_start_visible){
|
||||
$extras_menu_button.hide();
|
||||
}
|
||||
// </menu bar>
|
||||
|
||||
const $toolbox = $ToolBox(tools);
|
||||
|
|
16
src/menus.js
16
src/menus.js
|
@ -232,22 +232,6 @@ window.menus = {
|
|||
description: "Shows or hides the text toolbar.",
|
||||
},
|
||||
$MenuBar.DIVIDER,
|
||||
{
|
||||
item: "E&xtras Menu",
|
||||
checkbox: {
|
||||
toggle() {
|
||||
$extras_menu_button.toggle();
|
||||
const checked = this.check();
|
||||
try{
|
||||
localStorage["jspaint extras menu visible"] = checked;
|
||||
// eslint-disable-next-line no-empty
|
||||
}catch(e){}
|
||||
},
|
||||
check: () => $extras_menu_button.is(":visible")
|
||||
},
|
||||
description: "Shows or hides the Extras menu.",
|
||||
},
|
||||
$MenuBar.DIVIDER,
|
||||
{
|
||||
item: "&Zoom",
|
||||
submenu: [
|
||||
|
|
Loading…
Reference in New Issue