[dia] Bug 585001 - hidden option to not enforce icon size



commit 3537fe5fa35347a8b18fbbaeabc3fe326e9e9fe1
Author: Hans Breuer <hans breuer org>
Date:   Tue Jun 14 14:53:18 2011 +0200

    Bug 585001 - hidden option to not enforce icon size
    
    There is a no-gui option to switch off the cropping of icons.
    Change ~/.dia/preferences to not have the constraint.
    
      <dia:boolean role="fixed_icon_size">
        <dia:attribute name="booleanvalue">
          <dia:boolean val="false"/>
        </dia:attribute>
      </dia:boolean>

 app/interface.c   |    2 +-
 app/preferences.c |    3 +++
 app/preferences.h |    4 +++-
 app/sheets.c      |    3 ++-
 4 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/app/interface.c b/app/interface.c
index df320cc..44e9dfa 100644
--- a/app/interface.c
+++ b/app/interface.c
@@ -1301,7 +1301,7 @@ fill_sheet_wbox(Sheet *sheet)
       if (pixbuf != NULL) {
           int width = gdk_pixbuf_get_width (pixbuf);
           int height = gdk_pixbuf_get_height (pixbuf);
-          if (width > 22) {
+          if (width > 22 && prefs.fixed_icon_size) {
 	    GdkPixbuf *cropped;
 	    g_warning ("Shape icon '%s' size wrong, cropped.", sheet_obj->pixmap_file);
 	    cropped = gdk_pixbuf_new_subpixbuf (pixbuf, 
diff --git a/app/preferences.c b/app/preferences.c
index eff66fb..a430c1b 100644
--- a/app/preferences.c
+++ b/app/preferences.c
@@ -247,6 +247,9 @@ DiaPrefData prefs_data[] =
   { "render_bounding_boxes", PREF_BOOLEAN,PREF_OFFSET(render_bounding_boxes),
     &default_false,0,"render bounding boxes",NULL, TRUE},
 
+  { "fixed_icon_size", PREF_BOOLEAN,PREF_OFFSET(fixed_icon_size),
+    &default_true,0,"ensure fixed icon size",NULL, TRUE},
+
   /* There's really no reason to not pretty format it, and allowing non-pretty
      can lead to problems with long lines, CVS etc. 
   { "pretty_formated_xml", PREF_BOOLEAN,PREF_OFFSET(pretty_formated_xml),
diff --git a/app/preferences.h b/app/preferences.h
index b9497d8..e11aa00 100644
--- a/app/preferences.h
+++ b/app/preferences.h
@@ -65,7 +65,9 @@ struct DiaPreferences {
   } pagebreak;
 
   int render_bounding_boxes;
-    
+
+  int fixed_icon_size;
+
   int toolbox_on_top;
 
   int use_integrated_ui;
diff --git a/app/sheets.c b/app/sheets.c
index 79d4801..f5851ff 100644
--- a/app/sheets.c
+++ b/app/sheets.c
@@ -40,6 +40,7 @@
 #include "sheets_dialog.h"
 #include "intl.h"
 #include "gtkhwrapbox.h"
+#include "preferences.h"
 
 GtkWidget *sheets_dialog = NULL;
 GSList *sheets_mods_list = NULL;
@@ -350,7 +351,7 @@ create_object_pixmap(SheetObject *so, GtkWidget *parent,
       {
         int width = gdk_pixbuf_get_width (pixbuf);
         int height = gdk_pixbuf_get_height (pixbuf);
-        if (width > 22) 
+        if (width > 22 && prefs.fixed_icon_size) 
 	{
 	  GdkPixbuf *cropped;
 	  g_warning ("Shape icon '%s' size wrong, cropped.", so->pixmap_file);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]