Code

Extensions. Color Markers extension improvements (Bug #692582, Color markers to match...
[inkscape.git] / src / ege-select-one-action.cpp
index 32c1ef9b482df739da42d2efa287e85b7606170f..664ffd13d2f0da4c627f7ada5a61e3ab44219781 100644 (file)
@@ -665,7 +665,10 @@ GtkWidget* create_tool_item( GtkAction* action )
 
             gchar*  sss = 0;
             g_object_get( G_OBJECT(action), "short_label", &sss, NULL );
-            if (sss) {
+            // If short_label not defined, g_object_get will return label.
+            // This hack allows a label to be used with a drop-down menu when
+            // no label is used with a set of icons that are self-explanatory.
+            if (sss && strcmp( sss, "NotUsed" ) != 0 ) {
                 GtkWidget* lbl;
                 lbl = gtk_label_new(sss);
                 gtk_box_pack_start( GTK_BOX(holder), lbl, FALSE, FALSE, 4 );
@@ -729,7 +732,7 @@ GtkWidget* create_tool_item( GtkAction* action )
                 if ( act->private_data->sensitiveColumn >= 0 ) {
                     gtk_action_set_sensitive( GTK_ACTION(ract), sens );
                 }
+
                 gtk_radio_action_set_group( ract, group );
                 group = gtk_radio_action_get_group( ract );
 
@@ -928,6 +931,7 @@ void resync_sensitive( EgeSelectOneAction* act )
                         GSList* group = (GSList*)data;
                         // List is backwards in group as compared to GtkTreeModel, we better do matching.
                         while ( group ) {
+#if GTK_CHECK_VERSION(2,16,0)
                             GtkRadioAction* ract = GTK_RADIO_ACTION(group->data);
                             const gchar* label = gtk_action_get_label( GTK_ACTION( ract ) );
 
@@ -956,6 +960,7 @@ void resync_sensitive( EgeSelectOneAction* act )
                             }
 
                             gtk_action_set_sensitive( GTK_ACTION(ract), sens );
+#endif
 
                             group = g_slist_next(group);
                         }
@@ -965,7 +970,7 @@ void resync_sensitive( EgeSelectOneAction* act )
         } else if ( GTK_IS_MENU_ITEM(proxies->data) ) {
             /* Not implemented */
         }
-        
+
         proxies = g_slist_next( proxies );
     }