From bfefc7952041d62c31d6b01f10adde58c0c5dfed Mon Sep 17 00:00:00 2001 From: John Levon Date: Thu, 29 Aug 2002 06:00:29 +0000 Subject: [PATCH] Look for mathed xpms. Doesn't do anything yet due to lack of workable XPMs git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5152 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 5 +++++ src/frontends/qt2/TODO | 4 ++-- src/frontends/qt2/Toolbar_pimpl.C | 26 +++++++++----------------- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index a97e3f2c47..b697fff579 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2002-08-29 John Levon + + * Toolbar_pimpl.C: math xpm handling in preparation + for some fixed XPMs + 2002-08-29 John Levon * QCommandBuffer.h: diff --git a/src/frontends/qt2/TODO b/src/frontends/qt2/TODO index 10a84c3f83..ae46ec8fbd 100644 --- a/src/frontends/qt2/TODO +++ b/src/frontends/qt2/TODO @@ -19,7 +19,7 @@ QAbout QCommandBuffer - - finish off, use listview etc. + - finish off QContentPane @@ -79,4 +79,4 @@ QtView Toolbar_pimpl - - mathed symbols (*) + - get some decent mathed XPMs diff --git a/src/frontends/qt2/Toolbar_pimpl.C b/src/frontends/qt2/Toolbar_pimpl.C index b7e824fb43..062c24d712 100644 --- a/src/frontends/qt2/Toolbar_pimpl.C +++ b/src/frontends/qt2/Toolbar_pimpl.C @@ -44,13 +44,17 @@ QPixmap getIconPixmap(int action) { FuncRequest f = lyxaction.retrieveActionArg(action); - string const name = lyxaction.getActionName(f.action); string xpm_name; - if (!f.argument.empty()) - xpm_name = subst(name + ' ' + f.argument, ' ','_'); - else - xpm_name = name; + if (f.action == LFUN_INSERT_MATH && !f.argument.empty()) { + xpm_name = "math/" + subst(f.argument, ' ', '_'); + } else { + string const name = lyxaction.getActionName(f.action); + if (!f.argument.empty()) + xpm_name = subst(name + ' ' + f.argument, ' ','_'); + else + xpm_name = name; + } string fullname = LibFileSearch("images", xpm_name, "xpm"); @@ -60,18 +64,6 @@ QPixmap getIconPixmap(int action) return QPixmap(fullname.c_str()); } - if (f.action == LFUN_INSERT_MATH && !f.argument.empty()) { -#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; - return QPixmap(pixmap); - } -#endif - } - lyxerr << "Unable to find icon `" << xpm_name << "'" << endl; fullname = LibFileSearch("images", "unknown", "xpm"); if (!fullname.empty()) { -- 2.39.5