Re: [patch] RFC: better submenu for tables
Am 17.11.2015 um 09:27 schrieb Jean-Marc Lasgouttes: Done now. I also added the toggles to Edit>Table. many thanks. regards Uwe
Re: [patch] RFC: better submenu for tables
Le 17/11/2015 01:21, Uwe Stöhr a écrit : Am 13.11.2015 um 14:16 schrieb Jean-Marc Lasgouttes: Like the patch below? Yes, exactly, thanks. Please put this in. (and also the update of LFUNs.lyx in our doc folder.) Done now. I also added the toggles to Edit>Table. JMarc
Re: [patch] RFC: better submenu for tables
Am 13.11.2015 um 14:16 schrieb Jean-Marc Lasgouttes: Like the patch below? Yes, exactly, thanks. Please put this in. (and also the update of LFUNs.lyx in our doc folder.) Note that I renamed Dialog Settings to Settings... like everywhere else. OK. > And what should be done with the Edit>Table menu? Shall it directly use the table contextual menu? Yes. many thanks and regards Uwe
Re: [patch] RFC: better submenu for tables
Am Sonntag, 15. November 2015 um 14:30:05, schrieb Jürgen Spitzmüller > Am Sonntag 15 November 2015, 14:10:07 schrieb Kornel Benko: > > Am Sonntag, 15. November 2015 um 13:36:50, schrieb Jürgen Spitzmüller > > > > > Am Freitag 13 November 2015, 13:15:05 schrieb Kornel Benko: > > > > What about multipage table? > > > > > > Yes, why not. > > > > There are 5 strings which would need new wordings: > > 1 "&Use long table" > > 2 "Horizontal alignment of the longtable" > > 3 "Longtable alignment" > > 4 "Breakable Table|g" > > 5 "A spreadsheet made with Gnumeric, LibreOffice, OpenOffice or > > Excel.\n" > > "It imports as a long table, so any length\n" > > "is ok. Excessive width could be a problem.\n" > > "The gnumeric software is necessary for conversion,\n" > > "both for gnumeric and excel files.\n" > > > > May I adapt them? > > Fine with me. > > I think the correct spelling would be "multi-page table". > > Jürgen > Done at 5c79673. Kornel signature.asc Description: This is a digitally signed message part.
Re: [patch] RFC: better submenu for tables
Am Sonntag 15 November 2015, 14:10:07 schrieb Kornel Benko: > Am Sonntag, 15. November 2015 um 13:36:50, schrieb Jürgen Spitzmüller > > > Am Freitag 13 November 2015, 13:15:05 schrieb Kornel Benko: > > > What about multipage table? > > > > Yes, why not. > > There are 5 strings which would need new wordings: > 1 "&Use long table" > 2 "Horizontal alignment of the longtable" > 3 "Longtable alignment" > 4 "Breakable Table|g" > 5 "A spreadsheet made with Gnumeric, LibreOffice, OpenOffice or > Excel.\n" > "It imports as a long table, so any length\n" > "is ok. Excessive width could be a problem.\n" > "The gnumeric software is necessary for conversion,\n" > "both for gnumeric and excel files.\n" > > May I adapt them? Fine with me. I think the correct spelling would be "multi-page table". Jürgen > > Jürgen > > Kornel
Re: [patch] RFC: better submenu for tables
Am Sonntag, 15. November 2015 um 13:36:50, schrieb Jürgen Spitzmüller > Am Freitag 13 November 2015, 13:15:05 schrieb Kornel Benko: > > What about multipage table? > > Yes, why not. There are 5 strings which would need new wordings: 1 "&Use long table" 2 "Horizontal alignment of the longtable" 3 "Longtable alignment" 4 "Breakable Table|g" 5 "A spreadsheet made with Gnumeric, LibreOffice, OpenOffice or Excel.\n" "It imports as a long table, so any length\n" "is ok. Excessive width could be a problem.\n" "The gnumeric software is necessary for conversion,\n" "both for gnumeric and excel files.\n" May I adapt them? > Jürgen Kornel signature.asc Description: This is a digitally signed message part.
Re: [patch] RFC: better submenu for tables
Am Freitag 13 November 2015, 13:15:05 schrieb Kornel Benko: > What about multipage table? Yes, why not. Jürgen
Re: [patch] RFC: better submenu for tables
Le 13/11/2015 14:15, Jean-Marc Lasgouttes a écrit : Le 13/11/2015 00:36, Uwe Stöhr a écrit : I noticed that we don't have an LFUN to toggle the longtable and the booktabs. I therefore added now 2 entries to return to the default settings, despite I would like to have only 2 entries that toggle the feature. Like the patch below? Note that I renamed Dialog Settings to Settings... like everywhere else. Oops. JMarc >From 26a43238014b738f9b4ca7c5df149a8654a7b8b8 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 13 Nov 2015 14:09:04 +0100 Subject: [PATCH] Implement toggling for longtabular and booktabs tabular features This is needed for the tabular context menu. This menu is updated accordingly. --- lib/ui/stdcontext.inc | 15 ++- src/insets/InsetTabular.cpp | 15 +++ src/insets/InsetTabular.h |4 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc index 1b3b618..b5b1673 100644 --- a/lib/ui/stdcontext.inc +++ b/lib/ui/stdcontext.inc @@ -411,7 +411,7 @@ Menuset Item "Left|L" "inset-modify tabular toggle-line-left" Item "Right|R" "inset-modify tabular toggle-line-right" 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" @@ -422,7 +422,7 @@ Menuset Item "Middle" "inset-modify tabular valign-middle" Item "Bottom" "inset-modify tabular valign-bottom" End - + Menu "table-cols-rows" Item "Multicolumn|u" "inset-modify tabular multicolumn" Item "Multirow|w" "inset-modify tabular multirow" @@ -439,19 +439,16 @@ Menuset 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" - Item "Normal Table|g" "inset-modify tabular unset-longtabular" - Item "Breakable Table|g" "inset-modify tabular set-longtabular" - Separator - Item "Default Style|m" "inset-modify tabular unset-booktabs" - Item "Formal Style|m" "inset-modify tabular set-booktabs" + Item "Breakable Table|g" "inset-modify tabular toggle-longtabular" + Item "Formal Style|m" "inset-modify tabular toggle-booktabs" Separator Submenu "Borders|d" "table-borders" Submenu "Alignment|i" "table-alignment" Submenu "Columns/Rows|C" "table-cols-rows" Separator - Item "Settings Dialog...|S" "inset-settings tabular" + Item "Settings...|S" "inset-settings tabular" End # diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index b8b47f7..437ac7e 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -151,6 +151,7 @@ TabularFeature tabularFeature[] = { Tabular::SET_MROFFSET, "set-mroffset", true }, { Tabular::SET_ALL_LINES, "set-all-lines", false }, { Tabular::UNSET_ALL_LINES, "unset-all-lines", false }, + { Tabular::TOGGLE_LONGTABULAR, "toggle-longtabular", false }, { Tabular::SET_LONGTABULAR, "set-longtabular", false }, { Tabular::UNSET_LONGTABULAR, "unset-longtabular", false }, { Tabular::SET_PWIDTH, "set-pwidth", true }, @@ -177,6 +178,7 @@ TabularFeature tabularFeature[] = { Tabular::UNSET_LTCAPTION, "unset-ltcaption", false }, { Tabular::SET_SPECIAL_COLUMN, "set-special-column", true }, { Tabular::SET_SPECIAL_MULTICOLUMN, "set-special-multicolumn", true }, + { Tabular::TOGGLE_BOOKTABS, "toggle-booktabs", false }, { Tabular::SET_BOOKTABS, "set-booktabs", false }, { Tabular::UNSET_BOOKTABS, "unset-booktabs", false }, { Tabular::SET_TOP_SPACE, "set-top-space", true }, @@ -4718,6 +4720,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, break; case Tabular::SET_LONGTABULAR: + case Tabular::TOGGLE_LONGTABULAR: // setting as longtable is not allowed when table is inside a float if (cur.innerInsetOfType(FLOAT_CODE) != 0 || cur.innerInsetOfType(WRAP_CODE) != 0) @@ -4866,6 +4869,7 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd, status.setOnOff(tabular.ltCaption(sel_row_start)); break; + case Tabular::TOGGLE_BOOKTABS: case Tabular::SET_BOOKTABS: status.setOnOff(tabular.use_booktabs); break; @@ -5761,6 +5765,13 @@ void InsetTabular::tabularFeatures(Cursor & cur, } break; + case Tabular::TOGGLE_LONGTABULAR: + if (tabular.is_long_tabular) + tabularFeatures(cur, Tabular::UNSET_LONGTABULAR); + else + tabular.is_long_tabular = true; + break; + case Tabular::SET_LONGTABULAR: tabular.is_long_tabular = true; break; @@ -5929,6 +5940,10 @@ void InsetTabular::tabularFeatures(Cursor & cur, break; } + case Tabular::TOGGLE_BOOKTABS: + tabular.use_booktabs = !tabular.use_booktabs; + break; + case Tabular::SET_BOOKTABS: tabular.use_booktabs = true; break; diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h
Re: [patch] RFC: better submenu for tables
Le 13/11/2015 00:36, Uwe Stöhr a écrit : I noticed that we don't have an LFUN to toggle the longtable and the booktabs. I therefore added now 2 entries to return to the default settings, despite I would like to have only 2 entries that toggle the feature. Like the patch below? Note that I renamed Dialog Settings to Settings... like everywhere else. There are still one shortcut problem: frontends/qt4/Menus.cpp (729): Menu warning: menu entry "Breakable Table" does not contain shortcut `g'. And what should be done with the Edit>Table menu? Shall it directly use the table contextual menu? JMarc
Re: [patch] RFC: better submenu for tables
Le 12/11/2015 21:13, Andrew Parsloe a écrit : I think it is a mistake. I do not see why we should use this unenglish term. (I guess that "unenglish" is itself unenglish :) But "un-English" is in the New Oxford Dictionary of English. So that unenglish is un-Oxford. Thanks, I learn a little bit every day. If I manage to forget slightly less, then some progress is possible. JMarc
Re: [patch] RFC: better submenu for tables
Am Freitag, 13. November 2015 um 09:25:17, schrieb Jürgen Spitzmüller > Am Freitag 13 November 2015, 00:32:58 schrieb Uwe Stöhr: > > I changes it now as suggested by Jürgen and named it breakable table. > > As said, feel free to change this to a better name. > > "Breakable table" sounds odd. > > I opt for "Allow page breaks" or "Allow page breaks in table" if you need to > have the table in it. What about multipage table? > Jürgen Kornel signature.asc Description: This is a digitally signed message part.
Re: [patch] RFC: better submenu for tables
Am Freitag 13 November 2015, 00:32:58 schrieb Uwe Stöhr: > I changes it now as suggested by Jürgen and named it breakable table. > As said, feel free to change this to a better name. "Breakable table" sounds odd. I opt for "Allow page breaks" or "Allow page breaks in table" if you need to have the table in it. Jürgen
Re: [patch] RFC: better submenu for tables
Am 12.11.2015 um 17:14 schrieb Jean-Marc Lasgouttes: Yes, allow page breaks looks nice. But of course this means that our dialog shall be reworked. Do we want to do that for 2.2, or wait until 2.3? I vote for now. It is just a changed string and the translators did not yet start their work. regards Uwe
Re: [patch] RFC: better submenu for tables
Am 12.11.2015 um 17:12 schrieb Jürgen Spitzmüller: Personally, I would prefer something more transparent, such as "Allow page breaks". Nobody without knowledge of the longtable package knows what a "long table" is supposed to be. Good idea! Until we don't have a toggle entry, I named it "breakable table" and "normal table". It would of course be better to have only "Allow page breaks" that toggles the feature. regards Uwe
Re: [patch] RFC: better submenu for tables
Am 12.11.2015 um 16:14 schrieb Jean-Marc Lasgouttes: OTOH, now that I actually tried the menu, I would say that it is not clear to know where table stuff starts. Having "Formal Table" would help. Is it better now? I noticed that we don't have an LFUN to toggle the longtable and the booktabs. I therefore added now 2 entries to return to the default settings, despite I would like to have only 2 entries that toggle the feature. In addition I don't really like that there is a separator between each submenu. Separators are made to groups stuff together. Currently the separators add no information. Definitely. These separators should go. Done. regards Uwe
Re: [patch] RFC: better submenu for tables
Am 12.11.2015 um 15:23 schrieb Jean-Marc Lasgouttes: "Longtable" is used all over theplace in the docs as its own term I would therefore keep it. I think it is a mistake. I do not see why we should use this unenglish term. (I guess that "unenglish" is itself unenglish :) Because non-booktabs tables can also be long tables but are never longtables ;-) So "Longtable" is a proper name. I changes it now as suggested by Jürgen and named it breakable table. As said, feel free to change this to a better name. It should be uniform: either we use a verb for both entries or none. I put it now in without a verb. As Guillaume pointed out, these are actually verbs. We now have "Border" and Alignment" which are no verbs. regards Uwe
Re: [patch] RFC: better submenu for tables
On Thu, Nov 12, 2015 at 01:02:17PM -0500, Richard Heck wrote: > On 11/12/2015 11:12 AM, Jürgen Spitzmüller wrote: > > 2015-11-12 16:14 GMT+01:00 Jean-Marc Lasgouttes: > > Likewise, > > "Longtable" feels like a German word : > > > I think > it is rather a LaTeXism. It is called "longtable" (not "long table") > since package, command and environment names cannot have spaces. > > > Personally, I would prefer something more transparent, such as "Allow > page breaks". Nobody without knowledge of the longtable package knows > what a "long table" is supposed to be. > > +1 That sounds good. If it is not too verbose, it might be nice to have <>. Users often google something about LaTeX and tables and find that they are supposed to use "longtable". Although they don't actually know anything about it, they try to figure out how to use it in LyX. So it might be nice to keep "longtable" for such cases, at the very least in the tooltip. Scott
Re: [patch] RFC: better submenu for tables
On 13/11/2015 3:23 a.m., Jean-Marc Lasgouttes wrote: Le 12/11/2015 01:30, Uwe Stöhr a écrit : +Menu "context-tabular" +Item "Formal style|F" "inset-modify tabular set-booktabs" +Item "Longtable|o" "inset-modify tabular set-longtabular" What about "Formal Table" and "Long Table"? "Longtable" is used all over theplace in the docs as its own term I would therefore keep it. I think it is a mistake. I do not see why we should use this unenglish term. (I guess that "unenglish" is itself unenglish :) JMarc But "un-English" is in the New Oxford Dictionary of English. Andrew --- This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus
Re: [patch] RFC: better submenu for tables
On 11/12/2015 11:12 AM, Jürgen Spitzmüller wrote: > 2015-11-12 16:14 GMT+01:00 Jean-Marc Lasgouttes: > > Likewise, > "Longtable" feels like a German word : > > > I think it is rather a LaTeXism. It is called "longtable" (not "long table") since package, command and environment names cannot have spaces. > > Personally, I would prefer something more transparent, such as "Allow page breaks". Nobody without knowledge of the longtable package knows what a "long table" is supposed to be. +1 Richard
Re: [patch] RFC: better submenu for tables
Le 12/11/2015 17:12, Jürgen Spitzmüller a écrit : 2015-11-12 16:14 GMT+01:00 Jean-Marc Lasgouttes: Likewise, "Longtable" feels like a German word : I think it is rather a LaTeXism. It is called "longtable" (not "long table") since package, command and environment names cannot have spaces. Personally, I would prefer something more transparent, such as "Allow page breaks". Nobody without knowledge of the longtable package knows what a "long table" is supposed to be. Yes, allow page breaks looks nice. But of course this means that our dialog shall be reworked. Do we want to do that for 2.2, or wait until 2.3? JMarc
Re: [patch] RFC: better submenu for tables
2015-11-12 16:14 GMT+01:00 Jean-Marc Lasgouttes: > Likewise, "Longtable" feels like a German word : I think it is rather a LaTeXism. It is called "longtable" (not "long table") since package, command and environment names cannot have spaces. Personally, I would prefer something more transparent, such as "Allow page breaks". Nobody without knowledge of the longtable package knows what a "long table" is supposed to be. Jürgen
Re: [patch] RFC: better submenu for tables
Le 12/11/2015 12:16, Guillaume Munch a écrit : +Menu "context-tabular" +Item "Formal style|F" "inset-modify tabular set-booktabs" +Item "Longtable|o" "inset-modify tabular set-longtabular" What about "Formal Table" and "Long Table"? "Longtable" is used all over theplace in the docs as its own term I would therefore keep it. Ok, I should not have an opinion about this since I'm used to the French translation which corresponds to "long table". Likewise, "Longtable" feels like a German word :) booktabs changes the style of the table. I would promote it as such. I thought this explains more than "Formal table" since the table itself is not changed. Ok, makes sense. But then it's with an uppercase S. OTOH, now that I actually tried the menu, I would say that it is not clear to know where table stuff starts. Having "Formal Table" would help. In addition I don't really like that there is a separator between each submenu. Separators are made to groups stuff together. Currently the separators add no information. Definitely. These separators should go. JMarc
Re: [patch] RFC: better submenu for tables
Le 12/11/2015 01:30, Uwe Stöhr a écrit : +Menu "context-tabular" +Item "Formal style|F" "inset-modify tabular set-booktabs" +Item "Longtable|o" "inset-modify tabular set-longtabular" What about "Formal Table" and "Long Table"? "Longtable" is used all over theplace in the docs as its own term I would therefore keep it. I think it is a mistake. I do not see why we should use this unenglish term. (I guess that "unenglish" is itself unenglish :) booktabs changes the style of the table. I would promote it as such. I thought this explains more than "Formal table" since the table itself is not changed. Feel free to change that. I donot have a string feeling, but "Formal table" is the term used in booktabs documentation. Of course, google thing that this is about being a good guest for dinner %-| I'd prefer a verb like "Toggle Borders" "Align"? It should be uniform: either we use a verb for both entries or none. I put it now in without a verb. As Guillaume pointed out, these are actually verbs. JMarc JMarc
Re: [patch] RFC: better submenu for tables
Le 12/11/2015 00:39, Uwe Stöhr a écrit : Am 11.11.2015 um 13:52 schrieb Guillaume Munch: Yes, I committed now a version which includes your and also JMarc's changes. Thanks again 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. Good idea. Could you please implement this or open a bug/enhancement request because I won't have time the next days. Many thanks. Done at http://www.lyx.org/trac/ticket/9859
Re: [patch] RFC: better submenu for tables
Le 12/11/2015 00:34, Uwe Stöhr a écrit : Am 11.11.2015 um 13:57 schrieb Guillaume Munch: Well multirow and multicolumn is about cells, so I moved it with cells. multirow can be for several cells but also for complete rows. Therefore I don't think it is sensible to have a special cell group. Well of course it's for complete rows when the complete row is selected. But also it's to make *one* cell out of the selection... And when the cell is multicolumn/row, it's a valid *single* cell command to disable multicolumn/row. And it's grouping by cell vs table is better than no grouping at all, I find. Guillaumr
Re: [patch] RFC: better submenu for tables
Le 12/11/2015 00:30, Uwe Stöhr a écrit : Am 11.11.2015 um 13:13 schrieb Jean-Marc Lasgouttes: Many Thanks for reviewing. Since the menu name is about lines, should we just have entry Top/Bottom... Done. What about putting multirow with rows and multicolumns with columns? That#s a matter of taste. For multirow/column one needs to have at least 2 cells highlighted while the other entries affect only one column/row but a complete one. so one could also have multirow/column outside the submenu. I don't have a strong opinion about this, feel free to change this. Yes, I really like it outside of the submenu, and then this gave the opportunity to separate cell commands (including multi*) from table commands. +Menu "context-tabular" +Item "Formal style|F" "inset-modify tabular set-booktabs" +Item "Longtable|o" "inset-modify tabular set-longtabular" What about "Formal Table" and "Long Table"? "Longtable" is used all over theplace in the docs as its own term I would therefore keep it. Ok, I should not have an opinion about this since I'm used to the French translation which corresponds to "long table". booktabs changes the style of the table. I would promote it as such. I thought this explains more than "Formal table" since the table itself is not changed. Ok, makes sense. But then it's with an uppercase S. Feel free to change that. I'd prefer a verb like "Toggle Borders" "Align"? It should be uniform: either we use a verb for both entries or none. I put it now in without a verb. Yes that's the point: both align and toggle are verbs! Keep only one separator Done. In addition I don't really like that there is a separator between each submenu. Separators are made to groups stuff together. Currently the separators add no information. I put it in with some changes from Guillaume since I am most probably off the next days. Thank you! Guillaume
Re: [patch] RFC: better submenu for tables
Am 11.11.2015 um 13:52 schrieb Guillaume Munch: I tried your patch, but it does not apply with "git apply". Did you use "git diff" to produce the diff? Yes, I did use unified diff. git apply works fine here. 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. There are no entries that only affect cells and I would keep it simple. One could discuss the position of multirow as I just wrote. * Running with the option LANG=C shows various shortcut conflicts. They should be fixed now. Please have a look at the attached patch that takes all this into account. Yes, I committed now a version which includes your and also JMarc's changes. 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. Good idea. Could you please implement this or open a bug/enhancement request because I won't have time the next days. Many thanks. regards Uwe
Re: [patch] RFC: better submenu for tables
Am 11.11.2015 um 13:57 schrieb Guillaume Munch: Many thanks for your review. I think that "Border" is clearer than "Line", and ok for just having Top/bottom... Done. Well multirow and multicolumn is about cells, so I moved it with cells. multirow can be for several cells but also for complete rows. Therefore I don't think it is sensible to have a special cell group. +Menu "context-tabular" +Item "Formal style|F" "inset-modify tabular set-booktabs" +Item "Longtable|o" "inset-modify tabular set-longtabular" What about "Formal Table" and "Long Table"? See my previous post I just sent. Here we agree. I also corrected the accelerator conflict. Many thanks, I hope I fixed now all conflicts. Please correct missing bits. I'd prefer a verb like "Toggle Borders" Yes, even better than "Border" I suggested. Done. "Align"? +1 Done. regards Uwe
Re: [patch] RFC: better submenu for tables
Am 11.11.2015 um 13:13 schrieb Jean-Marc Lasgouttes: Many Thanks for reviewing. Since the menu name is about lines, should we just have entry Top/Bottom... Done. What about putting multirow with rows and multicolumns with columns? That#s a matter of taste. For multirow/column one needs to have at least 2 cells highlighted while the other entries affect only one column/row but a complete one. so one could also have multirow/column outside the submenu. I don't have a strong opinion about this, feel free to change this. +Menu "context-tabular" +Item "Formal style|F" "inset-modify tabular set-booktabs" +Item "Longtable|o" "inset-modify tabular set-longtabular" What about "Formal Table" and "Long Table"? "Longtable" is used all over theplace in the docs as its own term I would therefore keep it. booktabs changes the style of the table. I would promote it as such. I thought this explains more than "Formal table" since the table itself is not changed. Feel free to change that. I'd prefer a verb like "Toggle Borders" "Align"? It should be uniform: either we use a verb for both entries or none. I put it now in without a verb. Keep only one separator Done. I put it in with some changes from Guillaume since I am most probably off the next days. regards Uwe
Re: [patch] RFC: better submenu for tables
Le 11/11/2015 12:57, Guillaume Munch a écrit : Le 11/11/2015 12:13, Jean-Marc Lasgouttes a écrit : Le 11/11/2015 01:53, Uwe Stöhr a écrit : I agree that submenus are better than to remove things. Attached is a patch. OK to go in? Thanks, we need something like that. A few comments (...) Here's an adaptation of Uwe's patch that displays my suggestion of grouping cell commands on one side, and table commands on the other, and also takes Jean-Marc's comments into account. diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc index 630892c..1f7f6b9 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 - 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 + Menu "table-lines" + Item "Top|n" "inset-modify tabular toggle-line-top" + Item "Bottom|i" "inset-modify tabular toggle-line-bottom" + Item "Left|L" "inset-modify tabular toggle-line-left" + Item "Right|R" "inset-modify tabular toggle-line-right" + 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 "Toggle Borders|d" "table-lines" + Submenu "Align|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
Re: [patch] RFC: better submenu for tables
Le 11/11/2015 12:13, Jean-Marc Lasgouttes a écrit : Le 11/11/2015 01:53, Uwe Stöhr a écrit : I agree that submenus are better than to remove things. Attached is a patch. OK to go in? Thanks, we need something like that. A few comments: Sorry, our messages crossed each-other. I could not connect to the server for a time. -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" Since the menu name is about lines, should we just have entry Top/Bottom... I think that "Border" is clearer than "Line", and ok for just having Top/bottom... [...] +Menu "table-cols-rows" +Item "Multicolumn|u" "inset-modify tabular multicolumn" +Item "Multirow|w" "inset-modify tabular multirow" Separator Item "Append Row|A" "inset-modify tabular append-row" What about putting multirow with rows and multicolumns with columns? Well multirow and multicolumn is about cells, so I moved it with cells. [...] +Menu "context-tabular" +Item "Formal style|F" "inset-modify tabular set-booktabs" +Item "Longtable|o" "inset-modify tabular set-longtabular" What about "Formal Table" and "Long Table"? Here we agree. I also corrected the accelerator conflict. +Separator +Submenu "Lines|L" "table-lines" I'd prefer a verb like "Toggle Borders" Yes, even better than "Border" I suggested. +Separator +Submenu "Alignment|A" "table-alignment" "Align"? +1 +Separator +Submenu "Columns/Rows|C" "table-cols-rows" +Separator Separator Keep only one separator Item "Settings...|S" "inset-settings tabular" End JMarc Guillaume
Re: [patch] RFC: better submenu for tables
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
Re: [patch] RFC: better submenu for tables
Le 11/11/2015 01:53, Uwe Stöhr a écrit : I agree that submenus are better than to remove things. Attached is a patch. OK to go in? Thanks, we need something like that. A few comments: - 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" Since the menu name is about lines, should we just have entry Top/Bottom... [...] + Menu "table-cols-rows" + Item "Multicolumn|u" "inset-modify tabular multicolumn" + Item "Multirow|w" "inset-modify tabular multirow" Separator Item "Append Row|A" "inset-modify tabular append-row" What about putting multirow with rows and multicolumns with columns? [...] + Menu "context-tabular" + Item "Formal style|F" "inset-modify tabular set-booktabs" + Item "Longtable|o" "inset-modify tabular set-longtabular" What about "Formal Table" and "Long Table"? + Separator + Submenu "Lines|L" "table-lines" I'd prefer a verb like "Toggle Borders" + Separator + Submenu "Alignment|A" "table-alignment" "Align"? + Separator + Submenu "Columns/Rows|C" "table-cols-rows" + Separator Separator Keep only one separator Item "Settings...|S" "inset-settings tabular" End JMarc