summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorsu_v <suv-sf@users.sourceforge.net>2013-03-13 21:22:43 +0000
committer~suv <suv-sf@users.sourceforge.net>2013-03-13 21:22:43 +0000
commit5fdab345ed60a124a25aa0efecd36b4307b72681 (patch)
tree9da8eae3a08679edbbb5994b6b2681a2c81b97f1 /src/ui/widget
parentPrevent crashing on windows systems due to locale issues (diff)
parentcppcheck (diff)
downloadinkscape-5fdab345ed60a124a25aa0efecd36b4307b72681.tar.gz
inkscape-5fdab345ed60a124a25aa0efecd36b4307b72681.zip
merge from trunk (r12201)
(bzr r11668.1.57)
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/notebook-page.cpp27
-rw-r--r--src/ui/widget/notebook-page.h26
-rw-r--r--src/ui/widget/style-swatch.cpp52
-rw-r--r--src/ui/widget/style-swatch.h21
4 files changed, 97 insertions, 29 deletions
diff --git a/src/ui/widget/notebook-page.cpp b/src/ui/widget/notebook-page.cpp
index 92bcb6937..6653499b8 100644
--- a/src/ui/widget/notebook-page.cpp
+++ b/src/ui/widget/notebook-page.cpp
@@ -9,22 +9,35 @@
* Released under GNU GPL. Read the file 'COPYING' for more information
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
#include "notebook-page.h"
+#if WITH_GTKMM_3_0
+# include <gtkmm/grid.h>
+#else
+# include <gtkmm/table.h>
+#endif
+
namespace Inkscape {
namespace UI {
namespace Widget {
NotebookPage::NotebookPage(int n_rows, int n_columns, bool expand, bool fill, guint padding)
- :_table(n_rows, n_columns)
+#if WITH_GTKMM_3_0
+ :_table(Gtk::manage(new Gtk::Grid()))
+#else
+ :_table(Gtk::manage(new Gtk::Table(n_rows, n_columns)))
+#endif
{
set_border_width(2);
- _table.set_spacings(2);
- pack_start(_table, expand, fill, padding);
+
+#if WITH_GTKMM_3_0
+ _table->set_row_spacing(2);
+ _table->set_column_spacing(2);
+#else
+ _table->set_spacings(2);
+#endif
+
+ pack_start(*_table, expand, fill, padding);
}
} // namespace Widget
diff --git a/src/ui/widget/notebook-page.h b/src/ui/widget/notebook-page.h
index 140b7cb33..d8b8fb0c4 100644
--- a/src/ui/widget/notebook-page.h
+++ b/src/ui/widget/notebook-page.h
@@ -10,8 +10,19 @@
#ifndef INKSCAPE_UI_WIDGET_NOTEBOOK_PAGE_H
#define INKSCAPE_UI_WIDGET_NOTEBOOK_PAGE_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <gtkmm/box.h>
-#include <gtkmm/table.h>
+
+namespace Gtk {
+#if WITH_GTKMM_3_0
+class Grid;
+#else
+class Table;
+#endif
+}
namespace Inkscape {
namespace UI {
@@ -31,10 +42,19 @@ public:
*/
NotebookPage(int n_rows, int n_columns, bool expand=false, bool fill=false, guint padding=0);
- Gtk::Table& table() { return _table; }
+#if WITH_GTKMM_3_0
+ Gtk::Grid& table() { return *_table; }
+#else
+ Gtk::Table& table() { return *_table; }
+#endif
protected:
- Gtk::Table _table;
+
+#if WITH_GTKMM_3_0
+ Gtk::Grid *_table;
+#else
+ Gtk::Table *_table;
+#endif
};
} // namespace Widget
diff --git a/src/ui/widget/style-swatch.cpp b/src/ui/widget/style-swatch.cpp
index 44bceb826..a89f42575 100644
--- a/src/ui/widget/style-swatch.cpp
+++ b/src/ui/widget/style-swatch.cpp
@@ -11,15 +11,11 @@
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include "style-swatch.h"
#include <cstring>
#include <string>
-#include "style-swatch.h"
-
#include "widgets/spw-utilities.h"
#include "ui/widget/color-preview.h"
@@ -37,6 +33,12 @@
#include "verbs.h"
#include <glibmm/i18n.h>
+#if WITH_GTKMM_3_0
+# include <gtkmm/grid.h>
+#else
+# include <gtkmm/table.h>
+#endif
+
enum {
SS_FILL,
SS_STROKE
@@ -114,7 +116,11 @@ StyleSwatch::StyleSwatch(SPCSSAttr *css, gchar const *main_tip)
_css(NULL),
_tool_obs(NULL),
_style_obs(NULL),
- _table(2, 6),
+#if WITH_GTKMM_3_0
+ _table(Gtk::manage(new Gtk::Grid())),
+#else
+ _table(Gtk::manage(new Gtk::Table(2, 6))),
+#endif
_sw_unit(NULL)
{
_label[SS_FILL].set_markup(_("Fill:"));
@@ -130,23 +136,35 @@ StyleSwatch::StyleSwatch(SPCSSAttr *css, gchar const *main_tip)
_opacity_value.set_alignment(0.0, 0.5);
_opacity_value.set_padding(0, 0);
- _table.set_col_spacings (2);
- _table.set_row_spacings (0);
+#if WITH_GTKMM_3_0
+ _table->set_column_spacing(2);
+ _table->set_row_spacing(0);
+#else
+ _table->set_col_spacings(2);
+ _table->set_row_spacings(0);
+#endif
_stroke.pack_start(_place[SS_STROKE]);
_stroke_width_place.add(_stroke_width);
_stroke.pack_start(_stroke_width_place, Gtk::PACK_SHRINK);
-
- _table.attach(_label[SS_FILL], 0,1, 0,1, Gtk::FILL, Gtk::SHRINK);
- _table.attach(_label[SS_STROKE], 0,1, 1,2, Gtk::FILL, Gtk::SHRINK);
-
- _table.attach(_place[SS_FILL], 1,2, 0,1);
- _table.attach(_stroke, 1,2, 1,2);
-
+
_opacity_place.add(_opacity_value);
- _table.attach(_opacity_place, 2,3, 0,2, Gtk::SHRINK, Gtk::SHRINK);
- _swatch.add(_table);
+#if WITH_GTKMM_3_0
+ _table->attach(_label[SS_FILL], 0, 0, 1, 1);
+ _table->attach(_label[SS_STROKE], 0, 1, 1, 1);
+ _table->attach(_place[SS_FILL], 1, 0, 1, 1);
+ _table->attach(_stroke, 1, 1, 1, 1);
+ _table->attach(_opacity_place, 2, 0, 1, 2);
+#else
+ _table->attach(_label[SS_FILL], 0,1, 0,1, Gtk::FILL, Gtk::SHRINK);
+ _table->attach(_label[SS_STROKE], 0,1, 1,2, Gtk::FILL, Gtk::SHRINK);
+ _table->attach(_place[SS_FILL], 1,2, 0,1);
+ _table->attach(_stroke, 1,2, 1,2);
+ _table->attach(_opacity_place, 2,3, 0,2, Gtk::SHRINK, Gtk::SHRINK);
+#endif
+
+ _swatch.add(*_table);
pack_start(_swatch, true, true, 0);
set_size_request (STYLE_SWATCH_WIDTH, -1);
diff --git a/src/ui/widget/style-swatch.h b/src/ui/widget/style-swatch.h
index 999bbd4ca..7e385e3df 100644
--- a/src/ui/widget/style-swatch.h
+++ b/src/ui/widget/style-swatch.h
@@ -13,8 +13,11 @@
#ifndef INKSCAPE_UI_CURRENT_STYLE_H
#define INKSCAPE_UI_CURRENT_STYLE_H
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <gtkmm/box.h>
-#include <gtkmm/table.h>
#include <gtkmm/label.h>
#include <gtkmm/eventbox.h>
#include <gtkmm/enums.h>
@@ -27,6 +30,14 @@ class SPUnit;
class SPStyle;
class SPCSSAttr;
+namespace Gtk {
+#if WITH_GTKMM_3_0
+class Grid;
+#else
+class Table;
+#endif
+}
+
namespace Inkscape {
namespace UI {
namespace Widget {
@@ -60,7 +71,13 @@ private:
Glib::ustring _tool_path;
Gtk::EventBox _swatch;
- Gtk::Table _table;
+
+#if WITH_GTKMM_3_0
+ Gtk::Grid *_table;
+#else
+ Gtk::Table *_table;
+#endif
+
Gtk::Label _label[2];
Gtk::EventBox _place[2];
Gtk::EventBox _opacity_place;