From cd8cae5bf430285e5dcef81e9b46a43d8f91131b Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Tue, 10 Apr 2012 01:25:07 +0100 Subject: Replace remaining gtk_hbox_new usage (bzr r11204) --- src/widgets/toolbox.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/widgets/toolbox.cpp') diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 38a581cdc..ff9718815 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -3091,7 +3091,12 @@ static void sp_stb_defaults( GtkWidget * /*widget*/, GObject *dataKludge ) // public: void sp_toolbox_add_label(GtkWidget *tbl, gchar const *title, bool wide) { +#if GTK_CHECK_VERSION(3,0,0) + GtkWidget *boxl = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); + gtk_box_set_homogeneous(GTK_BOX(boxl), FALSE); +#else GtkWidget *boxl = gtk_hbox_new(FALSE, 0); +#endif if (wide) { gtk_widget_set_size_request(boxl, MODE_LABEL_WIDTH, -1); } -- cgit v1.2.3 From e30be1920be10cc0d9a79c244c890785c72f37bb Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Tue, 10 Apr 2012 21:21:08 +0100 Subject: Replace deprecated gtk_vbox_new and gtk_widget_size_request (bzr r11213) --- src/widgets/toolbox.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/widgets/toolbox.cpp') diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index ff9718815..aa87fb873 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -1058,14 +1058,24 @@ static GtkWidget* toolboxNewCommon( GtkWidget* tb, BarId id, GtkPositionType han GtkWidget *ToolboxFactory::createToolToolbox() { +#if GTK_CHECK_VERSION(3,0,0) + GtkWidget *tb = gtk_box_new(GTK_ORIENTATION, 0); + gtk_box_new(GTK_BOX(tb), FALSE); +#else GtkWidget *tb = gtk_vbox_new(FALSE, 0); +#endif return toolboxNewCommon( tb, BAR_TOOL, GTK_POS_TOP ); } GtkWidget *ToolboxFactory::createAuxToolbox() { +#if GTK_CHECK_VERSION(3,0,0) + GtkWidget *tb = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); + gtk_box_new(GTK_BOX(tb), FALSE); +#else GtkWidget *tb = gtk_vbox_new(FALSE, 0); +#endif return toolboxNewCommon( tb, BAR_AUX, GTK_POS_LEFT ); } @@ -1076,14 +1086,24 @@ GtkWidget *ToolboxFactory::createAuxToolbox() GtkWidget *ToolboxFactory::createCommandsToolbox() { +#if GTK_CHECK_VERSION(3,0,0) + GtkWidget *tb = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); + gtk_box_new(GTK_BOX(tb), FALSE); +#else GtkWidget *tb = gtk_vbox_new(FALSE, 0); +#endif return toolboxNewCommon( tb, BAR_COMMANDS, GTK_POS_LEFT ); } GtkWidget *ToolboxFactory::createSnapToolbox() { +#if GTK_CHECK_VERSION(3,0,0) + GtkWidget *tb = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); + gtk_box_new(GTK_BOX(tb), FALSE); +#else GtkWidget *tb = gtk_vbox_new(FALSE, 0); +#endif return toolboxNewCommon( tb, BAR_SNAP, GTK_POS_LEFT ); } -- cgit v1.2.3 From 0024197c76bca50d557edc2824646a636d695c4d Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sun, 15 Apr 2012 01:17:25 +0100 Subject: Get rid of remaining deprecated GDK Key symbols (bzr r11250) --- src/widgets/toolbox.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/widgets/toolbox.cpp') diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index aa87fb873..58c7958ba 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -113,6 +113,10 @@ #include "toolbox.h" #include +#if !GTK_CHECK_VERSION(2,22,0) +#define GDK_KEY_VoidSymbol 0xffffff +#endif + //#define DEBUG_TEXT using Inkscape::UnitTracker; @@ -860,7 +864,7 @@ GtkWidget * sp_toolbox_button_new_from_verb_with_doubleclick(GtkWidget *t, Inksc unsigned int shortcut = sp_shortcut_get_primary(verb); - if (shortcut != GDK_VoidSymbol) { + if (shortcut != GDK_KEY_VoidSymbol) { gchar *key = sp_shortcut_get_label(shortcut); gchar *tip = g_strdup_printf ("%s (%s)", action->tip, key); if ( t ) { -- cgit v1.2.3