summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorJabier Arraiza Cenoz <jabier.arraiza@marker.es>2012-12-21 08:35:32 +0000
committerJabiertxo Arraiza Cenoz <jtx@jtx.marker.es>2012-12-21 08:35:32 +0000
commit39309b4a709fad3beed6f02f7ce0289020835efd (patch)
tree0ecc19c6309bfa70f30f075a46d87774040cfb8a /src/ui/widget
parentnot working (diff)
parentfix crasher (diff)
downloadinkscape-39309b4a709fad3beed6f02f7ce0289020835efd.tar.gz
inkscape-39309b4a709fad3beed6f02f7ce0289020835efd.zip
not working, merge from branch
(bzr r11950.1.4)
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/page-sizer.cpp52
-rw-r--r--src/ui/widget/page-sizer.h24
-rw-r--r--src/ui/widget/panel.cpp6
-rw-r--r--src/ui/widget/panel.h16
4 files changed, 95 insertions, 3 deletions
diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp
index 2ab72d6c7..fa3f8e3a1 100644
--- a/src/ui/widget/page-sizer.cpp
+++ b/src/ui/widget/page-sizer.cpp
@@ -330,14 +330,36 @@ PageSizer::PageSizer(Registry & _wr)
pack_start (_customFrame, false, false, 0);
_customFrame.add(_customDimTable);
- _customDimTable.resize(3, 2);
_customDimTable.set_border_width(4);
+
+#if WITH_GTKMM_3_0
+ _customDimTable.set_row_spacing(4);
+ _customDimTable.set_column_spacing(4);
+
+ _dimensionWidth.set_hexpand();
+ _dimensionWidth.set_vexpand();
+ _customDimTable.attach(_dimensionWidth, 0, 0, 1, 1);
+
+ _dimensionUnits.set_hexpand();
+ _dimensionUnits.set_vexpand();
+ _customDimTable.attach(_dimensionUnits, 1, 0, 1, 1);
+
+ _dimensionHeight.set_hexpand();
+ _dimensionHeight.set_vexpand();
+ _customDimTable.attach(_dimensionHeight, 0, 1, 1, 1);
+
+ _fitPageMarginExpander.set_hexpand();
+ _fitPageMarginExpander.set_vexpand();
+ _customDimTable.attach(_fitPageMarginExpander, 0, 2, 2, 1);
+#else
+ _customDimTable.resize(3, 2);
_customDimTable.set_row_spacings(4);
_customDimTable.set_col_spacings(4);
_customDimTable.attach(_dimensionWidth, 0,1, 0,1);
_customDimTable.attach(_dimensionUnits, 1,2, 0,1);
_customDimTable.attach(_dimensionHeight, 0,1, 1,2);
_customDimTable.attach(_fitPageMarginExpander, 0,2, 2,3);
+#endif
_dimTabOrderGList = NULL;
_dimTabOrderGList = g_list_append(_dimTabOrderGList, _dimensionWidth.gobj());
@@ -353,7 +375,32 @@ PageSizer::PageSizer(Registry & _wr)
_fitPageMarginExpander.add(_marginTable);
//## Set up margin settings
- _marginTable.resize(4, 2);
+ _marginTable.set_border_width(4);
+
+#if WITH_GTKMM_3_0
+ _marginTable.set_row_spacing(4);
+ _marginTable.set_column_spacing(4);
+
+ _marginTopAlign.set_hexpand();
+ _marginTopAlign.set_vexpand();
+ _marginTable.attach(_marginTopAlign, 0, 0, 2, 1);
+
+ _marginLeftAlign.set_hexpand();
+ _marginLeftAlign.set_vexpand();
+ _marginTable.attach(_marginLeftAlign, 0, 1, 1, 1);
+
+ _marginRightAlign.set_hexpand();
+ _marginRightAlign.set_vexpand();
+ _marginTable.attach(_marginRightAlign, 1, 1, 1, 1);
+
+ _marginBottomAlign.set_hexpand();
+ _marginBottomAlign.set_vexpand();
+ _marginTable.attach(_marginBottomAlign, 0, 2, 2, 1);
+
+ _fitPageButtonAlign.set_hexpand();
+ _fitPageButtonAlign.set_vexpand();
+ _marginTable.attach(_fitPageButtonAlign, 0, 3, 2, 1);
+#else
_marginTable.set_border_width(4);
_marginTable.set_row_spacings(4);
_marginTable.set_col_spacings(4);
@@ -362,6 +409,7 @@ PageSizer::PageSizer(Registry & _wr)
_marginTable.attach(_marginRightAlign, 1,2, 1,2);
_marginTable.attach(_marginBottomAlign, 0,2, 2,3);
_marginTable.attach(_fitPageButtonAlign, 0,2, 3,4);
+#endif
_marginTopAlign.set(0.5, 0.5, 0.0, 1.0);
_marginTopAlign.add(_marginTop);
diff --git a/src/ui/widget/page-sizer.h b/src/ui/widget/page-sizer.h
index 17fd7b1ea..d1fbb56e0 100644
--- a/src/ui/widget/page-sizer.h
+++ b/src/ui/widget/page-sizer.h
@@ -10,6 +10,10 @@
#ifndef INKSCAPE_UI_WIDGET_PAGE_SIZER_H
#define INKSCAPE_UI_WIDGET_PAGE_SIZER_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <stddef.h>
#include "ui/widget/registered-widget.h"
#include <sigc++/sigc++.h>
@@ -21,7 +25,13 @@
#include <gtkmm/frame.h>
#include <gtkmm/liststore.h>
#include <gtkmm/scrolledwindow.h>
-#include <gtkmm/table.h>
+
+#if WITH_GTKMM_3_0
+# include <gtkmm/grid.h>
+#else
+# include <gtkmm/table.h>
+#endif
+
#include <gtkmm/radiobutton.h>
namespace Inkscape {
@@ -207,7 +217,13 @@ protected:
//### Custom size frame
Gtk::Frame _customFrame;
+
+#if WITH_GTKMM_3_0
+ Gtk::Grid _customDimTable;
+#else
Gtk::Table _customDimTable;
+#endif
+
RegisteredUnitMenu _dimensionUnits;
RegisteredScalarUnit _dimensionWidth;
RegisteredScalarUnit _dimensionHeight;
@@ -215,7 +231,13 @@ protected:
//### Fit Page options
Gtk::Expander _fitPageMarginExpander;
+
+#if WITH_GTKMM_3_0
+ Gtk::Grid _marginTable;
+#else
Gtk::Table _marginTable;
+#endif
+
Gtk::Alignment _marginTopAlign;
Gtk::Alignment _marginLeftAlign;
Gtk::Alignment _marginRightAlign;
diff --git a/src/ui/widget/panel.cpp b/src/ui/widget/panel.cpp
index dcf5956bf..48749fda2 100644
--- a/src/ui/widget/panel.cpp
+++ b/src/ui/widget/panel.cpp
@@ -591,7 +591,13 @@ void Panel::_addResponseButton(Gtk::Button *button, int response_id, bool pack_s
{
// Create a button box for the response buttons if it's the first button to be added
if (!_action_area) {
+#if WITH_GTKMM_3_0
+ _action_area = new Gtk::ButtonBox();
+ _action_area->set_layout(Gtk::BUTTONBOX_END);
+ _action_area->set_spacing(6);
+#else
_action_area = new Gtk::HButtonBox(Gtk::BUTTONBOX_END, 6);
+#endif
_action_area->set_border_width(4);
pack_end(*_action_area, Gtk::PACK_SHRINK, 0);
}
diff --git a/src/ui/widget/panel.h b/src/ui/widget/panel.h
index b4cc04809..5bb054577 100644
--- a/src/ui/widget/panel.h
+++ b/src/ui/widget/panel.h
@@ -13,6 +13,10 @@
#ifndef SEEN_INKSCAPE_UI_WIDGET_PANEL_H
#define SEEN_INKSCAPE_UI_WIDGET_PANEL_H
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
#include <gtkmm/box.h>
#include <gtkmm/arrow.h>
#include <gtkmm/button.h>
@@ -27,7 +31,13 @@ class SPDocument;
namespace Gtk {
class CheckMenuItem;
+
+#if WITH_GTKMM_3_0
+ class ButtonBox;
+#else
class HButtonBox;
+#endif
+
class MenuItem;
}
@@ -157,7 +167,13 @@ private:
Gtk::EventBox _menu_popper;
Gtk::Button _close_button;
Gtk::Menu *_menu;
+
+#if WITH_GTKMM_3_0
+ Gtk::ButtonBox *_action_area; //< stores response buttons
+#else
Gtk::HButtonBox *_action_area; //< stores response buttons
+#endif
+
std::vector<Gtk::Widget *> _non_horizontal;
std::vector<Gtk::Widget *> _non_vertical;
PreviewFillable *_fillable;