diff options
| author | Alex Valavanis <valavanisalex@gmail.com> | 2012-12-16 11:57:38 +0000 |
|---|---|---|
| committer | Alex Valavanis <valavanisalex@gmail.com> | 2012-12-16 11:57:38 +0000 |
| commit | d2fbb90171b5e595c2258d3f44645d2d109e869d (patch) | |
| tree | 17ab8c3ae8bb8479b3c2799166a8c5449682ccec | |
| parent | Extensions. Fix for Bug #1089814 (INX: hidden parameter inside a notebook pag... (diff) | |
| download | inkscape-d2fbb90171b5e595c2258d3f44645d2d109e869d.tar.gz inkscape-d2fbb90171b5e595c2258d3f44645d2d109e869d.zip | |
Migrate PageSizer to Gtk::Grid
(bzr r11957)
| -rw-r--r-- | src/ui/widget/page-sizer.cpp | 52 | ||||
| -rw-r--r-- | src/ui/widget/page-sizer.h | 24 |
2 files changed, 73 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; |
