+2002-07-13 John Levon <moz@compsoc.man.ac.uk>
+
+ * QtView.C: add a status bar
+
+ * Toolbar_pimpl.C: minor fixes
+
+ * lyx_gui.C: implement hexname()
+
2002-07-12 John Levon <moz@compsoc.man.ac.uk>
* lyx_gui.C: move init_graphics() to parse_init()
#include <qapplication.h>
#include <qpixmap.h>
#include <qmenubar.h>
+#include <qstatusbar.h>
using std::endl;
toolbar_.reset(new Toolbar(this, *getDialogs(), 0, 0, toolbardefaults));
toolbar_->set(true);
+ statusBar()->setSizeGripEnabled(false);
+
minibuffer_.reset(new QMiniBuffer(this));
bufferview_.reset(new BufferView(this, 0, 0, width, height));
namespace {
-string const getPixmap(int action)
+QPixmap getIconPixmap(int action)
{
string arg;
string xpm_name;
if (!fullname.empty()) {
lyxerr[Debug::GUI] << "Full icon name is `"
<< fullname << "'" << endl;
- return fullname;
+ return QPixmap(fullname.c_str());
}
-#if 0 // FIXME
if (act == LFUN_INSERT_MATH && !arg.empty()) {
- char const ** pixmap = get_pixmap_from_symbol(arg.c_str(),
- buttonwidth,
- height);
+#if 0 // FIXME: GUII
+ char const ** pixmap =
+ get_pixmap_from_symbol(arg.c_str(), 30, 30);
if (pixmap) {
lyxerr[Debug::GUI] << "Using mathed-provided icon"
<< endl;
- fl_set_pixmapbutton_data(obj,
- const_cast<char **>(pixmap));
- return;
+ return QPixmap(pixmap);
}
- }
#endif
+ }
lyxerr << "Unable to find icon `" << xpm_name << "'" << endl;
fullname = LibFileSearch("images", "unknown", "xpm");
lyxerr[Debug::GUI] << "Using default `unknown' icon"
<< endl;
}
- return fullname;
+ return QPixmap(fullname.c_str());
}
} // namespace anon
proxy_.get(), SLOT(layout_selected(const QString &)));
break;
}
- default:
+ default: {
+ char const * tooltip = _(lyxaction.helpText(action)).c_str();
+
QToolButton * tb =
- new QToolButton(QPixmap(getPixmap(action).c_str()),
- "FIXME", "FIXME",
+ new QToolButton(getIconPixmap(action),
+ tooltip, tooltip,
proxy_.get(), SLOT(button_selected()), toolbars_.back());
map_[tb] = action;
- QToolTip::add(tb, _(lyxaction.helpText(action)).c_str());
+ QToolTip::add(tb, tooltip);
break;
}
+ }
}