Skip to content

Commit

Permalink
Add option for spacing between tray icons.
Browse files Browse the repository at this point in the history
  • Loading branch information
sargon committed Jan 9, 2016
1 parent fcb92d6 commit a5a0766
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ OPTIONS
--monitor - define the mointor on which you like trayer to appear,
number of zero to number of monitors minus one,
or the string "primary".
--iconspacing - Space between tray icons in pixels.

TRAYER IN DISTROS

Expand Down
1 change: 1 addition & 0 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ tray_constructor(panel *p)
tr->panel = p;
tr->mainw = gtk_alignment_new (0.5, 0.5, 1.0, 1.0);
tr->box = p->my_box_new(FALSE, 1);
gtk_box_set_spacing(GTK_BOX(tr->box), p->icon_spacing);
gtk_container_add (GTK_CONTAINER (tr->mainw), tr->box);
gtk_container_add(GTK_CONTAINER(p->box), tr->mainw);

Expand Down
11 changes: 11 additions & 0 deletions panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,7 @@ usage()
printf(" --expand <false|true> (default:true)\n");
printf(" --padding <number> (default:0)\n");
printf(" --monitor <number|primary> (default:0)\n");
printf(" --iconspacing <number> (default:0)\n");
}

void
Expand Down Expand Up @@ -461,6 +462,7 @@ main(int argc, char *argv[], char *env[])
p->setdocktype = 1;
p->setstrut = 0;
p->transparent = 0;
p->icon_spacing = 0;
p->alpha = 127;
p->tintcolor = 0xFFFFFFFF;
p->xtopbg = None;
Expand Down Expand Up @@ -634,6 +636,15 @@ main(int argc, char *argv[], char *env[])
p->on_primary = 1;
}
}
} else if (!strcmp(argv[i], "--iconspacing")) {
i++;
if (i == argc) {
ERR( "trayer: missing icon padding parameter value\n");
usage();
exit(1);
} else {
p->icon_spacing = atoi(argv[i]);
}
} else {
printf("trayer: unknown option - %s\n", argv[i]);
usage();
Expand Down
1 change: 1 addition & 0 deletions panel.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ typedef struct {
int transparent : 1;
int on_primary : 1;
int monitor;
int icon_spacing;

// Import from plugin structure
gpointer priv;
Expand Down

0 comments on commit a5a0766

Please sign in to comment.