diff options
author | Christoph Gysin <christoph.gysin@gmail.com> | 2016-01-25 22:44:27 +0200 |
---|---|---|
committer | Christoph Gysin <christoph.gysin@gmail.com> | 2016-01-25 22:44:33 +0200 |
commit | a5345e807e229ee9e0e2f4bcb148aab0e7216e22 (patch) | |
tree | 7d7319859fdfa90ac7e6803b634f38a5418bb180 /swaybar | |
parent | Merge pull request #475 from christophgysin/swaylock_color (diff) | |
download | sway-a5345e807e229ee9e0e2f4bcb148aab0e7216e22.tar.gz sway-a5345e807e229ee9e0e2f4bcb148aab0e7216e22.tar.zst sway-a5345e807e229ee9e0e2f4bcb148aab0e7216e22.zip |
extract cairo_set_source_u32()
Diffstat (limited to 'swaybar')
-rw-r--r-- | swaybar/CMakeLists.txt | 6 | ||||
-rw-r--r-- | swaybar/render.c | 9 |
2 files changed, 7 insertions, 8 deletions
diff --git a/swaybar/CMakeLists.txt b/swaybar/CMakeLists.txt index 60975f40..5b865083 100644 --- a/swaybar/CMakeLists.txt +++ b/swaybar/CMakeLists.txt | |||
@@ -25,6 +25,12 @@ target_link_libraries(swaybar | |||
25 | ${JSONC_LIBRARIES} | 25 | ${JSONC_LIBRARIES} |
26 | ) | 26 | ) |
27 | 27 | ||
28 | if (WITH_GDK_PIXBUF) | ||
29 | include_directories( | ||
30 | ${GDK_PIXBUF_INCLUDE_DIRS} | ||
31 | ) | ||
32 | endif() | ||
33 | |||
28 | install( | 34 | install( |
29 | TARGETS swaybar | 35 | TARGETS swaybar |
30 | RUNTIME | 36 | RUNTIME |
diff --git a/swaybar/render.c b/swaybar/render.c index ce5d10b4..1573a373 100644 --- a/swaybar/render.c +++ b/swaybar/render.c | |||
@@ -2,6 +2,7 @@ | |||
2 | #include <stdint.h> | 2 | #include <stdint.h> |
3 | #include <string.h> | 3 | #include <string.h> |
4 | 4 | ||
5 | #include "client/cairo.h" | ||
5 | #include "client/pango.h" | 6 | #include "client/pango.h" |
6 | #include "client/window.h" | 7 | #include "client/window.h" |
7 | #include "bar/config.h" | 8 | #include "bar/config.h" |
@@ -15,14 +16,6 @@ static int ws_horizontal_padding = 5; | |||
15 | static double ws_vertical_padding = 1.5; | 16 | static double ws_vertical_padding = 1.5; |
16 | static int ws_spacing = 1; | 17 | static int ws_spacing = 1; |
17 | 18 | ||
18 | static void cairo_set_source_u32(cairo_t *cairo, uint32_t color) { | ||
19 | cairo_set_source_rgba(cairo, | ||
20 | ((color & 0xFF000000) >> 24) / 255.0, | ||
21 | ((color & 0xFF0000) >> 16) / 255.0, | ||
22 | ((color & 0xFF00) >> 8) / 255.0, | ||
23 | (color & 0xFF) / 255.0); | ||
24 | } | ||
25 | |||
26 | /** | 19 | /** |
27 | * Renders a sharp line of any width and height. | 20 | * Renders a sharp line of any width and height. |
28 | * | 21 | * |