[Libreoffice-commits] online.git: loleaflet/css loleaflet/images loleaflet/src

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Aug 5 09:57:32 UTC 2020


 loleaflet/css/notebookbar.css                       |   17 +
 loleaflet/images/lc_fontdialog.svg                  |    1 
 loleaflet/images/lc_outlinebullet.svg               |    1 
 loleaflet/images/lc_paragraphdialog.svg             |    1 
 loleaflet/images/lc_transformdialog.svg             |    1 
 loleaflet/src/control/Control.JSDialogBuilder.js    |    2 
 loleaflet/src/control/Control.NotebookbarBuilder.js |   12 +
 loleaflet/src/control/Control.NotebookbarImpress.js |  175 ++++++++++++++++++++
 loleaflet/src/control/Control.NotebookbarWriter.js  |  163 ++++++++++++++++++
 9 files changed, 373 insertions(+)

New commits:
commit 936ea3eb1992f3abe87c0c1e7aad290ed2687f4e
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Aug 5 11:15:51 2020 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Aug 5 11:57:13 2020 +0200

    notebookbar: Format tab for writer & impress
    
    Change-Id: Id4365aff42af94d23b398736d00c6c9cde02e4ee
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100156
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/css/notebookbar.css b/loleaflet/css/notebookbar.css
index 15924d608..70805ca81 100644
--- a/loleaflet/css/notebookbar.css
+++ b/loleaflet/css/notebookbar.css
@@ -283,6 +283,18 @@ div[id*='Row'].notebookbar, div[id*='Column'].notebookbar, #SendToBack.notebookb
 	filter: grayscale(100%) brightness(100%);
 }
 
+.unotoolbutton.notebookbar {
+	text-align: center;
+}
+
+.unotoolbutton.notebookbar.has-label {
+	text-align: center;
+}
+
+.unotoolbutton.notebookbar.has-label:not(.inline) img {
+	width: 32px !important;
+	height: 32px !important;
+}
 
 /* unobuttons with inline labels */
 
@@ -473,6 +485,11 @@ div[id*='Row'].notebookbar, div[id*='Column'].notebookbar, #SendToBack.notebookb
 	display: none;
 }
 
+/* Format Tab */
+#table-Format-Section.notebookbar {
+	margin-top: 25px;
+}
+
 /* Table Tab */
 
 #table-Table-Container,
