mirror of
https://github.com/viliusle/miniPaint.git
synced 2026-02-06 13:36:45 +00:00
small design and gui updates
This commit is contained in:
parent
2714121c4b
commit
57d66e8757
@ -123,8 +123,8 @@
|
||||
<li><a class="trn dots" onclick="call_menu(FILE, 'file_save');" href="#">Save as</a></li>
|
||||
<li><a class="trn dots" onclick="call_menu(FILE, 'file_print');" href="#">Print</a></li>
|
||||
<li><div class="mid-line"></div></li>
|
||||
<li><a class="trn dots" onclick="call_menu(FILE, 'file_quicksave');" href="#">Quick save</a></li>
|
||||
<li><a class="trn dots" onclick="call_menu(FILE, 'file_quickload');" href="#">Quick load</a></li>
|
||||
<li><a class="trn" onclick="call_menu(FILE, 'file_quicksave');" href="#">Quick save</a></li>
|
||||
<li><a class="trn" onclick="call_menu(FILE, 'file_quickload');" href="#">Quick load</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
|
||||
@ -17,7 +17,6 @@ document.addEventListener("mousewheel", EVENTS.mouse_wheel_handler, false); //mo
|
||||
document.addEventListener("DOMMouseScroll", EVENTS.mouse_wheel_handler, false); //mouse scroll
|
||||
document.oncontextmenu = function (e) { return EVENTS.mouse_right_click(e); }; //mouse right click
|
||||
document.getElementById('color_hex').onkeyup = function (e) { GUI.set_color_manual(e); }; //on main color type
|
||||
document.getElementById('color_hex').onpaste = function (e) { GUI.set_color_manual(e); }; // on paste in main color input
|
||||
|
||||
//windows touch
|
||||
document.addEventListener('MSPointerDown', EVENTS.mouse_click, false);
|
||||
|
||||
45
js/gui.js
45
js/gui.js
@ -356,7 +356,8 @@ function GUI_CLASS() {
|
||||
};
|
||||
|
||||
this.update_attribute = function (object, next_value) {
|
||||
var max_value = 500;
|
||||
var max_value = 999;
|
||||
|
||||
for (var k in this.action_data().attributes) {
|
||||
if (k != object.id)
|
||||
continue;
|
||||
@ -388,31 +389,32 @@ function GUI_CLASS() {
|
||||
else {
|
||||
//numbers
|
||||
if (next_value != undefined) {
|
||||
var old_value = parseInt(this.action_data().attributes[k]);
|
||||
if (next_value > 0) {
|
||||
if (parseInt(this.action_data().attributes[k]) == 0)
|
||||
object.value = 1;
|
||||
else if (parseInt(this.action_data().attributes[k]) == 1)
|
||||
object.value = 5;
|
||||
else if (parseInt(this.action_data().attributes[k]) == 5)
|
||||
object.value = 10;
|
||||
//increase
|
||||
if (old_value >= 100)
|
||||
object.value = old_value + 50;
|
||||
else if (old_value >= 10)
|
||||
object.value = old_value + 10;
|
||||
else if (old_value >= 5)
|
||||
object.value = old_value + 5;
|
||||
else
|
||||
object.value = parseInt(this.action_data().attributes[k]) + next_value;
|
||||
object.value = old_value + 1;
|
||||
}
|
||||
else if (next_value < 0) {
|
||||
if (parseInt(this.action_data().attributes[k]) == 1)
|
||||
object.value = 0;
|
||||
else if (parseInt(this.action_data().attributes[k]) <= 5)
|
||||
object.value = 1;
|
||||
else if (parseInt(this.action_data().attributes[k]) <= 10)
|
||||
object.value = 5;
|
||||
else if (parseInt(this.action_data().attributes[k]) <= 20)
|
||||
object.value = 10;
|
||||
//decrease
|
||||
if (old_value > 100)
|
||||
object.value = old_value - 50;
|
||||
else if (old_value > 10)
|
||||
object.value = old_value - 10;
|
||||
else if (old_value > 5)
|
||||
object.value = old_value - 5;
|
||||
else
|
||||
object.value = parseInt(this.action_data().attributes[k]) + next_value;
|
||||
object.value = old_value - 1;
|
||||
}
|
||||
|
||||
if (object.value < 0)
|
||||
object.value = 0;
|
||||
if (object.value < 1)
|
||||
object.value = 1;
|
||||
if (object.value > max_value)
|
||||
object.value = max_value;
|
||||
}
|
||||
@ -484,7 +486,6 @@ function GUI_CLASS() {
|
||||
*/
|
||||
this.show_action_attributes = function () {
|
||||
html = '';
|
||||
var step = 10;
|
||||
for (var k in this.action_data().attributes) {
|
||||
var title = k[0].toUpperCase() + k.slice(1);
|
||||
title = title.replace("_", " ");
|
||||
@ -527,8 +528,8 @@ function GUI_CLASS() {
|
||||
html += '<td><input onKeyUp="GUI.update_attribute(this);" type="number" id="' + k + '" value="' + GUI.action_data().attributes[k] + '" /></td>';
|
||||
html += '</tr>';
|
||||
html += '</table>';
|
||||
html += '<div style="float:left;width:32px;" onclick="GUI.update_attribute(this, ' + (step) + ')" class="attribute-area" id="' + k + '">+</div>';
|
||||
html += '<div style="margin-left:48px;margin-bottom:15px;" onclick="GUI.update_attribute(this, ' + (-step) + ')" class="attribute-area" id="' + k + '">-</div>';
|
||||
html += '<div style="float:left;width:32px;" onclick="GUI.update_attribute(this, 1)" class="attribute-area" id="' + k + '">+</div>';
|
||||
html += '<div style="margin-left:48px;margin-bottom:15px;" onclick="GUI.update_attribute(this, -1)" class="attribute-area" id="' + k + '">-</div>';
|
||||
html += '</div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ function popup() {
|
||||
this.handler = '';
|
||||
this.preview = false;
|
||||
this.onload = false;
|
||||
this.width_mini = 230;
|
||||
this.width_mini = 225;
|
||||
this.height_mini = 200;
|
||||
this.preview_in_main = false;
|
||||
this.effects = false;
|
||||
@ -271,7 +271,7 @@ function popup() {
|
||||
|
||||
document.getElementById("popup").innerHTML = html;
|
||||
document.getElementById("popup").style.display = "block";
|
||||
if (parameters.length > 15)
|
||||
if (parameters.length > 10)
|
||||
document.getElementById("popup").style.overflowY = "scroll";
|
||||
else
|
||||
document.getElementById("popup").style.overflowY = 'hidden';
|
||||
|
||||
@ -666,7 +666,7 @@ input[type="button"]{
|
||||
border:1px solid #000000;
|
||||
width:500px;
|
||||
max-width: 100%;
|
||||
max-height:550px;
|
||||
max-height:560px;
|
||||
overflow-y:scroll;
|
||||
margin:0px auto 0px auto;
|
||||
padding:10px;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user