Always register icon sizes for the panel
This commit is contained in:
parent
39364191cb
commit
82cac86b86
26
src/panel.c
26
src/panel.c
|
@ -204,8 +204,21 @@ Panel * panel_new(PanelPrefs const * prefs)
|
||||||
|
|
||||||
static int _new_config(Panel * panel)
|
static int _new_config(Panel * panel)
|
||||||
{
|
{
|
||||||
|
size_t i;
|
||||||
|
gint width;
|
||||||
|
gint height;
|
||||||
String * filename;
|
String * filename;
|
||||||
|
|
||||||
|
for(i = 0; i < sizeof(_panel_sizes) / sizeof(*_panel_sizes); i++)
|
||||||
|
{
|
||||||
|
if(gtk_icon_size_from_name(_panel_sizes[i].name)
|
||||||
|
!= GTK_ICON_SIZE_INVALID)
|
||||||
|
continue;
|
||||||
|
if(gtk_icon_size_lookup(_panel_sizes[i].iconsize, &width,
|
||||||
|
&height) != TRUE)
|
||||||
|
width = height = _panel_sizes[i].size;
|
||||||
|
gtk_icon_size_register(_panel_sizes[i].name, width, height);
|
||||||
|
}
|
||||||
if((panel->config = config_new()) == NULL)
|
if((panel->config = config_new()) == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
if((filename = _config_get_filename()) == NULL)
|
if((filename = _config_get_filename()) == NULL)
|
||||||
|
@ -269,22 +282,9 @@ static void _new_helper(Panel * panel, PanelPosition position)
|
||||||
static void _new_prefs(Config * config, GdkScreen * screen, PanelPrefs * prefs,
|
static void _new_prefs(Config * config, GdkScreen * screen, PanelPrefs * prefs,
|
||||||
PanelPrefs const * user)
|
PanelPrefs const * user)
|
||||||
{
|
{
|
||||||
size_t i;
|
|
||||||
gint width;
|
|
||||||
gint height;
|
|
||||||
char const * p;
|
char const * p;
|
||||||
char * q;
|
char * q;
|
||||||
|
|
||||||
for(i = 0; i < sizeof(_panel_sizes) / sizeof(*_panel_sizes); i++)
|
|
||||||
{
|
|
||||||
if(gtk_icon_size_from_name(_panel_sizes[i].name)
|
|
||||||
!= GTK_ICON_SIZE_INVALID)
|
|
||||||
continue;
|
|
||||||
if(gtk_icon_size_lookup(_panel_sizes[i].iconsize, &width,
|
|
||||||
&height) != TRUE)
|
|
||||||
width = height = _panel_sizes[i].size;
|
|
||||||
gtk_icon_size_register(_panel_sizes[i].name, width, height);
|
|
||||||
}
|
|
||||||
if(user != NULL)
|
if(user != NULL)
|
||||||
memcpy(prefs, user, sizeof(*prefs));
|
memcpy(prefs, user, sizeof(*prefs));
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue
Block a user