>>>>> "Edwin" == Edwin Leuven <[EMAIL PROTECTED]> writes:

>> The buttons should be disabled if necessary (e.g valign in
>> non-fixed width)

Edwin> see attached

>> I need "toggle-longtable", "toggle-rotate-cell" and
>> "toggle-rotate-tabular" instead of (additional to)
>> "[set/unset]-rotate-cell" etc.

Edwin> I guess these could be added to insettabular. In fact couldn't
Edwin> we just replace "[set/unset]-rotate-cell" with
Edwin> "toggle-rotate-cell" etc?

Or have rotate-cell that can either take no arg (toggle) or arg 0 or
arg 1 (set).

Edwin> Perhaps we could put them in default.ui:

Edwin> - Icon "tabular-feature toggle-line-left" 
Edwin> + Icon "Set left border" "tabular-feature toggle-line-left"

Actually, I think we should try to make the toolbar and menu syntax
converge (and later merge the codes of the backends) and use
  Item "Set left border" "tabular-feature toggle-line-left"

Let's see the patch now. I ahve to say it is much simpler than I would
have thought. I think however that it can be made more general with
little effort.

+
+    # The Tabular Toolbar
+
+    Tabular
+    Icon "tabular-feature append-column"
+    Icon "tabular-feature delete-column"

I'd rather see (like for menus)
  Toobar "tabular"
    Icon ...

Therefore one can define whatever custom toolbar.

+       } else if (f.action == LFUN_TABULAR_FEATURE && !f.argument.empty()) {
+               string xpm_name = "tabular/" + subst(f.argument, ' ','_');
+               fullname = LibFileSearch("images", xpm_name, "xpm");

This is certainly not necessary if the icons are named
tabular-feature_toggle-line-left.xpm or something like that. If you
really want to use subdirs (do you?), one could imagine to generalize
the existing code (and move it to toolbar backend) to search in 
tabular-feature/toggle-line-left.xpm.

+       
+       if (tabletoolbar_) {
+               if (owner_->getLyXFunc().getStatus(LFUN_LAYOUT_TABULAR).disabled()) {
+                       tabletoolbar_->hide();
+               } else {
+                       tabletoolbar_->show();
+               }
+       }

Here you could have a rule saying: if _all_ the elements of a toolbar
are disabled, then I hide it. This means that you need _no_ special
knowledge about the existence of a tabular toolbar. Then (like in
klyx, I think) each toolbar could have status on/off/auto to say
whether one wants it to disappear automatically.

+       QToolBar * tabletoolbar_;
+       

This would not be necessary is the frontend has a list of named
toolbars.

With the change I describe, I think that the math toolbar could be
added only by editing the default.ui file.

JMarc

Reply via email to