diff --git a/loleaflet/images/lc_fontdialog.svg b/loleaflet/images/lc_fontdialog.svg
new file mode 100644
index 000000000..245d0ddc4
--- /dev/null
+++ b/loleaflet/images/lc_fontdialog.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m10.048828 2-1.048828 2.9765625v3.0234375c0 .554-.446 1-1 1h-.4179688l-4.5820312 13h2.9863281c.3203884 0 .5871891-.09076.8007813-.271484.2233009-.190763.373502-.396304.4511718-.617188l1.2089844-3.916016h7.1210934l1.222657 3.931641c.09709.251004.247288.462129.451172.632813.203882.160642.4766.240234.816406.240234h2.941406l-7.048828-20zm1.9375 3.6445312c.126214.4919682.250739.9494071.376953 1.3710938.126214.4116466.24873.7727394.365235 1.0839844l1.964843 6.3242186h-5.3867184l1.9648434-6.3085936c.106797-.311245.223396-.6779227.34961-1.0996094.126213-.4216867.248729-.8791258.365234-1.3710938z" fill="#696969"/><g fill="#eac282"><rect height="1" ry=".5" width="6" x="1" y="1"/><rect height="6" ry=".5" width="1" x="1" y="1"/><path d="m2.4999352 7.4999941 5.0000589-5.0000589v5.0000589z" fill-rule="evenodd" stroke="#eac282" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.000012"/></g></svg>
\ No newline at end of file
diff --git a/loleaflet/images/lc_outlinebullet.svg b/loleaflet/images/lc_outlinebullet.svg
new file mode 100644
index 000000000..cb72428fd
--- /dev/null
+++ b/loleaflet/images/lc_outlinebullet.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g fill="#808080" transform="scale(-1 1)"><rect height="1" ry=".5" width="13" x="-22" y="2"/><rect height="1" ry=".392136" width="15.000005" x="-22" y="10"/><rect height="1" ry=".436441" width="15.000001" x="-22" y="18"/><rect height="1" ry=".5" width="8.999999" x="-16" y="21"/><rect height="1" ry=".5" width="8.999999" x="-16" y="13"/><rect height="1" ry=".5" width="7" x="-16" y="5"/></g><circle cx="3.5" cy="19.5" fill="#4d82b8" r="1.5"/><circle cx="3.5" cy="11.5" fill="#4d82b8" r="1.5"/><g fill="#eac282"><rect height="1" ry=".5" width="6" x="1" y="1"/><rect height="6" ry=".5" width="1" x="1" y="1"/><path d="m2.4999352 7.4999941 5.0000589-5.0000589v5.0000589z" fill-rule="evenodd" stroke="#eac282" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.000012"/></g></svg>
\ No newline at end of file
diff --git a/loleaflet/images/lc_paragraphdialog.svg b/loleaflet/images/lc_paragraphdialog.svg
new file mode 100644
index 000000000..c6ceb2578
--- /dev/null
+++ b/loleaflet/images/lc_paragraphdialog.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="m11 2c-.702065 0-1.3738419.1260745-2 .3476562v5.6523438c0 .554-.446 1-1 1h-2.9101562c.4770899 2.836504 2.9380179 5 5.9101562 5v8h2v-18h2v18h2v-18l4-1v-1z" fill="#696969"/><g fill="#eac282"><path d="m2.4999352 7.4999941 5.0000589-5.0000589v5.0000589z" fill-rule="evenodd" stroke="#eac282" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.000012"/><rect height="6" ry=".5" width="1" x="1" y="1"/><rect height="1" ry=".5" width="6" x="1" y="1"/></g></svg>
\ No newline at end of file
diff --git a/loleaflet/images/lc_transformdialog.svg b/loleaflet/images/lc_transformdialog.svg
new file mode 100644
index 000000000..87f5bd3e2
--- /dev/null
+++ b/loleaflet/images/lc_transformdialog.svg
@@ -0,0 +1 @@
+<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g fill="#4d82b8" fill-rule="evenodd"><path d="m6.1435544 8.0039296c.778252.00808 1.1512307.9591773.5859382 1.4941407l-1.5996433 1.5061357h8.8691417c.554 0 1 .446 1 1s-.446 1-1 1h-8.8671886l1.5976902 1.505677c.8258861.806001-.3821743 2.045287-1.2089852 1.240234l-3.2597982-3.12677c-.3476123-.339574-.3476123-.898707 0-1.238281l3.2597982-3.125277c.1646191-.1659093.3893379-.2581921.623047-.2558594z"/><path d="m17.856445 8.0039297c-.778251.00808-1.151229.9591774-.585938 1.4941407l1.599644 1.5061736h-8.869142c-.554 0-1 .446-1 1s.446 1 1 1h8.867188l-1.59769 1.505639c-.825679.806004.382177 2.045081 1.208985 1.240234l3.259799-3.126732c.347612-.339574.347612-.898707 0-1.238281l-3.259799-3.1253149c-.164619-.1659094-.389337-.2581921-.623047-.2558594z"/><path d="m15.996071 6.1435544c-.0081.7782524-.959177 1.1512313-1.494141.5859382l-1.506136-1.5996428v8.8691422c0 .554-.446 1-1 1s-1-.446-1-1v-8.8671891l-1.5056765 1.5976897c-.8060016.8258
 861-2.0452879-.3821743-1.240235-1.2089852l3.1267705-3.2597977c.339574-.3476129.898708-.3476129 1.238282 0l3.125275 3.2597977c.16591.164619.258193.3893378.255861.623047z"/></g><rect fill="#eac282" height="4" ry="1" width="20" x="2" y="18"/><g fill="#808080" transform="translate(0 4)"><path d="m5 14h1v2h-1z"/><path d="m8 14h1v2h-1z"/><path d="m11 14h1v2h-1z"/><path d="m14 14h1v2h-1z"/><path d="m17 14h1v2h-1z"/></g><path d="m11 13h2v4h-2z" fill="#4d82b8"/></svg>
