aboutsummaryrefslogtreecommitdiffstats
path: root/swaybar/main.c
diff options
context:
space:
mode:
authorLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2015-12-27 13:26:37 +0100
committerLibravatar Mikkel Oscar Lyderik <mikkeloscar@gmail.com>2015-12-27 13:26:37 +0100
commite7aef1e23c460b1ec9c5d2e6799a87d9e96a37d4 (patch)
tree9aa96bbb206d0a8ed6ff0dec3459a69eeebfae67 /swaybar/main.c
parentswaybar: Add support for Airblade i3bar extensions (diff)
downloadsway-e7aef1e23c460b1ec9c5d2e6799a87d9e96a37d4.tar.gz
sway-e7aef1e23c460b1ec9c5d2e6799a87d9e96a37d4.tar.zst
sway-e7aef1e23c460b1ec9c5d2e6799a87d9e96a37d4.zip
swaybar: if-else style fixes
Diffstat (limited to 'swaybar/main.c')
-rw-r--r--swaybar/main.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/swaybar/main.c b/swaybar/main.c
index c9fc7de7..ac3b9475 100644
--- a/swaybar/main.c
+++ b/swaybar/main.c
@@ -705,8 +705,7 @@ void parse_json(const char *text) {
705 705
706 if (color) { 706 if (color) {
707 new->color = parse_color(json_object_get_string(color)); 707 new->color = parse_color(json_object_get_string(color));
708 } 708 } else {
709 else {
710 new->color = colors.statusline; 709 new->color = colors.statusline;
711 } 710 }
712 711
@@ -714,8 +713,7 @@ void parse_json(const char *text) {
714 json_type type = json_object_get_type(min_width); 713 json_type type = json_object_get_type(min_width);
715 if (type == json_type_int) { 714 if (type == json_type_int) {
716 new->min_width = json_object_get_int(min_width); 715 new->min_width = json_object_get_int(min_width);
717 } 716 } else if (type == json_type_string) {
718 else if (type == json_type_string) {
719 int width, height; 717 int width, height;
720 get_text_size(window, &width, &height, "%s", json_object_get_string(min_width)); 718 get_text_size(window, &width, &height, "%s", json_object_get_string(min_width));
721 new->min_width = width; 719 new->min_width = width;
@@ -724,8 +722,7 @@ void parse_json(const char *text) {
724 722
725 if (align) { 723 if (align) {
726 new->align = strdup(json_object_get_string(align)); 724 new->align = strdup(json_object_get_string(align));
727 } 725 } else {
728 else {
729 new->align = strdup("left"); 726 new->align = strdup("left");
730 } 727 }
731 728
@@ -743,15 +740,13 @@ void parse_json(const char *text) {
743 740
744 if (separator) { 741 if (separator) {
745 new->separator = json_object_get_int(separator); 742 new->separator = json_object_get_int(separator);
746 } 743 } else {
747 else {
748 new->separator = true; // i3bar spec 744 new->separator = true; // i3bar spec
749 } 745 }
750 746
751 if (separator_block_width) { 747 if (separator_block_width) {
752 new->separator_block_width = json_object_get_int(separator_block_width); 748 new->separator_block_width = json_object_get_int(separator_block_width);
753 } 749 } else {
754 else {
755 new->separator_block_width = 9; // i3bar spec 750 new->separator_block_width = 9; // i3bar spec
756 } 751 }
757 752