From efb747fda262b68ebde70a0f10a922e1182c80d1 Mon Sep 17 00:00:00 2001 From: Igor Timofeev Date: Thu, 12 Apr 2018 17:00:38 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D1=85=20=D1=83=D0=B6=20=D1=8D=D1=82?= =?UTF-8?q?=D0=B0=20=D1=81=D1=83=D0=B1-=D0=B8=D0=BD=D1=84=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Applications/PictureEdit/Main.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Applications/PictureEdit/Main.lua b/Applications/PictureEdit/Main.lua index 8209922a..ed05efd2 100644 --- a/Applications/PictureEdit/Main.lua +++ b/Applications/PictureEdit/Main.lua @@ -4,6 +4,7 @@ local GUI = require("GUI") local MineOSCore = require("MineOSCore") local fs = require("filesystem") local image = require("image") +local unicode = require("unicode") local color = require("color") local buffer = require("doubleBuffering") local MineOSPaths = require("MineOSPaths") @@ -24,6 +25,7 @@ local config = { } local recentColorsLimit = 52 +local recentFilesLimit = 10 -------------------------------------------------------------------- @@ -60,6 +62,10 @@ local function addRecentFile(path) end table.insert(config.recentFiles, 1, path) + if #config.recentFiles > recentFilesLimit then + table.remove(config.recentFiles, #config.recentFiles) + end + saveConfig() end @@ -174,6 +180,14 @@ end mainContainer.image.draw = function(object) GUI.windowShadow(object.x, object.y, object.width, object.height, nil, true) + local y, text = object.y + object.height + 1, "Size: " .. object.width .. "x" .. object.height + buffer.text(math.floor(object.x + object.width / 2 - unicode.len(text) / 2), y, 0x5A5A5A, text) + + if savePath then + text = "Path: " .. savePath + buffer.text(math.floor(object.x + object.width / 2 - unicode.len(text) / 2), y + 1, 0x5A5A5A, text) + end + local x, y, step, notStep, background, foreground, symbol = object.x, object.y, false, mainContainer.image.width % 2 for i = 3, #mainContainer.image.data, 4 do @@ -294,6 +308,7 @@ mainContainer.image.reposition = function() end local function newNoGUI(width, height) + savePath = nil mainContainer.image.data = {width, height} mainContainer.image.reposition()