From 8f80b0f09010f537040e26c17bfad5a5852a875d Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sat, 9 Mar 2013 17:55:41 +0000 Subject: Migrate calligraphic-profile-rename.* to Gtk::Grid (bzr r12187) --- src/ui/dialog/calligraphic-profile-rename.cpp | 35 +++++++++++++++++++-------- src/ui/dialog/calligraphic-profile-rename.h | 22 +++++++++++++++-- 2 files changed, 45 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/ui/dialog/calligraphic-profile-rename.cpp b/src/ui/dialog/calligraphic-profile-rename.cpp index da43763c8..9ae22db2d 100644 --- a/src/ui/dialog/calligraphic-profile-rename.cpp +++ b/src/ui/dialog/calligraphic-profile-rename.cpp @@ -13,14 +13,16 @@ * Released under GNU GPL. Read the file 'COPYING' for more information */ -#ifdef HAVE_CONFIG_H -# include -#endif - #include "calligraphic-profile-rename.h" #include #include +#if WITH_GTKMM_3_0 +# include +#else +# include +#endif + #include "desktop.h" namespace Inkscape { @@ -28,29 +30,42 @@ namespace UI { namespace Dialog { CalligraphicProfileRename::CalligraphicProfileRename() : +#if WITH_GTKMM_3_0 + _layout_table(Gtk::manage(new Gtk::Grid())), +#else + _layout_table(Gtk::manage(new Gtk::Table(1, 2))), +#endif _applied(false) { set_title(_("Edit profile")); #if WITH_GTKMM_3_0 Gtk::Box *mainVBox = get_content_area(); + _layout_table->set_column_spacing(4); + _layout_table->set_row_spacing(4); #else Gtk::Box *mainVBox = get_vbox(); + _layout_table->set_spacings(4); #endif - _layout_table.set_spacings(4); - _layout_table.resize (1, 2); - _profile_name_entry.set_activates_default(true); _profile_name_label.set_label(_("Profile name:")); _profile_name_label.set_alignment(1.0, 0.5); - _layout_table.attach(_profile_name_label, +#if WITH_GTKMM_3_0 + _layout_table->attach(_profile_name_label, 0, 0, 1, 1); + + _profile_name_entry.set_hexpand(); + _layout_table->attach(_profile_name_entry, 1, 0, 1, 1); +#else + _layout_table->attach(_profile_name_label, 0, 1, 0, 1, Gtk::FILL, Gtk::FILL); - _layout_table.attach(_profile_name_entry, + _layout_table->attach(_profile_name_entry, 1, 2, 0, 1, Gtk::FILL | Gtk::EXPAND, Gtk::FILL); - mainVBox->pack_start(_layout_table, false, false, 4); +#endif + + mainVBox->pack_start(*_layout_table, false, false, 4); // Buttons _close_button.set_use_stock(true); _close_button.set_label(Gtk::Stock::CANCEL.id); diff --git a/src/ui/dialog/calligraphic-profile-rename.h b/src/ui/dialog/calligraphic-profile-rename.h index 8fe82d7bb..4ef71900b 100644 --- a/src/ui/dialog/calligraphic-profile-rename.h +++ b/src/ui/dialog/calligraphic-profile-rename.h @@ -11,10 +11,22 @@ #ifndef INKSCAPE_DIALOG_CALLIGRAPHIC_PROFILE_H #define INKSCAPE_DIALOG_CALLIGRAPHIC_PROFILE_H +#if HAVE_CONFIG_H +# include "config.h" +#endif + #include #include #include -#include + +namespace Gtk { +#if WITH_GTKMM_3_0 +class Grid; +#else +class Table; +#endif +} + class SPDesktop; namespace Inkscape { @@ -47,7 +59,13 @@ protected: Gtk::Label _profile_name_label; Gtk::Entry _profile_name_entry; - Gtk::Table _layout_table; + +#if WITH_GTKMM_3_0 + Gtk::Grid* _layout_table; +#else + Gtk::Table* _layout_table; +#endif + Gtk::Button _close_button; Gtk::Button _delete_button; Gtk::Button _apply_button; -- cgit v1.2.3