diff options
| author | Jabier Arraiza Cenoz <jabier.arraiza@marker.es> | 2013-03-10 20:36:05 +0000 |
|---|---|---|
| committer | Jabiertxo Arraiza Zenotz <jtx@jtx.marker.es> | 2013-03-10 20:36:05 +0000 |
| commit | 8db86f8405ff74e590566bfd552d1c23f00bdf5b (patch) | |
| tree | 2913da86831eb11925cdc4d978982507dfe8e751 /src/ui/dialog | |
| parent | Add pencil BSpline mode (diff) | |
| parent | Migrate Object Properties dialog to Gtk::Grid (diff) | |
| download | inkscape-8db86f8405ff74e590566bfd552d1c23f00bdf5b.tar.gz inkscape-8db86f8405ff74e590566bfd552d1c23f00bdf5b.zip | |
Merge from trunk
(bzr r11950.1.50)
Diffstat (limited to 'src/ui/dialog')
| -rw-r--r-- | src/ui/dialog/aboutbox.cpp | 9 | ||||
| -rw-r--r-- | src/ui/dialog/calligraphic-profile-rename.cpp | 38 | ||||
| -rw-r--r-- | src/ui/dialog/calligraphic-profile-rename.h | 22 | ||||
| -rw-r--r-- | src/ui/dialog/debug.cpp | 4 | ||||
| -rw-r--r-- | src/ui/dialog/export.h | 1 | ||||
| -rw-r--r-- | src/ui/dialog/filter-effects-dialog.cpp | 19 | ||||
| -rw-r--r-- | src/ui/dialog/floating-behavior.cpp | 8 | ||||
| -rw-r--r-- | src/ui/dialog/guides.cpp | 17 | ||||
| -rw-r--r-- | src/ui/dialog/inkscape-preferences.cpp | 14 | ||||
| -rw-r--r-- | src/ui/dialog/layer-properties.cpp | 4 | ||||
| -rw-r--r-- | src/ui/dialog/livepatheffect-add.cpp | 5 | ||||
| -rw-r--r-- | src/ui/dialog/object-attributes.cpp | 11 | ||||
| -rw-r--r-- | src/ui/dialog/object-attributes.h | 5 | ||||
| -rw-r--r-- | src/ui/dialog/object-properties.cpp | 157 | ||||
| -rw-r--r-- | src/ui/dialog/object-properties.h | 23 | ||||
| -rw-r--r-- | src/ui/dialog/svg-fonts-dialog.cpp | 21 | ||||
| -rw-r--r-- | src/ui/dialog/svg-fonts-dialog.h | 16 | ||||
| -rw-r--r-- | src/ui/dialog/swatches.cpp | 3 |
18 files changed, 299 insertions, 78 deletions
diff --git a/src/ui/dialog/aboutbox.cpp b/src/ui/dialog/aboutbox.cpp index 0c0027c15..d4928d25d 100644 --- a/src/ui/dialog/aboutbox.cpp +++ b/src/ui/dialog/aboutbox.cpp @@ -97,7 +97,12 @@ AboutBox::AboutBox() : Gtk::Dialog(_("About Inkscape")) { tabs->append_page(*manage( make_scrolled_text(license_text)), _("_License"), true); +#if WITH_GTKMM_3_0 + get_content_area()->pack_end(*manage(tabs), true, true); +#else get_vbox()->pack_end(*manage(tabs), true, true); +#endif + tabs->show_all(); add_button(Gtk::Stock::CLOSE, Gtk::RESPONSE_CLOSE); @@ -114,7 +119,11 @@ AboutBox::AboutBox() : Gtk::Dialog(_("About Inkscape")) { label->set_selectable(true); label->show(); +#if WITH_GTKMM_3_0 + get_content_area()->pack_start(*manage(label), false, false); +#else get_vbox()->pack_start(*manage(label), false, false); +#endif Gtk::Requisition requisition; #if GTK_CHECK_VERSION(3,0,0) diff --git a/src/ui/dialog/calligraphic-profile-rename.cpp b/src/ui/dialog/calligraphic-profile-rename.cpp index 77a4f4f03..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 <config.h> -#endif - #include "calligraphic-profile-rename.h" #include <glibmm/i18n.h> #include <gtkmm/stock.h> +#if WITH_GTKMM_3_0 +# include <gtkmm/grid.h> +#else +# include <gtkmm/table.h> +#endif + #include "desktop.h" namespace Inkscape { @@ -28,24 +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); - _layout_table.resize (1, 2); + _layout_table->set_spacings(4); +#endif _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 <gtkmm/dialog.h> #include <gtkmm/entry.h> #include <gtkmm/label.h> -#include <gtkmm/table.h> + +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; diff --git a/src/ui/dialog/debug.cpp b/src/ui/dialog/debug.cpp index 429ed57bf..e61f8e389 100644 --- a/src/ui/dialog/debug.cpp +++ b/src/ui/dialog/debug.cpp @@ -69,7 +69,11 @@ DebugDialogImpl::DebugDialogImpl() set_title(_("Messages")); set_size_request(300, 400); +#if WITH_GTKMM_3_0 + Gtk::Box *mainVBox = get_content_area(); +#else Gtk::Box *mainVBox = get_vbox(); +#endif //## Add a menu for clear() Gtk::MenuItem* item = Gtk::manage(new Gtk::MenuItem(_("_File"), true)); diff --git a/src/ui/dialog/export.h b/src/ui/dialog/export.h index c8376cdcb..c5782fabc 100644 --- a/src/ui/dialog/export.h +++ b/src/ui/dialog/export.h @@ -24,7 +24,6 @@ #include "ui/widget/panel.h" #include "ui/widget/button.h" #include "ui/widget/entry.h" -#include "widgets/sp-attribute-widget.h" namespace Inkscape { namespace UI { diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index fd368ed9f..989c40264 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -313,9 +313,15 @@ public: set_tooltip_text(tip_text); } +#if WITH_GTKMM_3_0 + Gdk::RGBA col; + col.set_rgba_u(65535, 65535, 65535); + set_rgba(col); +#else Gdk::Color col; col.set_rgb(65535, 65535, 65535); set_color(col); +#endif } // Returns the color in 'rgb(r,g,b)' form. @@ -323,8 +329,14 @@ public: { // no doubles here, so we can use the standard string stream. std::ostringstream os; + +#if WITH_GTKMM_3_0 + const Gdk::RGBA c = get_rgba(); + const int r = c.get_red_u() / 257, g = c.get_green_u() / 257, b = c.get_blue_u() / 257;//TO-DO: verify this. This sounds a lot strange! shouldn't it be 256? +#else const Gdk::Color c = get_color(); const int r = c.get_red() / 257, g = c.get_green() / 257, b = c.get_blue() / 257;//TO-DO: verify this. This sounds a lot strange! shouldn't it be 256? +#endif os << "rgb(" << r << "," << g << "," << b << ")"; return os.str(); } @@ -340,9 +352,16 @@ public: i = (guint32) get_default()->as_uint(); } const int r = SP_RGBA32_R_U(i), g = SP_RGBA32_G_U(i), b = SP_RGBA32_B_U(i); + +#if WITH_GTKMM_3_0 + Gdk::RGBA col; + col.set_rgba_u(r * 256, g * 256, b * 256); + set_rgba(col); +#else Gdk::Color col; col.set_rgb(r * 256, g * 256, b * 256); set_color(col); +#endif } }; diff --git a/src/ui/dialog/floating-behavior.cpp b/src/ui/dialog/floating-behavior.cpp index eab5f9d8f..d70c5f187 100644 --- a/src/ui/dialog/floating-behavior.cpp +++ b/src/ui/dialog/floating-behavior.cpp @@ -135,7 +135,13 @@ FloatingBehavior::create(Dialog &dialog) inline FloatingBehavior::operator Gtk::Widget &() { return *_d; } inline GtkWidget *FloatingBehavior::gobj() { return GTK_WIDGET(_d->gobj()); } -inline Gtk::Box* FloatingBehavior::get_vbox() { return _d->get_vbox(); } +inline Gtk::Box* FloatingBehavior::get_vbox() { +#if WITH_GTKMM_3_0 + return _d->get_content_area(); +#else + return _d->get_vbox(); +#endif +} inline void FloatingBehavior::present() { _d->present(); } inline void FloatingBehavior::hide() { _d->hide(); } inline void FloatingBehavior::show() { _d->show(); } diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp index d8bbb5539..51bbc7d9a 100644 --- a/src/ui/dialog/guides.cpp +++ b/src/ui/dialog/guides.cpp @@ -70,9 +70,15 @@ void GuidelinePropertiesDialog::showDialog(SPGuide *guide, SPDesktop *desktop) { void GuidelinePropertiesDialog::_colorChanged() { +#if WITH_GTKMM_3_0 + const Gdk::RGBA c = _color.get_rgba(); + unsigned r = c.get_red_u()/257, g = c.get_green_u()/257, b = c.get_blue_u()/257; +#else const Gdk::Color c = _color.get_color(); unsigned r = c.get_red()/257, g = c.get_green()/257, b = c.get_blue()/257; +#endif //TODO: why 257? verify this! + sp_guide_set_color(*_guide, r, g, b, true); } @@ -166,12 +172,12 @@ void GuidelinePropertiesDialog::_setup() { add_button(Gtk::Stock::DELETE, -12); add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - Gtk::Box *mainVBox = get_vbox(); - #if WITH_GTKMM_3_0 + Gtk::Box *mainVBox = get_content_area(); _layout_table.set_row_spacing(4); _layout_table.set_column_spacing(4); #else + Gtk::Box *mainVBox = get_vbox(); _layout_table.set_spacings(4); _layout_table.resize (3, 4); #endif @@ -328,9 +334,16 @@ void GuidelinePropertiesDialog::_setup() { // init name entry _label_entry.getEntry()->set_text(_guide->label ? _guide->label : ""); + +#if WITH_GTKMM_3_0 + Gdk::RGBA c; + c.set_rgba(((_guide->color>>24)&0xff) / 255.0, ((_guide->color>>16)&0xff) / 255.0, ((_guide->color>>8)&0xff) / 255.0); + _color.set_rgba(c); +#else Gdk::Color c; c.set_rgb_p(((_guide->color>>24)&0xff) / 255.0, ((_guide->color>>16)&0xff) / 255.0, ((_guide->color>>8)&0xff) / 255.0); _color.set_color(c); +#endif _modeChanged(); // sets values of spinboxes. diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp index c63b78c70..fb814e066 100644 --- a/src/ui/dialog/inkscape-preferences.cpp +++ b/src/ui/dialog/inkscape-preferences.cpp @@ -799,10 +799,17 @@ static void proofComboChanged( Gtk::ComboBoxText* combo ) } static void gamutColorChanged( Gtk::ColorButton* btn ) { +#if WITH_GTKMM_3_0 + Gdk::RGBA rgba = btn->get_rgba(); + gushort r = rgba.get_red_u(); + gushort g = rgba.get_green_u(); + gushort b = rgba.get_blue_u(); +#else Gdk::Color color = btn->get_color(); gushort r = color.get_red(); gushort g = color.get_green(); gushort b = color.get_blue(); +#endif gchar* tmp = g_strdup_printf("#%02x%02x%02x", (r >> 8), (g >> 8), (b >> 8) ); @@ -967,8 +974,15 @@ void InkscapePreferences::initPageIO() _("Highlights colors that are out of gamut for the target device"), false); Glib::ustring colorStr = prefs->getString("/options/softproof/gamutcolor"); + +#if WITH_GTKMM_3_0 + Gdk::RGBA tmpColor( colorStr.empty() ? "#00ff00" : colorStr); + _cms_gamutcolor.set_rgba( tmpColor ); +#else Gdk::Color tmpColor( colorStr.empty() ? "#00ff00" : colorStr); _cms_gamutcolor.set_color( tmpColor ); +#endif + _page_cms.add_line( true, _("Out of gamut warning color:"), _cms_gamutcolor, "", _("Selects the color used for out of gamut warning"), false); diff --git a/src/ui/dialog/layer-properties.cpp b/src/ui/dialog/layer-properties.cpp index 6a1bc829e..3feed2afe 100644 --- a/src/ui/dialog/layer-properties.cpp +++ b/src/ui/dialog/layer-properties.cpp @@ -40,12 +40,12 @@ namespace Dialogs { LayerPropertiesDialog::LayerPropertiesDialog() : _strategy(NULL), _desktop(NULL), _layer(NULL), _position_visible(false) { - Gtk::Box *mainVBox = get_vbox(); - #if WITH_GTKMM_3_0 + Gtk::Box *mainVBox = get_content_area(); _layout_table.set_row_spacing(4); _layout_table.set_column_spacing(4); #else + Gtk::Box *mainVBox = get_vbox(); _layout_table.set_spacings(4); _layout_table.resize (1, 2); #endif diff --git a/src/ui/dialog/livepatheffect-add.cpp b/src/ui/dialog/livepatheffect-add.cpp index e899dbcfc..b5f51d81d 100644 --- a/src/ui/dialog/livepatheffect-add.cpp +++ b/src/ui/dialog/livepatheffect-add.cpp @@ -73,7 +73,12 @@ LivePathEffectAdd::LivePathEffectAdd() : add_button.set_use_underline(true); add_button.set_can_default(); +#if WITH_GTKMM_3_0 + Gtk::Box *mainVBox = get_content_area(); +#else Gtk::Box *mainVBox = get_vbox(); +#endif + mainVBox->pack_start(scrolled_window, true, true); add_action_widget(close_button, Gtk::RESPONSE_CLOSE); add_action_widget(add_button, Gtk::RESPONSE_APPLY); diff --git a/src/ui/dialog/object-attributes.cpp b/src/ui/dialog/object-attributes.cpp index 1ae9730d5..3d780fa83 100644 --- a/src/ui/dialog/object-attributes.cpp +++ b/src/ui/dialog/object-attributes.cpp @@ -30,6 +30,7 @@ #include "xml/repr.h" #include "ui/dialog/dialog-manager.h" #include "ui/dialog/object-attributes.h" +#include "widgets/sp-attribute-widget.h" #include "inkscape.h" #include "selection.h" @@ -81,14 +82,14 @@ ObjectAttributes::ObjectAttributes (void) : UI::Widget::Panel ("", "/dialogs/objectattr/", SP_VERB_DIALOG_ATTR), blocked (false), CurrentItem(NULL), - attrTable(), + attrTable(Gtk::manage(new SPAttributeTable())), desktop(NULL), deskTrack(), selectChangedConn(), subselChangedConn(), selectModifiedConn() { - attrTable.show(); + attrTable->show(); widget_setup(); desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &ObjectAttributes::setTargetDesktop) ); @@ -163,12 +164,12 @@ void ObjectAttributes::widget_setup (void) attrs.push_back (desc[len].attribute); len += 1; } - attrTable.set_object(obj, labels, attrs, (GtkWidget*)gobj()); + attrTable->set_object(obj, labels, attrs, (GtkWidget*)gobj()); CurrentItem = item; } else { - attrTable.change_object(obj); + attrTable->change_object(obj); } set_sensitive (true); @@ -201,7 +202,7 @@ void ObjectAttributes::selectionModifiedCB( guint flags ) if (flags & ( SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_PARENT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG) ) { - attrTable.reread_properties(); + attrTable->reread_properties(); } } diff --git a/src/ui/dialog/object-attributes.h b/src/ui/dialog/object-attributes.h index 81467dea6..b0d02a0af 100644 --- a/src/ui/dialog/object-attributes.h +++ b/src/ui/dialog/object-attributes.h @@ -28,7 +28,8 @@ #include "desktop.h" #include "ui/dialog/desktop-tracker.h" #include "ui/widget/panel.h" -#include "widgets/sp-attribute-widget.h" + +class SPAttributeTable; namespace Inkscape { namespace UI { @@ -72,7 +73,7 @@ private: * in the SPAttrDesc arrays at the top of the cpp-file. This widgets also * ensures object attribute modifications by the user are set. */ - SPAttributeTable attrTable; + SPAttributeTable *attrTable; /** * Stores the current desktop. diff --git a/src/ui/dialog/object-properties.cpp b/src/ui/dialog/object-properties.cpp index 0800346f7..114204961 100644 --- a/src/ui/dialog/object-properties.cpp +++ b/src/ui/dialog/object-properties.cpp @@ -26,11 +26,8 @@ * Abhishek Sharma */ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - #include "object-properties.h" +#include "widgets/sp-attribute-widget.h" #include "../../desktop-handles.h" #include "../../document.h" #include "../../document-undo.h" @@ -50,19 +47,27 @@ ObjectProperties::ObjectProperties (void) : UI::Widget::Panel ("", "/dialogs/object/", SP_VERB_DIALOG_ITEM), blocked (false), CurrentItem(NULL), - TopTable (3, 4, false), +#if WITH_GTKMM_3_0 + TopTable(Gtk::manage(new Gtk::Grid())), +#else + TopTable(Gtk::manage(new Gtk::Table(3, 4))), +#endif LabelID(_("_ID:"), 1), LabelLabel(_("_Label:"), 1), LabelTitle(_("_Title:"),1), LabelDescription(_("_Description:"),1), FrameDescription("", FALSE), HBoxCheck(FALSE, 0), - CheckTable(1, 2, TRUE), +#if WITH_GTKMM_3_0 + CheckTable(Gtk::manage(new Gtk::Grid())), +#else + CheckTable(Gtk::manage(new Gtk::Table(1, 2, true))), +#endif CBHide(_("_Hide"), 1), CBLock(_("L_ock"), 1), BSet (_("_Set"), 1), LabelInteractivity(_("_Interactivity"), 1), - attrTable(), + attrTable(Gtk::manage(new SPAttributeTable())), desktop(NULL), deskTrack(), selectChangedConn(), @@ -91,6 +96,11 @@ ObjectProperties::ObjectProperties (void) : desktopChangeConn = deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &ObjectProperties::setTargetDesktop) ); deskTrack.connect(GTK_WIDGET(gobj())); + +#if WITH_GTKMM_3_0 + CheckTable->set_row_homogeneous(); + CheckTable->set_column_homogeneous(true); +#endif MakeWidget(); } @@ -108,24 +118,44 @@ void ObjectProperties::MakeWidget(void) Gtk::Box *contents = _getContents(); contents->set_spacing(0); - TopTable.set_border_width(4); - TopTable.set_row_spacings(4); - TopTable.set_col_spacings(0); - contents->pack_start (TopTable, false, false, 0); + TopTable->set_border_width(4); + +#if WITH_GTKMM_3_0 + TopTable->set_row_spacing(4); + TopTable->set_column_spacing(0); +#else + TopTable->set_row_spacings(4); + TopTable->set_col_spacings(0); +#endif + + contents->pack_start (*TopTable, false, false, 0); /* Create the label for the object id */ LabelID.set_label (LabelID.get_label() + " "); LabelID.set_alignment (1, 0.5); - TopTable.attach (LabelID, 0, 1, 0, 1, - Gtk::SHRINK | Gtk::FILL, - Gtk::AttachOptions(), 0, 0 ); + +#if WITH_GTKMM_3_0 + LabelID.set_valign(Gtk::ALIGN_CENTER); + TopTable->attach(LabelID, 0, 0, 1, 1); +#else + TopTable->attach(LabelID, 0, 1, 0, 1, + Gtk::SHRINK | Gtk::FILL, + Gtk::AttachOptions(), 0, 0 ); +#endif /* Create the entry box for the object id */ EntryID.set_tooltip_text (_("The id= attribute (only letters, digits, and the characters .-_: allowed)")); EntryID.set_max_length (64); - TopTable.attach (EntryID, 1, 2, 0, 1, - Gtk::EXPAND | Gtk::FILL, - Gtk::AttachOptions(), 0, 0 ); + +#if WITH_GTKMM_3_0 + EntryID.set_valign(Gtk::ALIGN_CENTER); + TopTable->attach(EntryID, 1, 0, 1, 1); +#else + TopTable->attach(EntryID, 1, 2, 0, 1, + Gtk::EXPAND | Gtk::FILL, + Gtk::AttachOptions(), 0, 0 ); +#endif + LabelID.set_mnemonic_widget (EntryID); // pressing enter in the id field is the same as clicking Set: @@ -136,16 +166,30 @@ void ObjectProperties::MakeWidget(void) /* Create the label for the object label */ LabelLabel.set_label (LabelLabel.get_label() + " "); LabelLabel.set_alignment (1, 0.5); - TopTable.attach (LabelLabel, 0, 1, 1, 2, - Gtk::SHRINK | Gtk::FILL, - Gtk::AttachOptions(), 0, 0 ); + +#if WITH_GTKMM_3_0 + LabelLabel.set_valign(Gtk::ALIGN_CENTER); + TopTable->attach(LabelLabel, 0, 1, 1, 1); +#else + TopTable->attach(LabelLabel, 0, 1, 1, 2, + Gtk::SHRINK | Gtk::FILL, + Gtk::AttachOptions(), 0, 0 ); +#endif /* Create the entry box for the object label */ EntryLabel.set_tooltip_text (_("A freeform label for the object")); EntryLabel.set_max_length (256); - TopTable.attach (EntryLabel, 1, 2, 1, 2, - Gtk::EXPAND | Gtk::FILL, - Gtk::AttachOptions(), 0, 0 ); + +#if WITH_GTKMM_3_0 + EntryLabel.set_hexpand(); + EntryLabel.set_valign(Gtk::ALIGN_CENTER); + TopTable->attach(EntryLabel, 1, 1, 1, 1); +#else + TopTable->attach(EntryLabel, 1, 2, 1, 2, + Gtk::EXPAND | Gtk::FILL, + Gtk::AttachOptions(), 0, 0 ); +#endif + LabelLabel.set_mnemonic_widget (EntryLabel); // pressing enter in the label field is the same as clicking Set: @@ -154,16 +198,30 @@ void ObjectProperties::MakeWidget(void) /* Create the label for the object title */ LabelTitle.set_label (LabelTitle.get_label() + " "); LabelTitle.set_alignment (1, 0.5); - TopTable.attach (LabelTitle, 0, 1, 2, 3, - Gtk::SHRINK | Gtk::FILL, - Gtk::AttachOptions(), 0, 0 ); + +#if WITH_GTKMM_3_0 + LabelTitle.set_valign(Gtk::ALIGN_CENTER); + TopTable->attach(LabelTitle, 0, 2, 1, 1); +#else + TopTable->attach(LabelTitle, 0, 1, 2, 3, + Gtk::SHRINK | Gtk::FILL, + Gtk::AttachOptions(), 0, 0 ); +#endif /* Create the entry box for the object title */ EntryTitle.set_sensitive (FALSE); EntryTitle.set_max_length (256); - TopTable.attach (EntryTitle, 1, 2, 2, 3, - Gtk::EXPAND | Gtk::FILL, - Gtk::AttachOptions(), 0, 0 ); + +#if WITH_GTKMM_3_0 + EntryTitle.set_hexpand(); + EntryTitle.set_valign(Gtk::ALIGN_CENTER); + TopTable->attach(EntryTitle, 1, 2, 1, 1); +#else + TopTable->attach(EntryTitle, 1, 2, 2, 3, + Gtk::EXPAND | Gtk::FILL, + Gtk::AttachOptions(), 0, 0 ); +#endif + LabelTitle.set_mnemonic_widget (EntryTitle); // pressing enter in the label field is the same as clicking Set: EntryTitle.signal_activate().connect(sigc::mem_fun(this, &ObjectProperties::label_changed)); @@ -186,29 +244,52 @@ void ObjectProperties::MakeWidget(void) /* Check boxes */ contents->pack_start (HBoxCheck, FALSE, FALSE, 0); - CheckTable.set_border_width(4); - HBoxCheck.pack_start (CheckTable, TRUE, TRUE, 0); + CheckTable->set_border_width(4); + HBoxCheck.pack_start(*CheckTable, true, true, 0); /* Hide */ CBHide.set_tooltip_text (_("Check to make the object invisible")); - CheckTable.attach (CBHide, 0, 1, 0, 1, + +#if WITH_GTKMM_3_0 + CBHide.set_hexpand(); + CBHide.set_valign(Gtk::ALIGN_CENTER); + CheckTable->attach(CBHide, 0, 0, 1, 1); +#else + CheckTable->attach(CBHide, 0, 1, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(), 0, 0 ); +#endif + CBHide.signal_toggled().connect(sigc::mem_fun(this, &ObjectProperties::hidden_toggled)); /* Lock */ // TRANSLATORS: "Lock" is a verb here CBLock.set_tooltip_text (_("Check to make the object insensitive (not selectable by mouse)")); - CheckTable.attach (CBLock, 1, 2, 0, 1, + +#if WITH_GTKMM_3_0 + CBLock.set_hexpand(); + CBLock.set_valign(Gtk::ALIGN_CENTER); + CheckTable->attach(CBLock, 1, 0, 1, 1); +#else + CheckTable->attach(CBLock, 1, 2, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(), 0, 0 ); +#endif + CBLock.signal_toggled().connect(sigc::mem_fun(this, &ObjectProperties::sensitivity_toggled)); /* Button for setting the object's id, label, title and description. */ - CheckTable.attach (BSet, 2, 3, 0, 1, +#if WITH_GTKMM_3_0 + BSet.set_hexpand(); + BSet.set_valign(Gtk::ALIGN_CENTER); + CheckTable->attach(BSet, 2, 0, 1, 1); +#else + CheckTable->attach(BSet, 2, 3, 0, 1, Gtk::EXPAND | Gtk::FILL, Gtk::AttachOptions(), 0, 0 ); +#endif + BSet.signal_clicked().connect(sigc::mem_fun(this, &ObjectProperties::label_changed)); /* Create the frame for interactivity options */ @@ -237,7 +318,7 @@ void ObjectProperties::widget_setup(void) CurrentItem = NULL; //no selection anymore or multiple objects selected, means that we need //to close the connections to the previously selected object - attrTable.clear(); + attrTable->clear(); return; } else { contents->set_sensitive (true); @@ -301,13 +382,13 @@ void ObjectProperties::widget_setup(void) if (CurrentItem == NULL) { - attrTable.set_object(obj, int_labels, int_attrs, (GtkWidget*)EInteractivity.gobj()); + attrTable->set_object(obj, int_labels, int_attrs, (GtkWidget*)EInteractivity.gobj()); } else { - attrTable.change_object(obj); + attrTable->change_object(obj); } - attrTable.show_all(); + attrTable->show_all(); } CurrentItem = item; blocked = false; diff --git a/src/ui/dialog/object-properties.h b/src/ui/dialog/object-properties.h index a04c62bec..b49293ea1 100644 --- a/src/ui/dialog/object-properties.h +++ b/src/ui/dialog/object-properties.h @@ -29,6 +29,10 @@ #ifndef SEEN_DIALOGS_ITEM_PROPERTIES_H #define SEEN_DIALOGS_ITEM_PROPERTIES_H +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + #include "ui/widget/panel.h" #include "ui/widget/frame.h" #include <gtkmm/entry.h> @@ -37,8 +41,8 @@ #include <gtkmm/textview.h> #include "ui/dialog/desktop-tracker.h" -#include "widgets/sp-attribute-widget.h" +class SPAttributeTable; class SPDesktop; class SPItem; @@ -70,7 +74,12 @@ private: std::vector<Glib::ustring> int_attrs; std::vector<Glib::ustring> int_labels; - Gtk::Table TopTable; //the table with the object properties +#if WITH_GTKMM_3_0 + Gtk::Grid *TopTable; //the table with the object properties +#else + Gtk::Table *TopTable; //the table with the object properties +#endif + Gtk::Label LabelID; //the label for the object ID Gtk::Entry EntryID; //the entry for the object ID Gtk::Label LabelLabel; //the label for the object label @@ -84,14 +93,20 @@ private: Gtk::TextView TextViewDescription; //the text view object showing the object description Gtk::HBox HBoxCheck; // the HBox for the check boxes - Gtk::Table CheckTable; //the table for the check boxes + +#if WITH_GTKMM_3_0 + Gtk::Grid *CheckTable; //the table for the check boxes +#else + Gtk::Table *CheckTable; //the table for the check boxes +#endif + Gtk::CheckButton CBHide; //the check button hide Gtk::CheckButton CBLock; //the check button lock Gtk::Button BSet; //the button set Gtk::Label LabelInteractivity; //the label for interactivity Gtk::Expander EInteractivity; //the label for interactivity - SPAttributeTable attrTable; //the widget for showing the on... names at the bottom + SPAttributeTable *attrTable; //the widget for showing the on... names at the bottom SPDesktop *desktop; DesktopTracker deskTrack; diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index be69635e8..0da39dd73 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -22,6 +22,7 @@ #include "document-undo.h" #include <gtkmm/notebook.h> #include <gtkmm/imagemenuitem.h> +#include <gtkmm/scale.h> #include <gtkmm/stock.h> #include <glibmm/i18n.h> #include <message-stack.h> @@ -191,7 +192,7 @@ void SvgFontsDialog::on_kerning_value_changed(){ //slider values increase from right to left so that they match the kerning pair preview //XML Tree being directly used here while it shouldn't be. - this->kerning_pair->getRepr()->setAttribute("k", Glib::Ascii::dtostr(get_selected_spfont()->horiz_adv_x - kerning_slider.get_value()).c_str()); + this->kerning_pair->getRepr()->setAttribute("k", Glib::Ascii::dtostr(get_selected_spfont()->horiz_adv_x - kerning_slider->get_value()).c_str()); DocumentUndo::maybeDone(document, undokey.c_str(), SP_VERB_DIALOG_SVG_FONTS, _("Adjust kerning value")); //populate_kerning_pairs_box(); @@ -299,7 +300,7 @@ void SvgFontsDialog::on_kerning_pair_selection_changed(){ this->kerning_pair = kern; //slider values increase from right to left so that they match the kerning pair preview - kerning_slider.set_value(get_selected_spfont()->horiz_adv_x - kern->k); + kerning_slider->set_value(get_selected_spfont()->horiz_adv_x - kern->k); } void SvgFontsDialog::update_global_settings_tab(){ @@ -328,9 +329,9 @@ void SvgFontsDialog::on_font_selection_changed(){ double set_width = spfont->horiz_adv_x; setwidth_spin.set_value(set_width); - kerning_slider.set_range(0, set_width); - kerning_slider.set_draw_value(false); - kerning_slider.set_value(0); + kerning_slider->set_range(0, set_width); + kerning_slider->set_draw_value(false); + kerning_slider->set_value(0); update_global_settings_tab(); populate_glyphs_box(); @@ -779,7 +780,7 @@ Gtk::VBox* SvgFontsDialog::kerning_tab(){ add_kernpair_button.set_label(_("Add pair")); add_kernpair_button.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::add_kerning_pair)); _KerningPairsList.get_selection()->signal_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_kerning_pair_selection_changed)); - kerning_slider.signal_value_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_kerning_value_changed)); + kerning_slider->signal_value_changed().connect(sigc::mem_fun(*this, &SvgFontsDialog::on_kerning_value_changed)); kerning_vbox.pack_start(*kerning_selector, false,false); @@ -797,7 +798,7 @@ Gtk::VBox* SvgFontsDialog::kerning_tab(){ Gtk::HBox* kerning_amount_hbox = Gtk::manage(new Gtk::HBox()); kerning_vbox.pack_start(*kerning_amount_hbox, false,false); kerning_amount_hbox->add(*Gtk::manage(new Gtk::Label(_("Kerning value:")))); - kerning_amount_hbox->add(kerning_slider); + kerning_amount_hbox->add(*kerning_slider); kerning_preview.set_size(300 + 20, 150 + 20); _font_da.set_size(150 + 20, 50 + 20); @@ -884,6 +885,12 @@ void SvgFontsDialog::add_font(){ SvgFontsDialog::SvgFontsDialog() : UI::Widget::Panel("", "/dialogs/svgfonts", SP_VERB_DIALOG_SVG_FONTS), _add(Gtk::Stock::NEW) { +#if WITH_GTKMM_3_0 + kerning_slider = Gtk::manage(new Gtk::Scale(Gtk::ORIENTATION_HORIZONTAL)); +#else + kerning_slider = Gtk::manage(new Gtk::HScale); +#endif + _add.signal_clicked().connect(sigc::mem_fun(*this, &SvgFontsDialog::add_font)); Gtk::HBox* hbox = Gtk::manage(new Gtk::HBox()); diff --git a/src/ui/dialog/svg-fonts-dialog.h b/src/ui/dialog/svg-fonts-dialog.h index 910f79d4c..9be984820 100644 --- a/src/ui/dialog/svg-fonts-dialog.h +++ b/src/ui/dialog/svg-fonts-dialog.h @@ -20,13 +20,20 @@ #include <gtkmm/drawingarea.h> #include <gtkmm/entry.h> #include <gtkmm/liststore.h> -#include <gtkmm/scale.h> #include <gtkmm/scrolledwindow.h> #include <gtkmm/treeview.h> #include "attributes.h" #include "xml/helper-observer.h" +namespace Gtk { +#if WITH_GTKMM_3_0 +class Scale; +#else +class HScale; +#endif +} + class SPGlyph; class SPGlyphKerning; class SvgFont; @@ -210,7 +217,12 @@ private: GlyphComboBox first_glyph, second_glyph; SPGlyphKerning* kerning_pair; Inkscape::UI::Widget::SpinButton setwidth_spin; - Gtk::HScale kerning_slider; + +#if WITH_GTKMM_3_0 + Gtk::Scale* kerning_slider; +#else + Gtk::HScale* kerning_slider; +#endif class EntryWidget : public Gtk::HBox { diff --git a/src/ui/dialog/swatches.cpp b/src/ui/dialog/swatches.cpp index 71fee342a..90cb1cdc9 100644 --- a/src/ui/dialog/swatches.cpp +++ b/src/ui/dialog/swatches.cpp @@ -1179,9 +1179,6 @@ void SwatchesPanel::_rebuild() _holder->thawUpdates(); } - - - } //namespace Dialogs } //namespace UI } //namespace Inkscape |
