From 1831db530dd533d983c5a9937858c0754093339c Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Tue, 28 Feb 2017 16:36:32 +0100 Subject: [PATCH 1/2] Make the label smaller to fit on screen. As we are on the quicktag module it seems quite obvious that we are handling quicktag. So let's just use "tag" instead of "quicktag", this is a bit smaller and it saves spaces on the widget. This ensure that the whole module is visible in most cases (panel size, font size...). --- contrib/quicktag.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index 13a0093..7ba4877 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -163,7 +163,7 @@ for j=1,qnr do local old_quicktag = dt.new_widget("combobox"){ - label = _("old quicktag"), + label = _("old tag"), tooltip = _("select the quicktag to replace") } @@ -180,14 +180,14 @@ update_quicktag_list() local new_quicktag = dt.new_widget("entry"){ text = "", - placeholder = _("new quicktag"), + placeholder = _("new tag"), is_password = true, editable = true, tooltip = _("enter your tag here") } local set_quicktag_button = dt.new_widget("button") { - label = _("set quicktag"), + label = _("set tag"), clicked_callback = function() local old_tag = quicktag_table[old_quicktag.selected] if new_quicktag.text == "" then @@ -204,7 +204,7 @@ local set_quicktag_button = dt.new_widget("button") { local new_qt_widget = dt.new_widget ("box") { orientation = "horizontal", - dt.new_widget("label") { label = _("new quicktag") }, + dt.new_widget("label") { label = _("new tag") }, new_quicktag, set_quicktag_button } From 0be268c01f04a3d7cc708ffd2f83b4cfa2c6e1f5 Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Tue, 28 Feb 2017 16:38:50 +0100 Subject: [PATCH 2/2] Remove trailing whitespaces. --- contrib/quicktag.lua | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/contrib/quicktag.lua b/contrib/quicktag.lua index 7ba4877..914a1d7 100644 --- a/contrib/quicktag.lua +++ b/contrib/quicktag.lua @@ -120,17 +120,17 @@ local function tagattach(tag,qtagnr) dt.print(string.format(_("quicktag %i is empty, please set a tag"), qtagnr)) return true end - + local tagnr = dt.tags.find(tag) - ---create tag if it does not exist + +--create tag if it does not exist if tagnr == nil then dt.tags.create(tag) tagnr = dt.tags.find(tag) end - + local sel_images = dt.gui.action_images - + if next(sel_images) == nil then dt.print(_("no images selected")) return true @@ -230,7 +230,7 @@ dt.register_lib( true, -- expandable false, -- resetable {[dt.gui.views.lighttable] = {"DT_UI_CONTAINER_PANEL_RIGHT_CENTER", 490}}, - + dt.new_widget("box"){ orientation = "vertical", table.unpack(widget_table), @@ -242,7 +242,7 @@ dt.register_lib( -- create shortcuts for i=1,qnr do - dt.register_event("shortcut", + dt.register_event("shortcut", function(event, shortcut) tagattach(tostring(quicktag_table[i])) end, string.format(_("quicktag %i"),i)) end