Re: Porting GTK+ app from defining custom stock items to using GtkIconTheme

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

 



Hi Stefan,

2014-03-03 0:34 GMT+01:00 Stefan Salewski <mail@xxxxxxxxxxxx>:
> On Sun, 2014-03-02 at 23:29 +0100, Bálint Réczey wrote:
>> The link I have sent in two of my emails points to a gerrit review,
>> where
>> I have marked the relevant parts.
>> Could you please check it? It should do as fine as a minimal example
>> to
>> experienced eyes.
>
> I saw the link already some days ago -- but I am only an average GTK
> developer, far from an expert...
>
> One remark:
>
> In your code:
> gtk_icon_theme_add_builtin_icon(pixmaps[i].name, GTK_ICON_SIZE_MENU,
> pixbuf);
> gtk_icon_theme_add_builtin_icon(pixmaps[i].name,
> GTK_ICON_SIZE_SMALL_TOOLBAR, pixbuf);
>
> From GTK documentation:
> https://developer.gnome.org/gtk3/stable/GtkIconTheme.html#gtk-icon-theme-add-builtin-icon
>
>>size: the size at which to register the icon (different images can be
>>registered for the same icon name at different sizes.)
>
> But you register the same pixbuf object for various sizes.
>
> It was my feeling, that you should specify not the desired, but the
> actual size. See bottom most answer here:
>
> http://stackoverflow.com/questions/12521134/gtktoolbutton-with-custom-icon-but-of-stock-icon-size
Thank you for the hints. The size was wrong for the icons, indeed.
The migration is almost perfect now, I just need to figure out why the
toolbar icons are not shown when they overflow the toolbar width.

I have attached two minor patches for GTK+. One clarifies the size
parameter usage, one helps compiling GTK+ apps with -Wc++-compat.

Cheers,
Balint
From cdf72b72223a088931c0a84f2edd2f7b04170664 Mon Sep 17 00:00:00 2001
From: Balint Reczey <balint@xxxxxxxxxxxxxxx>
Date: Mon, 3 Mar 2014 16:07:47 +0100
Subject: [PATCH 1/2] documentation: clarify gtk_icon_theme_add_builtin_icon()
 usage

---
 gtk/gtkicontheme.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
index c857f5b..9d0c7dc 100644
--- a/gtk/gtkicontheme.c
+++ b/gtk/gtkicontheme.c
@@ -5049,7 +5049,7 @@ gtk_icon_info_get_display_name (GtkIconInfo *icon_info)
 /**
  * gtk_icon_theme_add_builtin_icon:
  * @icon_name: the name of the icon to register
- * @size: the size at which to register the icon (different
+ * @size: the size in pixels at which to register the icon (different
  *        images can be registered for the same icon name
  *        at different sizes.)
  * @pixbuf: #GdkPixbuf that contains the image to use
-- 
1.7.10.4

From d372c69aa95c457da4aa1f04a3dcc700d815c239 Mon Sep 17 00:00:00 2001
From: Balint Reczey <balint@xxxxxxxxxxxxxxx>
Date: Mon, 3 Mar 2014 16:34:56 +0100
Subject: [PATCH 2/2] use && instead of 'and' in deprecation warnings

'and' is a C++ keyword and -Wc++-compat finds it
---
 gtk/gtkwidget.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index bf47657..cbcd9e9 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -946,7 +946,7 @@ GDK_AVAILABLE_IN_ALL
 void                  gtk_widget_set_allocation         (GtkWidget     *widget,
                                                          const GtkAllocation *allocation);
 
-GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_get_preferred_width and gtk_widget_get_preferred_height)
+GDK_DEPRECATED_IN_3_0_FOR(gtk_widget_get_preferred_width && gtk_widget_get_preferred_height)
 void                  gtk_widget_get_requisition        (GtkWidget     *widget,
                                                          GtkRequisition *requisition);
 
-- 
1.7.10.4

_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
https://mail.gnome.org/mailman/listinfo/gtk-list

[Index of Archives]     [Touch Screen Library]     [GIMP Users]     [Gnome]     [KDE]     [Yosemite News]     [Steve's Art]

  Powered by Linux