]> git.lyx.org Git - features.git/commitdiff
remove setPixmap and use the backend instead
authorJohn Levon <levon@movementarian.org>
Tue, 8 Apr 2003 19:35:02 +0000 (19:35 +0000)
committerJohn Levon <levon@movementarian.org>
Tue, 8 Apr 2003 19:35:02 +0000 (19:35 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6739 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/xforms/ChangeLog
src/frontends/xforms/Toolbar_pimpl.C

index f44356e8f2c97c3a71a4fc02301834208c23fb92..2288297e57284f3f487b217fe8cf4f5ba2cfac9b 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-08  John Levon  <levon@movementarian.org>
+
+       * Toolbar_pimpl.C: remove setPixmap, use the backend
+       instead.
+
 2003-04-08  John Levon  <levon@movementarian.org>
 
        * Toolbar_pimpl.C: handle tooltip
index 6126f53117eb5afb2d347fc2e37dd4754e017b30..8ae85cb9c02c4fcf46b98b74cce31cf99bf32d47 100644 (file)
@@ -263,41 +263,6 @@ void C_Toolbar_ToolbarCB(FL_OBJECT * ob, long data)
 
 }
 
-
-void setPixmap(FL_OBJECT * obj, int action)
-{
-       string xpm_name;
-       FuncRequest ev = lyxaction.retrieveActionArg(action);
-
-       string const name = lyxaction.getActionName(ev.action);
-       if (!ev.argument.empty())
-               xpm_name = subst(name + ' ' + ev.argument, ' ','_');
-       else
-               xpm_name = name;
-
-       string fullname = LibFileSearch("images", xpm_name, "xpm");
-
-       if (ev.action == LFUN_INSERT_MATH && !ev.argument.empty()) {
-               string arg = ev.argument.substr(1);
-               fullname = LibFileSearch("images/math/", arg, "xpm");
-       }
-
-       if (!fullname.empty()) {
-               lyxerr[Debug::GUI] << "Full icon name is `"
-                                  << fullname << '\'' << endl;
-               fl_set_pixmapbutton_file(obj, fullname.c_str());
-               return;
-       }
-
-       lyxerr << "Unable to find icon `" << xpm_name << '\'' << endl;
-       fullname = LibFileSearch("images", "unknown", "xpm");
-       if (!fullname.empty()) {
-               lyxerr[Debug::GUI] << "Using default `unknown' icon"
-                                  << endl;
-               fl_set_pixmapbutton_file(obj, fullname.c_str());
-       }
-}
-
 } // namespace anon
 
 
@@ -353,7 +318,9 @@ void Toolbar::Pimpl::add(int action, string const & tooltip)
                // The view that this object belongs to.
                obj->u_vdata = owner_;
 
-               setPixmap(obj, action);
+               string const xpm = toolbarbackend.getIcon(action);
+               fl_set_pixmapbutton_file(obj, xpm.c_str());
+
                // we must remember to update the positions
                xpos += buttonwidth;
                // ypos is constant