summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/document-properties.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2007-12-29 00:42:07 +0000
committerjohanengelen <johanengelen@users.sourceforge.net>2007-12-29 00:42:07 +0000
commitaf2096422176525fa2f4e1f4cf5942bcf51a9a20 (patch)
treef6b7ebbc0a28ecd473f0b9eeeca64575ec103cbc /src/ui/dialog/document-properties.cpp
parentFix snapping when constrained scaling: now snaps all corners of the selection (diff)
downloadinkscape-af2096422176525fa2f4e1f4cf5942bcf51a9a20.tar.gz
inkscape-af2096422176525fa2f4e1f4cf5942bcf51a9a20.zip
Add icons to document properties grid table :-)
(bzr r4329)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
-rw-r--r--src/ui/dialog/document-properties.cpp36
1 files changed, 34 insertions, 2 deletions
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