~ubuntu-branches/ubuntu/jaunty/gimp/jaunty-security

« back to all changes in this revision

Viewing changes to app/widgets/gimpmenudock.c

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2008-10-06 13:30:41 UTC
  • mto: This revision was merged to the branch mainline in revision 35.
  • Revision ID: james.westby@ubuntu.com-20081006133041-3panbkcanaymfsmp
Tags: upstream-2.6.0
ImportĀ upstreamĀ versionĀ 2.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
#include "gimp-intl.h"
48
48
 
49
49
 
50
 
#define DEFAULT_MINIMAL_WIDTH  250
 
50
#define DEFAULT_MINIMAL_WIDTH  200
51
51
#define DEFAULT_MENU_VIEW_SIZE GTK_ICON_SIZE_SMALL_TOOLBAR
52
52
 
53
53
 
201
201
  /*  remove the image menu and the auto button manually here because
202
202
   *  of weird cross-connections with GimpDock's context
203
203
   */
204
 
  if (GIMP_DOCK (dock)->main_vbox &&
205
 
      dock->image_combo           &&
206
 
      dock->image_combo->parent)
 
204
  if (GIMP_DOCK (dock)->main_vbox && dock->image_combo)
207
205
    {
208
 
      gtk_container_remove (GTK_CONTAINER (GIMP_DOCK (dock)->main_vbox),
209
 
                            dock->image_combo->parent);
 
206
      GtkWidget *parent = gtk_widget_get_parent (dock->image_combo);
 
207
 
 
208
      if (parent)
 
209
        gtk_container_remove (GTK_CONTAINER (GIMP_DOCK (dock)->main_vbox),
 
210
                              parent);
210
211
    }
211
212
 
212
213
  GTK_OBJECT_CLASS (parent_class)->destroy (object);
216
217
gimp_menu_dock_style_set (GtkWidget *widget,
217
218
                          GtkStyle  *prev_style)
218
219
{
219
 
  GimpMenuDock *menu_dock;
 
220
  GimpMenuDock *menu_dock        = GIMP_MENU_DOCK (widget);
 
221
  GtkStyle     *button_style;
220
222
  gint          minimal_width;
221
223
  GtkIconSize   menu_view_size;
222
224
  GtkSettings  *settings;
226
228
  gint          focus_padding;
227
229
  gint          ythickness;
228
230
 
229
 
  menu_dock = GIMP_MENU_DOCK (widget);
230
 
 
231
 
  if (GTK_WIDGET_CLASS (parent_class)->style_set)
232
 
    GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
 
231
  GTK_WIDGET_CLASS (parent_class)->style_set (widget, prev_style);
233
232
 
234
233
  gtk_widget_style_get (widget,
235
234
                        "minimal-width",     &minimal_width,
247
246
                        "focus-padding",    &focus_padding,
248
247
                        NULL);
249
248
 
250
 
  ythickness = menu_dock->auto_button->style->ythickness;
 
249
  button_style = gtk_widget_get_style (widget);
 
250
  ythickness = button_style->ythickness;
251
251
 
252
252
  gtk_widget_set_size_request (widget, minimal_width, -1);
253
253
 
455
455
gimp_menu_dock_set_show_image_menu (GimpMenuDock *menu_dock,
456
456
                                    gboolean      show)
457
457
{
 
458
  GtkWidget *parent;
 
459
 
458
460
  g_return_if_fail (GIMP_IS_MENU_DOCK (menu_dock));
459
461
 
 
462
  parent = gtk_widget_get_parent (menu_dock->image_combo);
 
463
 
460
464
  if (show)
461
 
    gtk_widget_show (menu_dock->image_combo->parent);
 
465
    gtk_widget_show (parent);
462
466
  else
463
 
    gtk_widget_hide (menu_dock->image_combo->parent);
 
467
    gtk_widget_hide (parent);
464
468
 
465
469
  menu_dock->show_image_menu = show ? TRUE : FALSE;
466
470
}
504
508
      g_list_free (children);
505
509
 
506
510
      if (g_list_next (list))
507
 
        g_string_append (title, " | ");
 
511
        g_string_append (title, " - ");
508
512
    }
509
513
 
510
514
  gtk_window_set_title (GTK_WINDOW (menu_dock), title->str);
561
565
 
562
566
  if (image == NULL && ! gimp_container_is_empty (image_container))
563
567
    {
564
 
      image = GIMP_IMAGE (gimp_container_get_child_by_index (image_container,
565
 
                                                              0));
566
 
 
567
 
      if (image)
568
 
        {
569
 
          /*  this invokes this function recursively but we don't enter
570
 
           *  the if() branch the second time
571
 
           */
572
 
          gimp_context_set_image (context, image);
573
 
 
574
 
          /*  stop the emission of the original signal (the emission of
575
 
           *  the recursive signal is finished)
576
 
           */
577
 
          g_signal_stop_emission_by_name (context, "image-changed");
578
 
        }
 
568
      image = GIMP_IMAGE (gimp_container_get_first_child (image_container));
 
569
 
 
570
      /*  this invokes this function recursively but we don't enter
 
571
       *  the if() branch the second time
 
572
       */
 
573
      gimp_context_set_image (context, image);
 
574
 
 
575
      /*  stop the emission of the original signal (the emission of
 
576
       *  the recursive signal is finished)
 
577
       */
 
578
      g_signal_stop_emission_by_name (context, "image-changed");
579
579
    }
580
580
  else if (image != NULL && ! gimp_container_is_empty (display_container))
581
581
    {
644
644
 
645
645
  if (menu_dock->auto_follow_active)
646
646
    {
647
 
      if (gimp_context_get_display (dock->dialog_factory->context))
648
 
        gimp_context_copy_property (dock->dialog_factory->context,
649
 
                                    dock->context,
650
 
                                    GIMP_CONTEXT_PROP_DISPLAY);
651
 
      else
652
 
        gimp_context_copy_property (dock->dialog_factory->context,
653
 
                                    dock->context,
654
 
                                    GIMP_CONTEXT_PROP_IMAGE);
 
647
      gimp_context_copy_properties (dock->dialog_factory->context,
 
648
                                    dock->context,
 
649
                                    GIMP_CONTEXT_DISPLAY_MASK |
 
650
                                    GIMP_CONTEXT_IMAGE_MASK);
655
651
    }
656
652
}