Changeset 14681


Ignore:
Timestamp:
Feb 23, 2016, 4:34:57 AM (6 years ago)
Author:
mikedld
Message:

Load icons with GResource, remove deprecated inline pixbufs

Location:
trunk/gtk
Files:
5 added
6 deleted
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/CMakeLists.txt

    r14617 r14681  
    3636        transmission.gresource.xml
    3737    DEPENDS
     38        icons/hicolor_apps_24x24_transmission.png
     39        icons/hicolor_apps_48x48_transmission.png
     40        icons/lock.png
     41        icons/ratio.png
     42        icons/turtle-blue.png
     43        icons/turtle-grey.png
     44        icons/utilities.png
    3845        transmission.gresource.xml
    3946        transmission-ui.xml
     
    8895    filter.h
    8996    hig.h
    90     icon-lock.h
    91     icon-logo-24.h
    92     icon-logo-48.h
    93     icon-ratio.h
    9497    icons.h
    95     icon-turtle.h
    96     icon-utilities.h
    9798    makemeta-ui.h
    9899    msgwin.h
  • trunk/gtk/Makefile.am

    r14436 r14681  
    3535    hig.h \
    3636    icons.h \
    37     icon-lock.h \
    38     icon-logo-24.h \
    39     icon-logo-48.h \
    40     icon-ratio.h \
    41     icon-turtle.h \
    42     icon-utilities.h \
    4337    makemeta-ui.h \
    4438    msgwin.h \
  • trunk/gtk/actions.c

    r14666 r14681  
    1919#include "tr-core.h"
    2020#include "tr-prefs.h"
    21 
    22 #include "icon-lock.h"
    23 #include "icon-logo-24.h"
    24 #include "icon-logo-48.h"
    25 #include "icon-ratio.h"
    26 #include "icon-turtle.h"
    27 #include "icon-utilities.h"
    2821
    2922#define UNUSED G_GNUC_UNUSED
     
    132125typedef struct
    133126{
    134     const guint8*   raw;
    135     const char *    name;
     127    const char * filename;
     128    const char * name;
    136129}
    137130BuiltinIconInfo;
     
    139132static const BuiltinIconInfo my_fallback_icons[] =
    140133{
    141     { tr_icon_logo_48,  WINDOW_ICON          },
    142     { tr_icon_logo_24,  TRAY_ICON            },
    143     { tr_icon_logo_48,  NOTIFICATION_ICON    },
    144     { tr_icon_lock,     "transmission-lock" },
    145     { utilities_icon,   "utilities"          },
    146     { blue_turtle,      "alt-speed-on"       },
    147     { grey_turtle,      "alt-speed-off"      },
    148     { ratio_icon,       "ratio"              }
     134    { "logo-48",     WINDOW_ICON         },
     135    { "logo-24",     TRAY_ICON           },
     136    { "logo-48",     NOTIFICATION_ICON   },
     137    { "lock",        "transmission-lock" },
     138    { "utilities",   "utilities"         },
     139    { "turtle-blue", "alt-speed-on"      },
     140    { "turtle-grey", "alt-speed-off"     },
     141    { "ratio",       "ratio"             }
    149142};
    150143
     
    166159        {
    167160          GdkPixbuf * p;
    168 
    169           p = gdk_pixbuf_new_from_inline (-1, my_fallback_icons[i].raw, FALSE, NULL);
     161          gchar * resource_path = g_strdup_printf (TR_RESOURCE_PATH "icons/%s.png", my_fallback_icons[i].filename);
     162
     163          p = gdk_pixbuf_new_from_resource (resource_path, NULL);
     164
     165          g_free (resource_path);
    170166
    171167          if (p != NULL)
  • trunk/gtk/icons/Makefile.am

    r12105 r14681  
    1919
    2020noinst_DATA = \
     21        lock.png \
     22        ratio.png \
     23        turtle-blue.png \
     24        turtle-grey.png \
     25        utilities.png \
    2126        hicolor_apps_16x16_transmission.svg \
    2227        hicolor_apps_22x22_transmission.svg \
  • trunk/gtk/main.c

    r14670 r14681  
    5959#define MY_CONFIG_NAME "transmission"
    6060#define MY_READABLE_NAME "transmission-gtk"
    61 
    62 #define TR_RESOURCE_PATH "/com/transmissionbt/transmission/"
    6361
    6462#define SHOW_LICENSE
  • trunk/gtk/tr-core.h

    r14552 r14681  
    3535#define TR_CORE_TYPE (tr_core_get_type ())
    3636#define TR_CORE(o)(G_TYPE_CHECK_INSTANCE_CAST ((o), TR_CORE_TYPE, TrCore))
     37
     38#define TR_RESOURCE_PATH "/com/transmissionbt/transmission/"
    3739
    3840typedef struct _TrCore
  • trunk/gtk/transmission.gresource.xml

    r13477 r14681  
    22<gresources>
    33  <gresource prefix="/com/transmissionbt/transmission">
     4    <file alias="icons/logo-24.png">icons/hicolor_apps_24x24_transmission.png</file>
     5    <file alias="icons/logo-48.png">icons/hicolor_apps_48x48_transmission.png</file>
     6    <file>icons/lock.png</file>
     7    <file>icons/ratio.png</file>
     8    <file>icons/turtle-blue.png</file>
     9    <file>icons/turtle-grey.png</file>
     10    <file>icons/utilities.png</file>
    411    <file>transmission-ui.xml</file>
    512  </gresource>
Note: See TracChangeset for help on using the changeset viewer.