\ No newline at end of file
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index d3b1fe202..5c7313370 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1654,9 +1654,11 @@ L.Control.JSDialogBuilder = L.Control.extend({
 				label.innerHTML = data.text;
 
 				controls['label'] = label;
+				$(div).addClass('has-label');
 			} else {
 				div.title = data.text;
 				$(div).tooltip();
+				$(div).addClass('no-label');
 			}
 
 			if (builder.options.useInLineLabelsForUnoButtons === true) {
diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js
index 2420109cb..40e3320cc 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -17,6 +17,7 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
 		this._controlHandlers['listbox'] = this._comboboxControlHandler;
 		this._controlHandlers['tabcontrol'] = this._overridenTabsControlHandler;
 		this._controlHandlers['menubartoolitem'] = this._menubarToolItemHandler;
+		this._controlHandlers['bigtoolitem'] = this._bigtoolitemHandler;
 
 		this._controlHandlers['pushbutton'] = function() { return false; };
 		this._controlHandlers['spinfield'] = function() { return false; };
@@ -182,6 +183,17 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
 		this._toolitemHandlers['vnd.sun.star.findbar:FocusToFindbar'] = function() {};
 	},
 
+	_bigtoolitemHandler: function(parentContainer, data, builder) {
+		var noLabels = builder.options.noLabelsForUnoButtons;
+		builder.options.noLabelsForUnoButtons = false;
+
+		builder._toolitemHandler(parentContainer, data, builder);
+
+		builder.options.noLabelsForUnoButtons = noLabels;
+
+		return false;
+	},
+
 	onCommandStateChanged: function(e) {
 		var commandName = e.commandName;
 		var state = e.state;
diff --git a/loleaflet/src/control/Control.NotebookbarImpress.js b/loleaflet/src/control/Control.NotebookbarImpress.js
index 91653905c..a0f13cb56 100644
--- a/loleaflet/src/control/Control.NotebookbarImpress.js
+++ b/loleaflet/src/control/Control.NotebookbarImpress.js
@@ -103,6 +103,11 @@ L.Control.NotebookbarImpress = L.Control.NotebookbarWriter.extend({
 				'id': '6',
 				'name': 'ReviewLabel'
 			},
+			{
+				'text': _('Format'),
+				'id': '-3',
+				'name': 'Format',
+			},
 			{
 				'text': _('~Table'),
 				'id': '8',
@@ -123,6 +128,22 @@ L.Control.NotebookbarImpress = L.Control.NotebookbarWriter.extend({
 		];
 	},
 
+	selectedTab: function(tabName) {
+		switch (tabName) {
+		case 'File':
+			this.loadTab(this.getFileTab());
+			break;
+
+		case 'Help':
+			this.loadTab(this.getHelpTab());
+			break;
+
+		case 'Format':
+			this.loadTab(this.getFormatTab());
+			break;
+		}
+	},
+
 	getFileTab: function() {
 		var hasRevisionHistory = L.Params.revHistoryEnabled;
 		var hasPrint = !this._map['wopi'].HidePrintOption;
@@ -1802,6 +1823,160 @@ L.Control.NotebookbarImpress = L.Control.NotebookbarWriter.extend({
 				}
 			]
 		};
+	},
+
+	getFormatTab: function() {
+		return {
+			'id': '',
+			'type': 'control',
+			'text': '',
+			'enabled': 'true',
+			'children': [
+				{
+					'id': '',
+					'type': 'container',
+					'text': '',
+					'enabled': 'true',
+					'children': [
+						{
+							'id': 'NotebookBar',
+							'type': 'grid',
+							'text': '',
+							'enabled': 'true',
+							'children': [
+								{
+									'id': 'box',
+									'type': 'container',
+									'text': '',
+									'enabled': 'true',
+									'children': [
+										{
+											'id': 'ContextContainer',
+											'type': 'tabcontrol',
+											'text': '',
+											'enabled': 'true',
+											'selected': '-3',
+											'children': [
+												{
+													'id': '',
+													'type': 'tabpage',
+													'text': '',
+													'enabled': 'true',
+													'children': [
+														{
+															'id': 'Format Tab',
+															'type': 'container',
+															'text': '',
+															'enabled': 'true',
+															'children': [
+																{
+																	'id': 'Format',
+																	'type': 'container',
+																	'text': '',
+																	'enabled': 'true',
+																	'children': [
+																		{
+																			'id': 'Format-Section',
+																			'type': 'container',
+																			'text': '',
+																			'enabled': 'true',
+																			'children': [
+																				{
+																					'id': 'Section1',
+																					'type': 'toolbox',
+																					'text': '',
+																					'enabled': 'true',
+																					'children': [
+																						{
+																							'type': 'bigtoolitem',
+																							'text': _UNO('.uno:FontDialog'),
+																							'command': '.uno:FontDialog'
+																						}
+																					]
+																				},
+																				{
+																					'id': 'Section2',
+																					'type': 'toolbox',
+																					'text': '',
+																					'enabled': 'true',
+																					'children': [
+																						{
+																							'type': 'bigtoolitem',
+																							'text': _UNO('.uno:ParagraphDialog'),
+																							'command': '.uno:ParagraphDialog'
+																						}
+																					]
+																				},
+																				{
+																					'id': 'Section4',
+																					'type': 'toolbox',
+																					'text': '',
+																					'enabled': 'true',
+																					'children': [
+																						{
+																							'type': 'bigtoolitem',
+																							'text': _UNO('.uno:TransformDialog'),
+																							'command': '.uno:TransformDialog'
+																						}
+																					]
+																				},
+																				{
+																					'id': 'Section5',
+																					'type': 'toolbox',
+																					'text': '',
+																					'enabled': 'true',
+																					'children': [
+																						{
+																							'type': 'bigtoolitem',
+																							'text': _UNO('.uno:FormatLine'),
+																							'command': '.uno:FormatLine'
+																						}
+																					]
+																				},
+																				{
+																					'id': 'Section6',
+																					'type': 'toolbox',
+																					'text': '',
+																					'enabled': 'true',
+																					'children': [
+																						{
+																							'type': 'bigtoolitem',
+																							'text': _UNO('.uno:FormatArea'),
+																							'command': '.uno:FormatArea'
+																						}
+																					]
+																				},
+																				{
+																					'id': 'Section7',
+																					'type': 'toolbox',
+																					'text': '',
+																					'enabled': 'true',
+																					'children': [
+																						{
+																							'type': 'bigtoolitem',
+																							'text': _UNO('.uno:OutlineBullet'),
+																							'command': '.uno:OutlineBullet'
+																						}
+																					]
+																				},
+																			]
+																		}
+																	]
+																}
+															]
+														}
+													]
+												}
+											]
+										}
+									]
+								}
+							]
+						}
+					]
+				}
+			]
+		};
 	}
 });
 
diff --git a/loleaflet/src/control/Control.NotebookbarWriter.js b/loleaflet/src/control/Control.NotebookbarWriter.js
index f46e0a08b..4bd748a97 100644
--- a/loleaflet/src/control/Control.NotebookbarWriter.js
+++ b/loleaflet/src/control/Control.NotebookbarWriter.js
@@ -39,6 +39,11 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
 				'id': '6',
 				'name': 'ReviewLabel'
 			},
