Le 11/11/2015 00:53, Uwe Stöhr a écrit :
Am 04.11.2015 um 10:42 schrieb Jean-Marc Lasgouttes:

This is not how contextual menus are supposed to work IMO. I would
propose instead to use submenus and to micmick what libreoffice (for
ex.) does.

I agree that submenus are better than to remove things.
Attached is a patch. OK to go in?

Hello Uwe,


I think this is a great idea.

I tried your patch, but it does not apply with "git apply". Did you use "git diff" to produce the diff?

Then I applied it by hand. I like it but here are some minor comments:

* I would order the menu differently, by grouping cell commands on the
  one hand and row/column/table commands on the other hand.

* Since it is not in a submenu, the labels have to be reworded to be
  clearer

* Running with the option LANG=C shows various shortcut conflicts.

Please have a look at the attached patch that takes all this into account.

P.S.: it might be good to disable "inset-modify tabular multi(column|row)" when a single cell is selected and the cell is not a multi-column or a multi-row. This is for consistency: if multiple cells are selected on the same row, then "inset-modify tabular multirow" is disabled.




---------

Besides this, in general it is not good to use personal preferences as
argument. (I make this mistake too.) We provide a product that should
not only suit our needs but the needs of as many as possible average
users out there.

Agreed. Some things in interface design are not a matter of taste.



Guillaume
diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc
index 630892c..a62abda 100644
--- a/lib/ui/stdcontext.inc
+++ b/lib/ui/stdcontext.inc
@@ -405,15 +405,14 @@ Menuset
 # InsetTabular context menu
 #
 
-	Menu "context-tabular"
-		Item "Multicolumn|u" "inset-modify tabular multicolumn"
-		Item "Multirow|w" "inset-modify tabular multirow"
-		Separator
+	Menu "table-lines"
 		Item "Top Line|n" "inset-modify tabular toggle-line-top"
 		Item "Bottom Line|i" "inset-modify tabular toggle-line-bottom"
 		Item "Left Line|L" "inset-modify tabular toggle-line-left"
 		Item "Right Line|R" "inset-modify tabular toggle-line-right"
-		Separator
+	End
+
+	Menu "table-alignment"
 		Item "Left|f" "command-alternatives inset-modify tabular m-align-left;inset-modify tabular align-left"
 		Item "Center|C" "command-alternatives inset-modify tabular m-align-center;inset-modify tabular align-center"
 		Item "Right|h" "command-alternatives inset-modify tabular m-align-right;inset-modify tabular align-right"
@@ -422,6 +421,9 @@ Menuset
 		Item "Top|T" "inset-modify tabular valign-top"
 		Item "Middle|M" "inset-modify tabular valign-middle"
 		Item "Bottom|B" "inset-modify tabular valign-bottom"
+	End
+
+	Menu "table-cols-rows"
 		Separator
 		Item "Append Row|A" "inset-modify tabular append-row"
 		Item "Delete Row|D" "inset-modify tabular delete-row"
@@ -434,6 +436,20 @@ Menuset
 		Item "Copy Column|y" "inset-modify tabular copy-column"
 		Item "Move Column Right|v" "inset-modify tabular move-column-right"
 		Item "Move Column Left" "inset-modify tabular move-column-left"
+	End
+
+	Menu "context-tabular"
+		Separator
+		# Cell menu
+		Submenu "Cell Borders|d" "table-lines"
+		Submenu "Cell Alignment|i" "table-alignment"
+		Item "Multicolumn Cell|u" "inset-modify tabular multicolumn"
+		Item "Multirow Cell|w" "inset-modify tabular multirow"
+		Separator
+		# Table menu
+		Submenu "Columns/Rows|C" "table-cols-rows"
+		Item "Formal Table|r" "inset-modify tabular set-booktabs"
+		Item "Long Table|g" "inset-modify tabular set-longtabular"
 		Separator
 		Item "Settings...|S" "inset-settings tabular"
 	End

Reply via email to