diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2021-11-10 20:53:24 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2021-11-10 21:06:43 +0100 |
commit | 405f9758997e6399bb573f4fc1119e493fe9c195 (patch) | |
tree | d784707326c3b00d2203859c43c37ac465c6cad0 /fastiv.c | |
parent | fc4eb97218f117399e6dfcda459d1562894566f0 (diff) | |
download | fiv-405f9758997e6399bb573f4fc1119e493fe9c195.tar.gz fiv-405f9758997e6399bb573f4fc1119e493fe9c195.tar.xz fiv-405f9758997e6399bb573f4fc1119e493fe9c195.zip |
Use a checkerboard pattern on item background
Diffstat (limited to 'fastiv.c')
-rw-r--r-- | fastiv.c | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -335,10 +335,24 @@ main(int argc, char *argv[]) gtk_window_set_default_icon_name(PROJECT_NAME); - const char *style = "fastiv-view, fastiv-browser { background: #222; }" - "fastiv-browser { padding: 5px; } fastiv-browser.item {" - "border: 1px solid rgba(255, 255, 255, 0.5); " - "margin: 10px; color: #000; background: #444; }"; + // This is incredibly broken https://stackoverflow.com/a/51054396/76313 + // thus resolving the problem using overlaps. + const char *style = "@define-color fastiv-tile #3c3c3c; \ + fastiv-view, fastiv-browser { background: #222; } \ + fastiv-browser { padding: 5px; } \ + fastiv-browser.item { \ + border: 1px solid rgba(255, 255, 255, 0.5); \ + margin: 10px; color: #000; \ + background: #333; \ + background-image: \ + linear-gradient(45deg, @fastiv-tile 26%, transparent 26%), \ + linear-gradient(-45deg, @fastiv-tile 26%, transparent 26%), \ + linear-gradient(45deg, transparent 74%, @fastiv-tile 74%), \ + linear-gradient(-45deg, transparent 74%, @fastiv-tile 74%); \ + background-size: 40px 40px; \ + background-position: 0 0, 0 20px, 20px -20px, -20px 0px; \ + }"; + GtkCssProvider *provider = gtk_css_provider_new(); gtk_css_provider_load_from_data(provider, style, strlen(style), NULL); gtk_style_context_add_provider_for_screen(gdk_screen_get_default(), |