mirror of
https://github.com/viliusle/miniPaint.git
synced 2026-02-06 14:11:50 +00:00
Menu items update: translations moved to tools, add "View" menu
This commit is contained in:
parent
203185f0ef
commit
4a150c7d53
@ -133,6 +133,58 @@ const menuDefinition = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'View',
|
||||
children: [
|
||||
{
|
||||
name: 'Zoom',
|
||||
children: [
|
||||
{
|
||||
name: 'Zoom In',
|
||||
target: 'view/zoom.in'
|
||||
},
|
||||
{
|
||||
name: 'Zoom Out',
|
||||
target: 'view/zoom.out'
|
||||
},
|
||||
{
|
||||
divider: true
|
||||
},
|
||||
{
|
||||
name: 'Original Size',
|
||||
target: 'view/zoom.original'
|
||||
},
|
||||
{
|
||||
name: 'Fit Window',
|
||||
target: 'view/zoom.auto'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Grid',
|
||||
shortcut: 'G',
|
||||
target: 'view/grid.grid'
|
||||
},
|
||||
{
|
||||
name: 'Guides',
|
||||
children: [
|
||||
{
|
||||
name: 'Insert',
|
||||
ellipsis: true,
|
||||
target: 'view/guides.insert'
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
target: 'view/guides.update'
|
||||
},
|
||||
{
|
||||
name: 'Remove all',
|
||||
target: 'view/guides.remove'
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Image',
|
||||
children: [
|
||||
@ -153,30 +205,6 @@ const menuDefinition = [
|
||||
shortcut: 'T',
|
||||
target: 'image/trim.trim'
|
||||
},
|
||||
{
|
||||
name: 'Zoom',
|
||||
children: [
|
||||
{
|
||||
name: 'Zoom In',
|
||||
target: 'image/zoom.in'
|
||||
},
|
||||
{
|
||||
name: 'Zoom Out',
|
||||
target: 'image/zoom.out'
|
||||
},
|
||||
{
|
||||
divider: true
|
||||
},
|
||||
{
|
||||
name: 'Original Size',
|
||||
target: 'image/zoom.original'
|
||||
},
|
||||
{
|
||||
name: 'Fit Window',
|
||||
target: 'image/zoom.auto'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
divider: true
|
||||
},
|
||||
@ -236,30 +264,6 @@ const menuDefinition = [
|
||||
ellipsis: true,
|
||||
target: 'image/palette.palette'
|
||||
},
|
||||
{
|
||||
name: 'Grid',
|
||||
ellipsis: true,
|
||||
shortcut: 'G',
|
||||
target: 'image/grid.grid'
|
||||
},
|
||||
{
|
||||
name: 'Guides',
|
||||
children: [
|
||||
{
|
||||
name: 'Insert',
|
||||
ellipsis: true,
|
||||
target: 'image/guides.insert'
|
||||
},
|
||||
{
|
||||
name: 'Update',
|
||||
target: 'image/guides.update'
|
||||
},
|
||||
{
|
||||
name: 'Remove all',
|
||||
target: 'image/guides.remove'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
divider: true
|
||||
},
|
||||
@ -620,6 +624,62 @@ const menuDefinition = [
|
||||
{
|
||||
divider: true
|
||||
},
|
||||
{
|
||||
name: 'Language',
|
||||
children: [
|
||||
{
|
||||
name: 'English',
|
||||
target: 'tools/translate.translate.en'
|
||||
},
|
||||
{
|
||||
divider: true
|
||||
},
|
||||
{
|
||||
name: '简体中文',
|
||||
target: 'tools/translate.translate.zh'
|
||||
},
|
||||
{
|
||||
name: 'Español',
|
||||
target: 'tools/translate.translate.es'
|
||||
},
|
||||
{
|
||||
name: 'Français',
|
||||
target: 'tools/translate.translate.fr'
|
||||
},
|
||||
{
|
||||
name: 'Deutsch',
|
||||
target: 'tools/translate.translate.de'
|
||||
},
|
||||
{
|
||||
name: 'Italiano',
|
||||
target: 'tools/translate.translate.it'
|
||||
},
|
||||
{
|
||||
name: '日本語',
|
||||
target: 'tools/translate.translate.ja'
|
||||
},
|
||||
{
|
||||
name: '한국어',
|
||||
target: 'tools/translate.translate.ko'
|
||||
},
|
||||
{
|
||||
name: 'Lietuvių',
|
||||
target: 'tools/translate.translate.lt'
|
||||
},
|
||||
{
|
||||
name: 'Português',
|
||||
target: 'tools/translate.translate.pt'
|
||||
},
|
||||
{
|
||||
name: 'русский язык',
|
||||
target: 'tools/translate.translate.ru'
|
||||
},
|
||||
{
|
||||
name: 'Türkçe',
|
||||
target: 'tools/translate.translate.tr'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: 'Settings',
|
||||
ellipsis: true,
|
||||
@ -639,62 +699,6 @@ const menuDefinition = [
|
||||
name: 'Report Issues',
|
||||
href: 'https://github.com/viliusle/miniPaint/issues'
|
||||
},
|
||||
{
|
||||
name: 'Language',
|
||||
children: [
|
||||
{
|
||||
name: 'English',
|
||||
target: 'help/translate.translate.en'
|
||||
},
|
||||
{
|
||||
divider: true
|
||||
},
|
||||
{
|
||||
name: '简体中文',
|
||||
target: 'help/translate.translate.zh'
|
||||
},
|
||||
{
|
||||
name: 'Español',
|
||||
target: 'help/translate.translate.es'
|
||||
},
|
||||
{
|
||||
name: 'Français',
|
||||
target: 'help/translate.translate.fr'
|
||||
},
|
||||
{
|
||||
name: 'Deutsch',
|
||||
target: 'help/translate.translate.de'
|
||||
},
|
||||
{
|
||||
name: 'Italiano',
|
||||
target: 'help/translate.translate.it'
|
||||
},
|
||||
{
|
||||
name: '日本語',
|
||||
target: 'help/translate.translate.ja'
|
||||
},
|
||||
{
|
||||
name: '한국어',
|
||||
target: 'help/translate.translate.ko'
|
||||
},
|
||||
{
|
||||
name: 'Lietuvių',
|
||||
target: 'help/translate.translate.lt'
|
||||
},
|
||||
{
|
||||
name: 'Português',
|
||||
target: 'help/translate.translate.pt'
|
||||
},
|
||||
{
|
||||
name: 'русский язык',
|
||||
target: 'help/translate.translate.ru'
|
||||
},
|
||||
{
|
||||
name: 'Türkçe',
|
||||
target: 'help/translate.translate.tr'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
divider: true
|
||||
},
|
||||
|
||||
@ -11,7 +11,7 @@ import GUI_layers_class from './gui/gui-layers.js';
|
||||
import GUI_information_class from './gui/gui-information.js';
|
||||
import GUI_details_class from './gui/gui-details.js';
|
||||
import GUI_menu_class from './gui/gui-menu.js';
|
||||
import Help_translate_class from './../modules/help/translate.js';
|
||||
import Tools_translate_class from './../modules/tools/translate.js';
|
||||
import Helper_class from './../libs/helpers.js';
|
||||
import alertify from './../../../node_modules/alertifyjs/build/alertify.min.js';
|
||||
|
||||
@ -61,7 +61,7 @@ class Base_gui_class {
|
||||
this.GUI_information = new GUI_information_class(this);
|
||||
this.GUI_details = new GUI_details_class(this);
|
||||
this.GUI_menu = new GUI_menu_class();
|
||||
this.Help_translate = new Help_translate_class();
|
||||
this.Tools_translate = new Tools_translate_class();
|
||||
this.modules = {};
|
||||
}
|
||||
|
||||
@ -255,7 +255,7 @@ class Base_gui_class {
|
||||
|
||||
if (lang != null && lang != config.LANG) {
|
||||
config.LANG = lang.replace(/([^a-z]+)/gi, '');
|
||||
this.Help_translate.translate(config.LANG);
|
||||
this.Tools_translate.translate(config.LANG);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
|
||||
import config from './../../config.js';
|
||||
import menuDefinition from './../../config-menu.js';
|
||||
import Help_translate_class from './../../modules/help/translate.js';
|
||||
import Tools_translate_class from './../../modules/tools/translate.js';
|
||||
|
||||
/**
|
||||
* class responsible for rendering main menu
|
||||
@ -20,7 +20,7 @@ class GUI_menu_class {
|
||||
this.lastFocusedMenuBarLink = 0;
|
||||
this.dropdownStack = [];
|
||||
|
||||
this.Help_translate = new Help_translate_class();
|
||||
this.Tools_translate = new Tools_translate_class();
|
||||
}
|
||||
|
||||
render_main() {
|
||||
@ -339,7 +339,7 @@ class GUI_menu_class {
|
||||
this.menuContainer.appendChild(dropdownElement);
|
||||
|
||||
if (config.LANG != 'en') {
|
||||
this.Help_translate.translate(config.LANG, this.menuContainer);
|
||||
this.Tools_translate.translate(config.LANG, this.menuContainer);
|
||||
}
|
||||
|
||||
if (focusAfterCreation) {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
import app from './../../app.js';
|
||||
import config from './../../config.js';
|
||||
import Helper_class from './../../libs/helpers.js';
|
||||
import Help_translate_class from './../../modules/help/translate.js';
|
||||
import Tools_translate_class from './../../modules/tools/translate.js';
|
||||
import alertify from './../../../../node_modules/alertifyjs/build/alertify.min.js';
|
||||
import Base_gui_class from '../base-gui.js';
|
||||
|
||||
@ -25,7 +25,7 @@ class GUI_tools_class {
|
||||
instance = this;
|
||||
|
||||
this.Helper = new Helper_class();
|
||||
this.Help_translate = new Help_translate_class();
|
||||
this.Tools_translate = new Tools_translate_class();
|
||||
this.Base_gui = new Base_gui_class();
|
||||
|
||||
//active tool
|
||||
@ -362,7 +362,7 @@ class GUI_tools_class {
|
||||
|
||||
if (config.LANG != 'en') {
|
||||
//retranslate
|
||||
this.Help_translate.translate(config.LANG);
|
||||
this.Tools_translate.translate(config.LANG);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@
|
||||
import './../../css/popup.css';
|
||||
import Base_layers_class from './../core/base-layers.js';
|
||||
import Base_gui_class from './../core/base-gui.js';
|
||||
import Help_translate_class from './../modules/help/translate.js';
|
||||
import Tools_translate_class from './../modules/tools/translate.js';
|
||||
|
||||
var instance = null;
|
||||
|
||||
@ -83,7 +83,7 @@ class Dialog_class {
|
||||
this.parameters = [];
|
||||
this.Base_layers = new Base_layers_class();
|
||||
this.Base_gui = new Base_gui_class();
|
||||
this.Help_translate = new Help_translate_class();
|
||||
this.Tools_translate = new Tools_translate_class();
|
||||
this.last_params_hash = '';
|
||||
this.layer_active_small = document.createElement("canvas");
|
||||
this.layer_active_small_ctx = this.layer_active_small.getContext("2d");
|
||||
@ -417,7 +417,7 @@ class Dialog_class {
|
||||
|
||||
//call translation again to translate popup
|
||||
var lang = this.Base_gui.get_language();
|
||||
this.Help_translate.translate(lang);
|
||||
this.Tools_translate.translate(lang);
|
||||
}
|
||||
|
||||
generateParamsHtml() {
|
||||
|
||||
@ -5,7 +5,7 @@ import alertify from './../../../../node_modules/alertifyjs/build/alertify.min.j
|
||||
|
||||
var instance = null;
|
||||
|
||||
class Help_translate_class {
|
||||
class Tools_translate_class {
|
||||
|
||||
constructor() {
|
||||
//singleton
|
||||
@ -67,4 +67,4 @@ class Help_translate_class {
|
||||
}
|
||||
}
|
||||
|
||||
export default Help_translate_class;
|
||||
export default Tools_translate_class;
|
||||
@ -1,11 +1,10 @@
|
||||
import config from './../../config.js';
|
||||
import Dialog_class from './../../libs/popup.js';
|
||||
import Helper_class from './../../libs/helpers.js';
|
||||
import Base_gui_class from './../../core/base-gui.js';
|
||||
|
||||
var instance = null;
|
||||
|
||||
class Image_grid_class {
|
||||
class View_grid_class {
|
||||
|
||||
constructor() {
|
||||
//singleton
|
||||
@ -14,7 +13,6 @@ class Image_grid_class {
|
||||
}
|
||||
instance = this;
|
||||
|
||||
this.POP = new Dialog_class();
|
||||
this.GUI = new Base_gui_class();
|
||||
this.Helper = new Helper_class();
|
||||
|
||||
@ -29,29 +27,14 @@ class Image_grid_class {
|
||||
|
||||
if (code == 71 && event.ctrlKey != true && event.metaKey != true) {
|
||||
//G - grid
|
||||
this.toggle_grid({visible: !this.GUI.grid});
|
||||
this.grid({visible: !this.GUI.grid});
|
||||
event.preventDefault();
|
||||
}
|
||||
}, false);
|
||||
}
|
||||
|
||||
grid() {
|
||||
var _this = this;
|
||||
|
||||
var settings = {
|
||||
title: 'Grid',
|
||||
params: [
|
||||
{name: "visible", title: "Visible:", value: this.GUI.grid},
|
||||
],
|
||||
on_finish: function (params) {
|
||||
_this.toggle_grid(params);
|
||||
},
|
||||
};
|
||||
this.POP.show(settings);
|
||||
}
|
||||
|
||||
toggle_grid(params) {
|
||||
if (params.visible == true) {
|
||||
if (this.GUI.grid == false) {
|
||||
this.GUI.grid = true;
|
||||
}
|
||||
else {
|
||||
@ -62,4 +45,4 @@ class Image_grid_class {
|
||||
|
||||
}
|
||||
|
||||
export default Image_grid_class;
|
||||
export default View_grid_class;
|
||||
@ -4,7 +4,7 @@ import Helper_class from './../../libs/helpers.js';
|
||||
import Base_layers_class from './../../core/base-layers.js';
|
||||
import alertify from './../../../../node_modules/alertifyjs/build/alertify.min.js';
|
||||
|
||||
class Image_guides_class {
|
||||
class View_guides_class {
|
||||
|
||||
|
||||
constructor() {
|
||||
@ -120,4 +120,4 @@ class Image_guides_class {
|
||||
|
||||
}
|
||||
|
||||
export default Image_guides_class;
|
||||
export default View_guides_class;
|
||||
@ -1,6 +1,6 @@
|
||||
import GUI_preview_class from './../../core/gui/gui-preview.js';
|
||||
|
||||
class Image_translate_class {
|
||||
class View_zoom_class {
|
||||
|
||||
constructor() {
|
||||
this.GUI_preview = new GUI_preview_class();
|
||||
@ -23,4 +23,4 @@ class Image_translate_class {
|
||||
}
|
||||
}
|
||||
|
||||
export default Image_translate_class;
|
||||
export default View_zoom_class;
|
||||
Loading…
Reference in New Issue
Block a user