From: johanengelen Date: Sat, 29 Dec 2007 00:42:07 +0000 (+0000) Subject: Add icons to document properties grid table :-) X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a81114720875e827edbe587ea8eec7d451ec95c7;p=inkscape.git Add icons to document properties grid table :-) --- diff --git a/share/icons/icons.svg b/share/icons/icons.svg index a528a82a0..184d2a167 100644 --- a/share/icons/icons.svg +++ b/share/icons/icons.svg @@ -17,6 +17,48 @@ inkscape:output_extension="org.inkscape.output.svg.inkscape"> + + + + + + + objecttolerance="11" + inkscape:snap-bbox="true" + inkscape:snap-nodes="true" + inkscape:bbox-nodes="true" + inkscape:bbox-paths="true"> + + + + + + @@ -13380,83 +13450,7 @@ http://www.inkscape.org/ transform="scale(1.125) translate(4,-6.5)" id="g8862"> + + + + + + + + + + + + + + + + + + + + + diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index 5ffe3dcb8..7bbafcea0 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -35,7 +35,7 @@ #include "desktop-handles.h" #include "desktop.h" #include "sp-namedview.h" - +#include "widgets/icon.h" #include "document-properties.h" #include "display/canvas-grid.h" @@ -49,6 +49,10 @@ namespace Dialog { #define SPACE_SIZE_X 15 #define SPACE_SIZE_Y 10 +#define INKSCAPE_ICON_GRID_XY "grid_xy" +#define INKSCAPE_ICON_GRID_AXONOM "grid_axonom" + + //=================================================== //--------------------------------------------------- @@ -407,7 +411,19 @@ DocumentProperties::update_gridspage() for (GSList const * l = nv->grids; l != NULL; l = l->next) { Inkscape::CanvasGrid * grid = (Inkscape::CanvasGrid*) l->data; if (!grid->repr->attribute("id")) continue; // update_gridspage is called again when "id" is added - _grids_notebook.append_page(grid->getWidget(), grid->repr->attribute("id")); + Glib::ustring name(grid->repr->attribute("id")); + const char *icon = NULL; + switch (grid->getGridType()) { + case GRID_RECTANGULAR: + icon = INKSCAPE_ICON_GRID_XY; + break; + case GRID_AXONOMETRIC: + icon = INKSCAPE_ICON_GRID_AXONOM; + break; + default: + break; + } + _grids_notebook.append_page(grid->getWidget(), _createPageTabLabel(name, icon)); grids_present = true; } _grids_notebook.show_all(); @@ -519,6 +535,22 @@ DocumentProperties::update() _wr.setUpdating (false); } +// TODO: copied from fill-and-stroke.cpp factor out into new ui/widget file? +Gtk::HBox& +DocumentProperties::_createPageTabLabel(const Glib::ustring& label, const char *label_image) +{ + Gtk::HBox *_tab_label_box = manage(new Gtk::HBox(false, 0)); + _tab_label_box->set_spacing(4); + _tab_label_box->pack_start(*Glib::wrap(sp_icon_new(Inkscape::ICON_SIZE_DECORATION, + label_image))); + + Gtk::Label *_tab_label = manage(new Gtk::Label(label, true)); + _tab_label_box->pack_start(*_tab_label); + _tab_label_box->show_all(); + + return *_tab_label_box; +} + //-------------------------------------------------------------------- void diff --git a/src/ui/dialog/document-properties.h b/src/ui/dialog/document-properties.h index b4076fbe7..cee1533c5 100644 --- a/src/ui/dialog/document-properties.h +++ b/src/ui/dialog/document-properties.h @@ -99,6 +99,8 @@ protected: gchar const *_prefs_path; Registry _wr; + Gtk::HBox& _createPageTabLabel(const Glib::ustring& label, const char *label_image); + private: DocumentProperties(); virtual ~DocumentProperties();