Disable Image > Clear Image when there's a selection

main
Isaiah Odhner 2020-01-05 12:16:21 -05:00
parent e4a3018c5c
commit 7d002432a7
3 changed files with 15 additions and 8 deletions

View File

@ -1459,7 +1459,7 @@ function clear(){
deselect();
cancel();
undoable({
name: "Clear",
name: "Clear Image",
icon: get_help_folder_icon("p_blank.png"),
}, () => {
saved = false;

View File

@ -39,7 +39,7 @@ function manage_storage(){
$storage_manager.close();
}
$storage_manager = $FormWindow().title("Manage Storage").addClass("storage-manager dialogue-window");
// @TODO: remove all button (with confirmation)
// @TODO: way to remove all (with confirmation)
const $table = $(E("table")).appendTo($storage_manager.$main);
const $message = $(E("p")).appendTo($storage_manager.$main).html(
"Any images you've saved to your computer with <b>File > Save</b> will not be affected."

View File

@ -227,7 +227,7 @@ window.menus = {
},
{
item: "T&ext Toolbar",
enabled: false, // @TODO
enabled: false, // @TODO: toggle fonts box
checkbox: {},
description: "Shows or hides the text toolbar.",
},
@ -271,7 +271,7 @@ window.menus = {
},
{
item: "Show T&humbnail",
enabled: false, // @TODO
enabled: false, // @TODO: implement Show Thumbnail
checkbox: {},
description: "Shows or hides the thumbnail view of the picture.",
}
@ -312,11 +312,18 @@ window.menus = {
{
item: "&Clear Image",
shortcut: looksLikeChrome ? undefined : "Ctrl+Shift+N", // opens incognito window in chrome
//shortcut: "Ctrl+Shft+N", [sic]
action: ()=> { clear(); },
// (mspaint says "Ctrl+Shft+N")
action: ()=> { !selection && clear(); },
enabled: ()=> !selection,
description: "Clears the picture.",
// TODO: do as mspaint does here!
// description: "Clears the picture or selection.",
// action: ()=> {
// if (selection) {
// delete_selection();
// } else {
// clear();
// }
// },
// mspaint says "Clears the picture or selection.", but grays out the option when there's a selection
},
{
item: "&Draw Opaque",