From 0785d52b2bbcd2481ee5e6f3f847029ad7887548 Mon Sep 17 00:00:00 2001 From: John Levon Date: Sat, 13 Jul 2002 01:42:15 +0000 Subject: [PATCH] minor changes git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4629 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 8 ++++++++ src/frontends/qt2/QtView.C | 3 +++ src/frontends/qt2/TODO | 7 +++---- src/frontends/qt2/Toolbar_pimpl.C | 30 +++++++++++++++--------------- src/frontends/qt2/lyx_gui.C | 4 ++-- 5 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 02d9e89896..a70019723e 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,11 @@ +2002-07-13 John Levon + + * QtView.C: add a status bar + + * Toolbar_pimpl.C: minor fixes + + * lyx_gui.C: implement hexname() + 2002-07-12 John Levon * lyx_gui.C: move init_graphics() to parse_init() diff --git a/src/frontends/qt2/QtView.C b/src/frontends/qt2/QtView.C index d0828906cd..3073605bbc 100644 --- a/src/frontends/qt2/QtView.C +++ b/src/frontends/qt2/QtView.C @@ -34,6 +34,7 @@ #include #include #include +#include using std::endl; @@ -57,6 +58,8 @@ QtView::QtView(unsigned int width, unsigned int height) 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)); diff --git a/src/frontends/qt2/TODO b/src/frontends/qt2/TODO index fc4da0d2db..90b18a071c 100644 --- a/src/frontends/qt2/TODO +++ b/src/frontends/qt2/TODO @@ -136,10 +136,9 @@ QtView - add autosave timeout -Toolbar_pimpl (variously maybe *) +Toolbar_pimpl - - mathed symbols - - openLayoutList() (?) + - mathed symbols (*) + - openLayoutList() (remove ?) - ::set() ??? - push() ?? - - tooltips diff --git a/src/frontends/qt2/Toolbar_pimpl.C b/src/frontends/qt2/Toolbar_pimpl.C index 9635bff6de..fdc7858f7d 100644 --- a/src/frontends/qt2/Toolbar_pimpl.C +++ b/src/frontends/qt2/Toolbar_pimpl.C @@ -43,7 +43,7 @@ extern LyXAction lyxaction; namespace { -string const getPixmap(int action) +QPixmap getIconPixmap(int action) { string arg; string xpm_name; @@ -60,23 +60,20 @@ string const getPixmap(int action) 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(pixmap)); - return; + return QPixmap(pixmap); } - } #endif + } lyxerr << "Unable to find icon `" << xpm_name << "'" << endl; fullname = LibFileSearch("images", "unknown", "xpm"); @@ -84,7 +81,7 @@ string const getPixmap(int action) lyxerr[Debug::GUI] << "Using default `unknown' icon" << endl; } - return fullname; + return QPixmap(fullname.c_str()); } } // namespace anon @@ -255,17 +252,20 @@ void Toolbar::Pimpl::add(int action, bool) 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; } + } } diff --git a/src/frontends/qt2/lyx_gui.C b/src/frontends/qt2/lyx_gui.C index 5ca81241cc..9ca60f1c7e 100644 --- a/src/frontends/qt2/lyx_gui.C +++ b/src/frontends/qt2/lyx_gui.C @@ -121,8 +121,8 @@ void lyx_gui::start(string const & batch, vector files) string const lyx_gui::hexname(LColor::color col) { - // FIXME - return ""; + QColor color(lcolor.getX11Name(col).c_str()); + return color.name().latin1(); } -- 2.39.5