+			{
+				'text': _('Format'),
+				'id': '-3',
+				'name': 'Format',
+			},
 			{
 				'text': _('~Table'),
 				'id': '8',
@@ -68,6 +73,10 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
 		case 'Help':
 			this.loadTab(this.getHelpTab());
 			break;
+
+		case 'Format':
+			this.loadTab(this.getFormatTab());
+			break;
 		}
 	},
 
@@ -1913,6 +1922,160 @@ L.Control.NotebookbarWriter = L.Control.Notebookbar.extend({
 				}
 			]
 		};
+	},
+
+	getFormatTab: function() {
+		return {
+			'id': '',
+			'type': 'control',
+			'text': '',
+			'enabled': 'true',
+			'children': [
+				{
+					'id': '',
+					'type': 'container',
+					'text': '',
+					'enabled': 'true',
+					'children': [
+						{
+							'id': 'NotebookBar',
+							'type': 'grid',
+							'text': '',
+							'enabled': 'true',
+							'children': [
+								{
+									'id': 'box',
+									'type': 'container',
+									'text': '',
+									'enabled': 'true',
+									'children': [
+										{
+											'id': 'ContextContainer',
+											'type': 'tabcontrol',
+											'text': '',
+											'enabled': 'true',
+											'selected': '-3',
+											'children': [
+												{
+													'id': '',
+													'type': 'tabpage',
+													'text': '',
+													'enabled': 'true',
+													'children': [
+														{
+															'id': 'Format Tab',
+															'type': 'container',
+															'text': '',
+															'enabled': 'true',
+															'children': [
+																{
+																	'id': 'Format',
+																	'type': 'container',
+																	'text': '',
+																	'enabled': 'true',
+																	'children': [
+																		{
+																			'id': 'Format-Section',
+																			'type': 'container',
+																			'text': '',
+																			'enabled': 'true',
+																			'children': [
+																				{
+																					'id': 'Section1',
+																					'type': 'toolbox',
+																					'text': '',
+																					'enabled': 'true',
+																					'children': [
+																						{
+																							'type': 'bigtoolitem',
+																							'text': _UNO('.uno:FontDialog'),
+																							'command': '.uno:FontDialog'
+																						}
+																					]
+																				},
+																				{
+																					'id': 'Section2',
+																					'type': 'toolbox',
+																					'text': '',
+																					'enabled': 'true',
+																					'children': [
+																						{
+																							'type': 'bigtoolitem',
+																							'text': _UNO('.uno:ParagraphDialog'),
+																							'command': '.uno:ParagraphDialog'
+																						}
+																					]
+																				},
+																				{
+																					'id': 'Section4',
+																					'type': 'toolbox',
+																					'text': '',
+																					'enabled': 'true',
+																					'children': [
+																						{
+																							'type': 'bigtoolitem',
+																							'text': _UNO('.uno:TransformDialog'),
+																							'command': '.uno:TransformDialog'
+																						}
+																					]
+																				},
+																				{
+																					'id': 'Section5',
+																					'type': 'toolbox',
+																					'text': '',
+																					'enabled': 'true',
+																					'children': [
+																						{
+																							'type': 'bigtoolitem',
+																							'text': _UNO('.uno:FormatLine'),
+																							'command': '.uno:FormatLine'
+																						}
+																					]
+																				},
+																				{
+																					'id': 'Section6',
+																					'type': 'toolbox',
+																					'text': '',
+																					'enabled': 'true',
+																					'children': [
+																						{
+																							'type': 'bigtoolitem',
+																							'text': _UNO('.uno:FormatArea'),
+																							'command': '.uno:FormatArea'
+																						}
+																					]
+																				},
+																				{
+																					'id': 'Section7',
+																					'type': 'toolbox',
+																					'text': '',
+																					'enabled': 'true',
+																					'children': [
+																						{
+																							'type': 'bigtoolitem',
+																							'text': _UNO('.uno:OutlineBullet'),
+																							'command': '.uno:OutlineBullet'
+																						}
+																					]
+																				},
+																			]
+																		}
+																	]
+																}
+															]
+														}
+													]
+												}
+											]
+										}
+									]
+								}
+							]
+						}
+					]
+				}
+			]
+		};
 	}
 });
 


More information about the Libreoffice-commits mailing list