From e5fc1d0bca89cc749e4dfe7771849ccaba7ce389 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szymon=20K=C5=82os?= Date: Fri, 9 Jul 2021 16:39:55 +0200 Subject: [PATCH] mobile-wizard: fix shape glow panel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Szymon Kłos Change-Id: I5903b0f8fe0b39d7243db59a0627f62644942156 --- loleaflet/src/control/Control.JSDialogBuilder.js | 9 ++++++++- .../src/control/Control.MobileWizardBuilder.js | 16 ++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js index 33749bcfb..2dda8bc88 100644 --- a/loleaflet/src/control/Control.JSDialogBuilder.js +++ b/loleaflet/src/control/Control.JSDialogBuilder.js @@ -1249,6 +1249,9 @@ L.Control.JSDialogBuilder = L.Control.extend({ case 'fontsizecombobox': return '.uno:FontHeight'; + + case 'LB_GLOW_COLOR': + return '.uno:GlowColor'; } return null; @@ -2564,6 +2567,10 @@ L.Control.JSDialogBuilder = L.Control.extend({ _sendColorCommand: function(builder, data, color) { var gradientItem; + if (data.id === 'LB_GLOW_COLOR') { + data.id = 'GlowColor'; + } + if (data.id === 'fillgrad1') { gradientItem = builder.map['stateChangeHandler'].getItemValue('.uno:FillGradient'); gradientItem.startcolor = color; @@ -2588,7 +2595,7 @@ L.Control.JSDialogBuilder = L.Control.extend({ builder.map.sendUnoCommand('.uno:FillPageGradient?FillPageGradientJSON:string=' + JSON.stringify(gradientItem)); return; } else if (data.id === 'Color' || data.id === 'CharBackColor' || data.id === 'FillColor' - || data.id === 'XLineColor') { + || data.id === 'XLineColor' || data.id === 'GlowColor') { var params = {}; params[data.id] = { type : 'long', diff --git a/loleaflet/src/control/Control.MobileWizardBuilder.js b/loleaflet/src/control/Control.MobileWizardBuilder.js index 623d71020..9ceafc5b7 100644 --- a/loleaflet/src/control/Control.MobileWizardBuilder.js +++ b/loleaflet/src/control/Control.MobileWizardBuilder.js @@ -665,9 +665,21 @@ L.Control.MobileWizardBuilder = L.Control.JSDialogBuilder.extend({ // apply needed modifications for mobile _modifySidebarNodes: function(data) { - for (var i in data) { - if ((data[i].id === 'fillgrad1' || data[i].id === 'fillgrad2') && data[i].type === 'menubutton') + for (var i = data.length - 1; i >= 0; i--) { + if (data[i].type === 'menubutton' && + (data[i].id === 'fillgrad1' + || data[i].id === 'fillgrad2' + || data[i].id === 'LB_GLOW_COLOR')) { + + if (data[i].id === 'LB_GLOW_COLOR') + data[i].command = '.uno:GlowColor'; + data[i].type = 'colorlistbox'; + } else if ((data[i].command === 'sidebargradient' && data[i].type === 'toolitem') + || (data[i].id === 'radiusglow' && data[i].type === 'fixedtext') + || (data[i].id === 'radiussoftedge' && data[i].type === 'fixedtext')) { + data.splice(i, 1); + } } },