contentcontrol: expose checkbox unocommmand

added checkbox in mobile,classic and notebookbar

Signed-off-by: Rash419 <rashesh.padia@collabora.com>
Change-Id: I0bed99094c2c4bacd50529dbd00891d39cb40c13
This commit is contained in:
Rash419 2022-05-04 16:45:54 +05:30 committed by Gökay ŞATIR
parent c9b9a6589e
commit d6f055d36d
5 changed files with 22 additions and 5 deletions

View file

@ -169,7 +169,9 @@ L.Control.Menubar = L.Control.extend({
{uno: '.uno:InsertIndexesEntry'},
{uno: '.uno:InsertAuthoritiesEntry'},
{uno: '.uno:InsertMultiIndex'}]},
{name: _UNO('.uno:ContentControlsMenu', 'text'), type: 'menu', menu: [
{uno: '.uno:InsertContentControl'},
{uno: '.uno:InsertCheckboxContentControl'}]},
]},
{name: _UNO('.uno:FormatMenu', 'text'), id: 'format', type: 'menu', menu: [
{name: _UNO('.uno:FormatTextMenu', 'text'), type: 'menu', menu: [
@ -1066,7 +1068,9 @@ L.Control.Menubar = L.Control.extend({
{uno: '.uno:InsertWJ'},
{uno: '.uno:InsertLRM'},
{uno: '.uno:InsertRLM'}]},
{name: _UNO('.uno:InsertContentControl', 'text'), uno: '.uno:InsertContentControl'},
{name: _UNO('.uno:ContentControlsMenu', 'text'), type: 'menu', menu: [
{uno: '.uno:InsertContentControl'},
{uno: '.uno:InsertCheckboxContentControl'}]},
]
},
spreadsheet : {

View file

@ -954,6 +954,16 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
}
]
},
{
'type': 'toolbox',
'children': [
{
'type': 'toolitem',
'text': _UNO('.uno:InsertCheckboxContentControl', 'text'),
'command': '.uno:InsertCheckboxContentControl'
}
]
},
],
'vertical': 'true'
}

View file

@ -1704,7 +1704,6 @@ L.CanvasTileLayer = L.Layer.extend({
app.sectionContainer.setClearColor('#' + this.coreDocBGColor);
}
} else if (textMsg.startsWith('contentcontrol:')) {
//this._onContentControlMsg(textMsg);
textMsg = textMsg.substring('contentcontrol:'.length + 1);
if (!app.sectionContainer.doesSectionExist(L.CSections.ContentControl.name)) {
app.sectionContainer.addSection(new app.definitions.ContentControlSection());

View file

@ -23,10 +23,12 @@ class ContentControlSection {
public onInitialize() {
this.sectionProperties.rectangles = [];
this.sectionProperties.strokeStyle = '#000000';
}
constructor() {
this.sectionProperties.rectangles = null;
this.sectionProperties.strokeStyle = null;
}
drawContentControl(json: any) {
@ -39,7 +41,7 @@ class ContentControlSection {
this.sectionProperties.rectangles.push([parseInt(matches[i]), parseInt(matches[i + 1]), parseInt(matches[i + 2]), parseInt(matches[i + 3])]);
}
}
} else if (json.action == 'hide') {
} else if (json.action === 'hide') {
this.sectionProperties.rectangles = [];
}
app.sectionContainer.requestReDraw();
@ -93,7 +95,7 @@ class ContentControlSection {
xMax = Math.round(xMax * ratio);
yMax = Math.round(yMax * ratio);
this.context.strokeStyle = '#000000';
this.context.strokeStyle = this.sectionProperties.strokeStyle;
this.context.strokeRect(xMin - this.position[0], yMin - this.position[1], xMax - xMin, yMax - yMin);
}
}

View file

@ -492,7 +492,9 @@ var unoCommandsArray = {
'ZTestDialog':{spreadsheet:{menu:_('~Z-test...'),},},
'ZoomMinus':{global:{menu:_('Zoom Out'),},},
'ZoomPlus':{global:{menu:_('Zoom In'),},},
'ContentControlsMenu':{text:{menu:_('Content Controls'),},},
'InsertContentControl':{text:{menu:_('~Insert Rich Text'),},},
'InsertCheckboxContentControl':{text:{menu:_('~Insert Checkbox'),},},
};
window._UNO = function(string, component, isContext) {