Fix bug 3508:

* src/ToolbarBackend.cpp:
* lib/ui/stdtoolbars.inc:
	- add tooltip to table widget
* src/frontends/qt4/QLToolbar.cpp:
	- display tooltip as icon text

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18208 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jürgen Spitzmüller 2007-05-06 07:26:51 +00:00
parent fabf9f5af3
commit 574b28db65
3 changed files with 8 additions and 4 deletions

View File

@ -30,7 +30,7 @@
# #
# Minibuffer adds the command buffer (Qt only, only one may exist) # Minibuffer adds the command buffer (Qt only, only one may exist)
# #
# TableInsert adds a special widget for quick insertion of tables # TableInsert "The tooltip" adds a special widget for quick insertion of tables
# #
# PopupMenu "name" "GUI Name" # PopupMenu "name" "GUI Name"
# #
@ -74,7 +74,7 @@ ToolbarSet
Separator Separator
Item "Insert math" "math-mode" Item "Insert math" "math-mode"
Item "Insert graphics" "dialog-show-new-inset graphics" Item "Insert graphics" "dialog-show-new-inset graphics"
TableInsert TableInsert "Insert table"
End End
Toolbar "extra" "Extra" Toolbar "extra" "Extra"

View File

@ -181,8 +181,11 @@ ToolbarInfo & ToolbarInfo::read(Lexer & lex)
break; break;
case TO_TABLEINSERT: case TO_TABLEINSERT:
add(ToolbarItem(ToolbarItem::TABLEINSERT, if (lex.next(true)) {
FuncRequest(kb_action(ToolbarItem::TABLEINSERT)))); docstring const tooltip = lex.getDocString();
add(ToolbarItem(ToolbarItem::TABLEINSERT,
FuncRequest(kb_action(ToolbarItem::TABLEINSERT)), tooltip));
}
break; break;
case TO_ENDTOOLBAR: case TO_ENDTOOLBAR:

View File

@ -197,6 +197,7 @@ void QLToolbar::add(ToolbarItem const & item)
tb->setIcon(QPixmap(toqstr(getIcon(FuncRequest(LFUN_TABULAR_INSERT))))); tb->setIcon(QPixmap(toqstr(getIcon(FuncRequest(LFUN_TABULAR_INSERT)))));
tb->setToolTip(qt_(to_ascii(item.label_))); tb->setToolTip(qt_(to_ascii(item.label_)));
tb->setStatusTip(qt_(to_ascii(item.label_))); tb->setStatusTip(qt_(to_ascii(item.label_)));
tb->setText(qt_(to_ascii(item.label_)));
InsertTableWidget * iv = new InsertTableWidget(owner_, tb); InsertTableWidget * iv = new InsertTableWidget(owner_, tb);
connect(tb, SIGNAL(clicked(bool)), iv, SLOT(show(bool))); connect(tb, SIGNAL(clicked(bool)), iv, SLOT(show(bool)));
connect(iv, SIGNAL(visible(bool)), tb, SLOT(setChecked(bool))); connect(iv, SIGNAL(visible(bool)), tb, SLOT(setChecked(bool)));