mirror of
https://github.com/labwc/labwc.git
synced 2026-04-07 08:21:20 -04:00
Realign with codesniffer rules
This commit is contained in:
parent
5846a95f98
commit
987b2c2a89
15 changed files with 486 additions and 466 deletions
|
|
@ -1,6 +1,7 @@
|
||||||
|
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <wlr/types/wlr_scene.h>
|
#include <wlr/types/wlr_scene.h>
|
||||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
||||||
#ifndef LABWC_BORDERSET_H
|
#ifndef LABWC_BORDERSET_H
|
||||||
#define LABWC_BORDERSET_H
|
#define LABWC_BORDERSET_H
|
||||||
|
|
||||||
|
|
@ -9,10 +10,14 @@ enum border_type {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct borderset {
|
struct borderset {
|
||||||
uint32_t id; // Base colour, but could be used as a tracking hash for images or whatever in the future
|
// Base colour, but could be used as a tracking hash for images or whatever in the future
|
||||||
int size; // width (since I suspect a 2px border scaled up to 20px might look weird)
|
uint32_t id;
|
||||||
enum border_type type; // Single or double bevel
|
// width (since I suspect a 2px border scaled up to 20px might look weird)
|
||||||
int bevelSize; // So we can disambiguate multiple possible designs cached together
|
int size;
|
||||||
|
// Single or double bevel, etc.
|
||||||
|
enum border_type type;
|
||||||
|
// So we can disambiguate multiple possible designs cached together
|
||||||
|
int bevelSize;
|
||||||
struct lab_data_buffer *top;
|
struct lab_data_buffer *top;
|
||||||
struct lab_data_buffer *left;
|
struct lab_data_buffer *left;
|
||||||
struct lab_data_buffer *right;
|
struct lab_data_buffer *right;
|
||||||
|
|
@ -21,35 +26,36 @@ struct borderset {
|
||||||
struct lab_data_buffer *tr;
|
struct lab_data_buffer *tr;
|
||||||
struct lab_data_buffer *bl;
|
struct lab_data_buffer *bl;
|
||||||
struct lab_data_buffer *br;
|
struct lab_data_buffer *br;
|
||||||
struct borderset * next;
|
struct borderset *next;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct bufferset {
|
struct bufferset {
|
||||||
enum border_type type;
|
enum border_type type;
|
||||||
int border_width;
|
int border_width;
|
||||||
struct wlr_scene_buffer * top;
|
struct wlr_scene_buffer *top;
|
||||||
struct wlr_scene_buffer * left;
|
struct wlr_scene_buffer *left;
|
||||||
struct wlr_scene_buffer * right;
|
struct wlr_scene_buffer *right;
|
||||||
struct wlr_scene_buffer * bottom;
|
struct wlr_scene_buffer *bottom;
|
||||||
struct wlr_scene_buffer * tl;
|
struct wlr_scene_buffer *tl;
|
||||||
struct wlr_scene_buffer * tr;
|
struct wlr_scene_buffer *tr;
|
||||||
struct wlr_scene_buffer * bl;
|
struct wlr_scene_buffer *bl;
|
||||||
struct wlr_scene_buffer * br;
|
struct wlr_scene_buffer *br;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern struct borderset * borderCache;
|
extern struct borderset *borderCache;
|
||||||
|
|
||||||
struct borderset * getBorders(uint32_t id, int size, enum border_type, int bevelSize);
|
struct borderset *getBorders(uint32_t id, int size, enum border_type, int bevelSize);
|
||||||
|
|
||||||
struct borderset * createBuffer(uint32_t id, int size, enum border_type, int bevelSize);
|
struct borderset *createBuffer(uint32_t id, int size, enum border_type, int bevelSize);
|
||||||
|
|
||||||
struct bufferset * generateBufferset(struct wlr_scene_tree * tree, struct borderset *borderset, int bw);
|
struct bufferset *generateBufferset(struct wlr_scene_tree *tree,
|
||||||
|
struct borderset *borderset, int bw);
|
||||||
|
|
||||||
void renderBufferset(struct bufferset *, int width, int height, int y);
|
void renderBufferset(struct bufferset *bufferset, int width, int height, int y);
|
||||||
|
|
||||||
void renderBuffersetXY(struct bufferset *, int width, int height, int x, int y);
|
void renderBuffersetXY(struct bufferset *bufferset, int width, int height, int x, int y);
|
||||||
|
|
||||||
void clearBorderCache(struct borderset *borderset);
|
void clearBorderCache(struct borderset *borderset);
|
||||||
|
|
||||||
#endif /* LABWC_LAB_SCENE_RECT_H */
|
#endif /* LABWC_BORDERSET_H */
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ struct ssd {
|
||||||
struct scaled_font_buffer *title;
|
struct scaled_font_buffer *title;
|
||||||
struct wl_list buttons_left; /* ssd_button.link */
|
struct wl_list buttons_left; /* ssd_button.link */
|
||||||
struct wl_list buttons_right; /* ssd_button.link */
|
struct wl_list buttons_right; /* ssd_button.link */
|
||||||
struct bufferset * texturedBorders;
|
struct bufferset *texturedBorders;
|
||||||
} subtrees[2]; /* indexed by enum ssd_active_state */
|
} subtrees[2]; /* indexed by enum ssd_active_state */
|
||||||
} titlebar;
|
} titlebar;
|
||||||
|
|
||||||
|
|
@ -116,7 +116,7 @@ struct ssd {
|
||||||
struct ssd_border_subtree {
|
struct ssd_border_subtree {
|
||||||
struct wlr_scene_tree *tree;
|
struct wlr_scene_tree *tree;
|
||||||
struct wlr_scene_rect *top, *bottom, *left, *right;
|
struct wlr_scene_rect *top, *bottom, *left, *right;
|
||||||
struct bufferset * texturedBorders;
|
struct bufferset *texturedBorders;
|
||||||
} subtrees[2]; /* indexed by enum ssd_active_state */
|
} subtrees[2]; /* indexed by enum ssd_active_state */
|
||||||
} border;
|
} border;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,6 @@ struct theme_background {
|
||||||
int border_width;
|
int border_width;
|
||||||
int bevel_width;
|
int bevel_width;
|
||||||
bool exclusive;
|
bool exclusive;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct theme {
|
struct theme {
|
||||||
|
|
@ -88,8 +87,6 @@ struct theme {
|
||||||
float window_button_hover_bg_color[4];
|
float window_button_hover_bg_color[4];
|
||||||
int window_button_hover_bg_corner_radius;
|
int window_button_hover_bg_corner_radius;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Themes/textures for each active/inactive window. Indexed by
|
* Themes/textures for each active/inactive window. Indexed by
|
||||||
* ssd_active_state.
|
* ssd_active_state.
|
||||||
|
|
@ -106,7 +103,6 @@ struct theme {
|
||||||
float button_border_color[4];
|
float button_border_color[4];
|
||||||
float button_hover_border_color[4];
|
float button_hover_border_color[4];
|
||||||
|
|
||||||
|
|
||||||
float border_color[4];
|
float border_color[4];
|
||||||
float toggled_keybinds_color[4];
|
float toggled_keybinds_color[4];
|
||||||
float label_text_color[4];
|
float label_text_color[4];
|
||||||
|
|
|
||||||
|
|
@ -244,7 +244,7 @@ struct view {
|
||||||
int width, height;
|
int width, height;
|
||||||
struct wlr_scene_tree *tree;
|
struct wlr_scene_tree *tree;
|
||||||
struct wlr_scene_rect *border;
|
struct wlr_scene_rect *border;
|
||||||
struct bufferset * texturedBorders;
|
struct bufferset *texturedBorders;
|
||||||
struct wlr_scene_rect *background;
|
struct wlr_scene_rect *background;
|
||||||
struct scaled_font_buffer *text;
|
struct scaled_font_buffer *text;
|
||||||
} resize_indicator;
|
} resize_indicator;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
// SPDX-License-Identifier: GPL-2.0-only
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <wlr/types/wlr_scene.h>
|
#include <wlr/types/wlr_scene.h>
|
||||||
#include "common/borderset.h"
|
#include "common/borderset.h"
|
||||||
|
|
@ -5,38 +6,41 @@
|
||||||
#include "common/macros.h"
|
#include "common/macros.h"
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
|
|
||||||
struct borderset * getBorders(uint32_t id, int size, enum border_type type, int bevelSize) {
|
struct borderset *getBorders(uint32_t id, int size, enum border_type type, int bevelSize)
|
||||||
struct borderset * current = borderCache;
|
{
|
||||||
struct borderset * last;
|
struct borderset *current = borderCache;
|
||||||
|
struct borderset *last;
|
||||||
|
|
||||||
// Preventing building nonsense borders:
|
// Preventing building nonsense borders:
|
||||||
// If you try for a double bevel but it's so deep they would overlap, convert to a single bevel
|
// If you try for a double bevel but it's so deep they would overlap,
|
||||||
|
// convert to a single bevel
|
||||||
if (type == BORDER_DOUBLE && (bevelSize > size/2)) {
|
if (type == BORDER_DOUBLE && (bevelSize > size/2)) {
|
||||||
type = BORDER_SINGLE;
|
type = BORDER_SINGLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type == BORDER_DOUBLE_INSET && (bevelSize > size/2)) {
|
if (type == BORDER_DOUBLE_INSET && (bevelSize > size/2)) {
|
||||||
type = BORDER_INSET;
|
type = BORDER_INSET;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Anything with a size of 0 is converted to a 1-pixel flat border so as to
|
||||||
// Anything with a size of 0 is converted to a 1-pixel flat border so as to prevent empty allocations
|
// prevent empty allocations
|
||||||
|
|
||||||
if (size < 1) {
|
if (size < 1) {
|
||||||
type = BORDER_FLAT;
|
type = BORDER_FLAT;
|
||||||
size = 1;
|
size = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (current != NULL) {
|
while (current) {
|
||||||
if (current->size == size && current->id == id && current->type == type && current->bevelSize == bevelSize) {
|
if (current->size == size && current->id == id &&
|
||||||
|
current->type == type && current->bevelSize == bevelSize) {
|
||||||
return current;
|
return current;
|
||||||
}
|
}
|
||||||
last = current;
|
last = current;
|
||||||
current = current -> next;
|
current = current->next;
|
||||||
}
|
}
|
||||||
// Fall through, we need to create a buffer.
|
// Fall through, we need to create a buffer.
|
||||||
|
|
||||||
if (borderCache == NULL) {
|
if (!borderCache) {
|
||||||
borderCache = createBuffer(id, size, type, bevelSize);
|
borderCache = createBuffer(id, size, type, bevelSize);
|
||||||
return borderCache;
|
return borderCache;
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -46,17 +50,15 @@ struct borderset * getBorders(uint32_t id, int size, enum border_type type, int
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct borderset * createBuffer(uint32_t id, int size, enum border_type type, int bevelSize) {
|
struct borderset *createBuffer(uint32_t id, int size, enum border_type type, int bevelSize)
|
||||||
struct borderset *newBorderset = znew(*newBorderset);
|
{
|
||||||
|
struct borderset *new_borderset = znew(*new_borderset);
|
||||||
|
|
||||||
newBorderset->next = NULL;
|
|
||||||
newBorderset->id = id;
|
|
||||||
newBorderset->size = size;
|
|
||||||
newBorderset->type = type;
|
|
||||||
newBorderset->bevelSize = bevelSize;
|
|
||||||
|
|
||||||
|
|
||||||
|
new_borderset->next = NULL;
|
||||||
|
new_borderset->id = id;
|
||||||
|
new_borderset->size = size;
|
||||||
|
new_borderset->type = type;
|
||||||
|
new_borderset->bevelSize = bevelSize;
|
||||||
|
|
||||||
// Use ID as a AARRGGBB colour
|
// Use ID as a AARRGGBB colour
|
||||||
uint8_t a = id >> 24 & 255;
|
uint8_t a = id >> 24 & 255;
|
||||||
|
|
@ -65,13 +67,19 @@ struct borderset * createBuffer(uint32_t id, int size, enum border_type type, i
|
||||||
uint8_t b = id & 255;
|
uint8_t b = id & 255;
|
||||||
|
|
||||||
uint32_t r1 = r * 5 / 4;
|
uint32_t r1 = r * 5 / 4;
|
||||||
if (r1 > a) r1=a;
|
if (r1 > a) {
|
||||||
|
r1 = a;
|
||||||
|
}
|
||||||
uint32_t g1 = g * 5 / 4;
|
uint32_t g1 = g * 5 / 4;
|
||||||
if (g1 > a) g1=a;
|
if (g1 > a) {
|
||||||
|
g1 = a;
|
||||||
|
}
|
||||||
uint32_t b1 = b * 5 / 4;
|
uint32_t b1 = b * 5 / 4;
|
||||||
if (b1 > a) b1=a;
|
if (b1 > a) {
|
||||||
|
b1 = a;
|
||||||
|
}
|
||||||
|
|
||||||
/* darker outline */
|
/* darker outline */
|
||||||
uint32_t r0 = r / 2;
|
uint32_t r0 = r / 2;
|
||||||
uint32_t g0 = g / 2;
|
uint32_t g0 = g / 2;
|
||||||
uint32_t b0 = b / 2;
|
uint32_t b0 = b / 2;
|
||||||
|
|
@ -93,198 +101,182 @@ struct borderset * createBuffer(uint32_t id, int size, enum border_type type, i
|
||||||
uint32_t *bottom = NULL;
|
uint32_t *bottom = NULL;
|
||||||
size_t side_size = 0;
|
size_t side_size = 0;
|
||||||
|
|
||||||
switch(type) {
|
switch (type) {
|
||||||
case BORDER_INSET:
|
case BORDER_INSET:
|
||||||
temp = ll32;
|
temp = ll32;
|
||||||
ll32 = hl32;
|
ll32 = hl32;
|
||||||
hl32 = temp;
|
hl32 = temp;
|
||||||
// Fall throgh intentional
|
// Fall throgh intentional
|
||||||
case BORDER_SINGLE: // Single bevel borders have 1x1 sides
|
case BORDER_SINGLE: // Single bevel borders have 1x1 sides
|
||||||
top = znew(uint32_t);
|
top = znew(uint32_t);
|
||||||
left = znew(uint32_t);
|
left = znew(uint32_t);
|
||||||
right = znew(uint32_t);
|
right = znew(uint32_t);
|
||||||
bottom = znew(uint32_t);
|
bottom = znew(uint32_t);
|
||||||
side_size = 1;
|
side_size = 1;
|
||||||
*top = hl32;
|
*top = hl32;
|
||||||
*left = hl32;
|
*left = hl32;
|
||||||
*right = ll32;
|
*right = ll32;
|
||||||
*bottom = ll32;
|
*bottom = ll32;
|
||||||
|
|
||||||
// Fill with solid
|
// Fill with solid
|
||||||
for (int j=0; j<size;j++) {
|
for (int j = 0; j < size; j++) {
|
||||||
for (int k=0; k<size;k++) {
|
for (int k = 0; k < size; k++) {
|
||||||
tl[PIXEL(j, k, size)] = hl32;
|
tl[PIXEL(j, k, size)] = hl32;
|
||||||
tr[PIXEL(size - 1 - j, k, size)] = (j > k) ? hl32 : ll32;
|
tr[PIXEL(size - 1 - j, k, size)] = (j > k) ? hl32 : ll32;
|
||||||
bl[PIXEL(size - 1 -j, k, size)] = (j > k) ? hl32 : ll32;
|
bl[PIXEL(size - 1 -j, k, size)] = (j > k) ? hl32 : ll32;
|
||||||
br[PIXEL(j, k, size)] = ll32;
|
br[PIXEL(j, k, size)] = ll32;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BORDER_DOUBLE_INSET:
|
||||||
|
temp = ll32;
|
||||||
|
ll32 = hl32;
|
||||||
|
hl32 = temp;
|
||||||
|
// Fall throgh intentional
|
||||||
|
case BORDER_DOUBLE:
|
||||||
|
top = znew_n(uint32_t, size);
|
||||||
|
left = znew_n(uint32_t, size);
|
||||||
|
right = znew_n(uint32_t, size);
|
||||||
|
bottom = znew_n(uint32_t, size);
|
||||||
|
side_size = size;
|
||||||
|
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
if (i < bevelSize) {
|
||||||
|
left[i] = hl32;
|
||||||
|
top[i] = hl32;
|
||||||
|
right[i] = hl32;
|
||||||
|
bottom[i] = hl32;
|
||||||
|
|
||||||
|
} else if (i > (size-bevelSize-1)) {
|
||||||
|
left[i] = ll32;
|
||||||
|
top[i] = ll32;
|
||||||
|
right[i] = ll32;
|
||||||
|
bottom[i] = ll32;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
left[i] = id;
|
||||||
|
top[i] = id;
|
||||||
|
right[i] = id;
|
||||||
|
bottom[i] = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Blank corners...
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
for (int j = 0; j < size; j++) {
|
||||||
|
tl[PIXEL(i, j, size)] = id;
|
||||||
|
tr[PIXEL(i, j, size)] = id;
|
||||||
|
bl[PIXEL(i, j, size)] = id;
|
||||||
|
br[PIXEL(i, j, size)] = id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Main Corners
|
||||||
|
for (int i = 0; i < bevelSize; i++) {
|
||||||
|
// Solid bar parts
|
||||||
|
for (int j = 0; j < size; j++) {
|
||||||
|
// Top left corner: Entire "bevel size" top rows are highlighted
|
||||||
|
tl[PIXEL(j, i, size)] = hl32;
|
||||||
|
// First "bevel size" top columns are highlighted
|
||||||
|
tl[PIXEL(i, j, size)] = hl32;
|
||||||
|
|
||||||
|
// Bottom Right corner: Entire "bevel size" last rows are lowlight
|
||||||
|
br[PIXEL(j, (size-1-i), size)] = ll32;
|
||||||
|
// Last "bevel size" columns are lowlight
|
||||||
|
br[PIXEL((size-1-i), j, size)] = ll32;
|
||||||
|
|
||||||
|
// Bottom left corner: Entire "bevel size" last rows are lowlight
|
||||||
|
bl[PIXEL(j, (size-1-i), size)] = ll32;
|
||||||
|
// First "bevel size" columns are highlight, except for
|
||||||
|
// the bottom right corner
|
||||||
|
bl[PIXEL(i, j, size)] = hl32;
|
||||||
|
|
||||||
|
// Top Right corner: Entire "bevel size" first rows are highlight
|
||||||
|
tr[PIXEL(j, i, size)] = hl32;
|
||||||
|
// Last "bevel size" columns are lowlight, except for the top left
|
||||||
|
tr[PIXEL((size-1-i), j, size)] = ll32;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Beveled Corner Parts
|
||||||
|
for (int i = 0; i < bevelSize; i++) {
|
||||||
|
for (int j = 0; j < bevelSize; j++) {
|
||||||
|
// Outer Corners
|
||||||
|
// Bottom left corner:
|
||||||
|
// First "bevel size" columns are highlight, except
|
||||||
|
// for the bottom right corner
|
||||||
|
bl[PIXEL(i, (size - 1 - j), size)] = (j >= i) ? hl32 : ll32;
|
||||||
|
|
||||||
|
// Top Right corner:
|
||||||
|
// Last "bevel size" columns are lowlight, except for the top left
|
||||||
|
tr[PIXEL((size-1-i), j, size)] = (j > i) ? ll32 : hl32;
|
||||||
|
|
||||||
|
// Inner Corners
|
||||||
|
// Top left corner: Bottom right is all dark
|
||||||
|
tl[PIXEL((size-1-i), (size - 1 - j), size)] = ll32;
|
||||||
|
|
||||||
|
// Bottom Right corner: Top left is all light
|
||||||
|
br[PIXEL(i, j, size)] = hl32;
|
||||||
|
|
||||||
|
// Top Right corner:
|
||||||
|
// Interior bottom left is dark on top, light on bottom
|
||||||
|
tr[PIXEL(i, (size-1-j), size)] = (i > j) ? hl32 : ll32;
|
||||||
|
|
||||||
|
// Bottom Left corner:
|
||||||
|
// Interior top right is dark on top, light on bottom
|
||||||
|
bl[PIXEL((size-1-i), j, size)] = (i > j) ? ll32 : hl32;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BORDER_DOUBLE_INSET:
|
case BORDER_FLAT: // Placeholder that uses buffers but for a flat colour
|
||||||
temp = ll32;
|
case BORDER_NONE: // Provided as a fallback but should not be actually requested/rendered
|
||||||
ll32 = hl32;
|
top = znew(uint32_t);
|
||||||
hl32 = temp;
|
left = znew(uint32_t);
|
||||||
// Fall throgh intentional
|
right = znew(uint32_t);
|
||||||
case BORDER_DOUBLE:
|
bottom = znew(uint32_t);
|
||||||
top = znew_n(uint32_t, size);
|
side_size = 1;
|
||||||
left = znew_n(uint32_t, size);
|
*top = id;
|
||||||
right = znew_n(uint32_t, size);
|
*left = id;
|
||||||
bottom = znew_n(uint32_t, size);
|
*right = id;
|
||||||
side_size = size;
|
*bottom = id;
|
||||||
|
|
||||||
for (int i = 0; i < size; i++) {
|
// Fill with solid
|
||||||
if (i<bevelSize) {
|
for (int j = 0; j < size; j++) {
|
||||||
left[i] = hl32;
|
for (int k = 0; k < size; k++) {
|
||||||
top[i] = hl32;
|
tl[PIXEL(j, k, size)] = id;
|
||||||
right[i] = hl32;
|
tr[PIXEL(size - 1 - j, k, size)] = id;
|
||||||
bottom[i] = hl32;
|
bl[PIXEL(size - 1 -j, k, size)] = id;
|
||||||
|
br[PIXEL(j, k, size)] = id;
|
||||||
} else if (i > (size-bevelSize-1)) {
|
|
||||||
left[i] = ll32;
|
|
||||||
top[i] = ll32;
|
|
||||||
right[i] = ll32;
|
|
||||||
bottom[i] = ll32;
|
|
||||||
|
|
||||||
} else {
|
|
||||||
left[i] = id;
|
|
||||||
top[i] = id;
|
|
||||||
right[i] = id;
|
|
||||||
bottom[i] = id;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// Blank corners...
|
|
||||||
for (int i=0; i<size;i++) {
|
|
||||||
for (int j=0; j<size;j++) {
|
|
||||||
tl[PIXEL(i, j, size)] = id;
|
|
||||||
tr[PIXEL(i, j, size)] = id;
|
|
||||||
bl[PIXEL(i, j, size)] = id;
|
|
||||||
br[PIXEL(i, j, size)] = id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Main Corners
|
|
||||||
for (int i=0; i < bevelSize; i++) {
|
|
||||||
|
|
||||||
// Solid bar parts
|
|
||||||
for (int j=0; j<size; j++) {
|
|
||||||
// Top left corner: Entire "bevel size" top rows are highlighted
|
|
||||||
tl[PIXEL(j, i, size)] = hl32;
|
|
||||||
// First "bevel size" top columns are highlighted
|
|
||||||
tl[PIXEL(i, j, size)] = hl32;
|
|
||||||
|
|
||||||
// Bottom Right corner: Entire "bevel size" last rows are lowlight
|
|
||||||
br[PIXEL(j, (size-1-i), size)] = ll32;
|
|
||||||
// Last "bevel size" columns are lowlight
|
|
||||||
br[PIXEL((size-1-i), j, size)] = ll32;
|
|
||||||
|
|
||||||
|
|
||||||
// Bottom left corner: Entire "bevel size" last rows are lowlight
|
|
||||||
bl[PIXEL(j, (size-1-i), size)] = ll32;
|
|
||||||
// First "bevel size" columns are highlight, except for the bottom right corner
|
|
||||||
bl[PIXEL(i, j, size)] = hl32;
|
|
||||||
|
|
||||||
// Top Right corner: Entire "bevel size" first rows are highlight
|
|
||||||
tr[PIXEL(j, i, size)] = hl32;
|
|
||||||
// Last "bevel size" columns are lowlight, except for the top left
|
|
||||||
tr[PIXEL((size-1-i), j, size)] = ll32;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Beveled Corner Parts
|
|
||||||
for (int i=0; i < bevelSize; i++) {
|
|
||||||
|
|
||||||
for (int j=0; j<bevelSize; j++) {
|
|
||||||
// Outer Corners
|
|
||||||
// Bottom left corner:
|
|
||||||
// First "bevel size" columns are highlight, except for the bottom right corner
|
|
||||||
bl[PIXEL(i, (size - 1 - j), size)] = (j >= i) ? hl32 : ll32;
|
|
||||||
|
|
||||||
// Top Right corner:
|
|
||||||
// Last "bevel size" columns are lowlight, except for the top left
|
|
||||||
tr[PIXEL((size-1-i), j, size)] = (j > i) ? ll32 : hl32;
|
|
||||||
|
|
||||||
|
|
||||||
// Inner Corners
|
|
||||||
// Top left corner: Bottom right is all dark
|
|
||||||
tl[PIXEL((size-1-i), (size - 1 - j), size)] = ll32;
|
|
||||||
|
|
||||||
// Bottom Right corner: Top left is all light
|
|
||||||
br[PIXEL(i, j, size)] = hl32;
|
|
||||||
|
|
||||||
// Top Right corner:
|
|
||||||
// Interior bottom left is dark on top, light on bottom
|
|
||||||
tr[PIXEL(i, (size-1-j), size)] = (i > j) ? hl32 : ll32;
|
|
||||||
|
|
||||||
// Bottom Left corner:
|
|
||||||
// Interior top right is dark on top, light on bottom
|
|
||||||
bl[PIXEL((size-1-i), j, size)] = (i > j) ? ll32 : hl32;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
|
||||||
|
|
||||||
case BORDER_FLAT: // Placeholder that uses buffers but for a flat colour
|
|
||||||
case BORDER_NONE: // Provided as a fallback but should not be actually requested/rendered
|
|
||||||
top = znew(uint32_t);
|
|
||||||
left = znew(uint32_t);
|
|
||||||
right = znew(uint32_t);
|
|
||||||
bottom = znew(uint32_t);
|
|
||||||
side_size = 1;
|
|
||||||
*top = id;
|
|
||||||
*left = id;
|
|
||||||
*right = id;
|
|
||||||
*bottom = id;
|
|
||||||
|
|
||||||
// Fill with solid
|
|
||||||
for (int j=0; j<size;j++) {
|
|
||||||
for (int k=0; k<size;k++) {
|
|
||||||
tl[PIXEL(j, k, size)] = id;
|
|
||||||
tr[PIXEL(size - 1 - j, k, size)] = id;
|
|
||||||
bl[PIXEL(size - 1 -j, k, size)] = id;
|
|
||||||
br[PIXEL(j, k, size)] = id;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
assert(side_size > 0);
|
assert(side_size > 0);
|
||||||
|
|
||||||
newBorderset->top = buffer_create_from_data(top, 1, side_size, 4);
|
new_borderset->top = buffer_create_from_data(top, 1, side_size, 4);
|
||||||
newBorderset->left = buffer_create_from_data(left, side_size, 1, side_size * 4);
|
new_borderset->left = buffer_create_from_data(left, side_size, 1, side_size * 4);
|
||||||
newBorderset->right = buffer_create_from_data(right, side_size, 1, side_size * 4);
|
new_borderset->right = buffer_create_from_data(right, side_size, 1, side_size * 4);
|
||||||
newBorderset->bottom = buffer_create_from_data(bottom, 1, side_size, 4);
|
new_borderset->bottom = buffer_create_from_data(bottom, 1, side_size, 4);
|
||||||
|
|
||||||
newBorderset->tl = buffer_create_from_data(tl, size, size, size * 4);
|
new_borderset->tl = buffer_create_from_data(tl, size, size, size * 4);
|
||||||
newBorderset->tr = buffer_create_from_data(tr, size, size, size * 4);
|
new_borderset->tr = buffer_create_from_data(tr, size, size, size * 4);
|
||||||
newBorderset->bl = buffer_create_from_data(bl, size, size, size * 4);
|
new_borderset->bl = buffer_create_from_data(bl, size, size, size * 4);
|
||||||
newBorderset->br = buffer_create_from_data(br, size, size, size * 4);
|
new_borderset->br = buffer_create_from_data(br, size, size, size * 4);
|
||||||
|
|
||||||
return newBorderset;
|
return new_borderset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
struct bufferset *generateBufferset(struct wlr_scene_tree *tree,
|
||||||
struct bufferset * generateBufferset(struct wlr_scene_tree * tree, struct borderset *borderset, int bw)
|
struct borderset *borderset, int bw)
|
||||||
{
|
{
|
||||||
struct bufferset * bufferset = znew(struct bufferset);
|
struct bufferset *bufferset = znew(struct bufferset);
|
||||||
|
|
||||||
bufferset->top = wlr_scene_buffer_create(tree, &borderset->top->base);
|
bufferset->top = wlr_scene_buffer_create(tree, &borderset->top->base);
|
||||||
bufferset->left= wlr_scene_buffer_create(tree, &borderset->left->base);
|
bufferset->left = wlr_scene_buffer_create(tree, &borderset->left->base);
|
||||||
bufferset->right = wlr_scene_buffer_create(tree, &borderset->right->base);
|
bufferset->right = wlr_scene_buffer_create(tree, &borderset->right->base);
|
||||||
bufferset->bottom = wlr_scene_buffer_create(tree, &borderset->bottom->base);
|
bufferset->bottom = wlr_scene_buffer_create(tree, &borderset->bottom->base);
|
||||||
bufferset->tl = wlr_scene_buffer_create(tree, &borderset->tl->base);
|
bufferset->tl = wlr_scene_buffer_create(tree, &borderset->tl->base);
|
||||||
|
|
@ -313,17 +305,15 @@ void renderBufferset(struct bufferset *bufferset, int width, int height, int y)
|
||||||
|
|
||||||
void renderBuffersetXY(struct bufferset *bufferset, int width, int height, int x, int y)
|
void renderBuffersetXY(struct bufferset *bufferset, int width, int height, int x, int y)
|
||||||
{
|
{
|
||||||
|
|
||||||
wlr_scene_buffer_set_dest_size(bufferset->top,
|
wlr_scene_buffer_set_dest_size(bufferset->top,
|
||||||
width - 2 * bufferset->border_width, bufferset->border_width);
|
width - 2 * bufferset->border_width, bufferset->border_width);
|
||||||
wlr_scene_node_set_position(&bufferset->top->node,
|
wlr_scene_node_set_position(&bufferset->top->node,
|
||||||
x+bufferset->border_width,y);
|
x+bufferset->border_width, y);
|
||||||
|
|
||||||
wlr_scene_buffer_set_dest_size(bufferset->bottom,
|
wlr_scene_buffer_set_dest_size(bufferset->bottom,
|
||||||
width - 2 * bufferset->border_width, bufferset->border_width);
|
width - 2 * bufferset->border_width, bufferset->border_width);
|
||||||
wlr_scene_node_set_position(&bufferset->bottom->node,
|
wlr_scene_node_set_position(&bufferset->bottom->node,
|
||||||
x+bufferset->border_width, y+height - bufferset->border_width);
|
x+bufferset->border_width, y+height - bufferset->border_width);
|
||||||
|
|
||||||
|
|
||||||
wlr_scene_buffer_set_dest_size(bufferset->left,
|
wlr_scene_buffer_set_dest_size(bufferset->left,
|
||||||
bufferset->border_width, height - bufferset->border_width * 2);
|
bufferset->border_width, height - bufferset->border_width * 2);
|
||||||
|
|
@ -333,37 +323,35 @@ void renderBuffersetXY(struct bufferset *bufferset, int width, int height, int x
|
||||||
wlr_scene_buffer_set_dest_size(bufferset->right,
|
wlr_scene_buffer_set_dest_size(bufferset->right,
|
||||||
bufferset->border_width, height - bufferset->border_width * 2);
|
bufferset->border_width, height - bufferset->border_width * 2);
|
||||||
wlr_scene_node_set_position(&bufferset->right->node,
|
wlr_scene_node_set_position(&bufferset->right->node,
|
||||||
x+width - bufferset->border_width, y+ bufferset->border_width);
|
x+width - bufferset->border_width, y+bufferset->border_width);
|
||||||
|
|
||||||
wlr_scene_buffer_set_dest_size(bufferset->tl,
|
wlr_scene_buffer_set_dest_size(bufferset->tl,
|
||||||
bufferset->border_width, bufferset->border_width);
|
bufferset->border_width, bufferset->border_width);
|
||||||
wlr_scene_node_set_position(&bufferset->tl->node,
|
wlr_scene_node_set_position(&bufferset->tl->node,
|
||||||
x,y);
|
x, y);
|
||||||
|
|
||||||
wlr_scene_buffer_set_dest_size(bufferset->tr,
|
wlr_scene_buffer_set_dest_size(bufferset->tr,
|
||||||
bufferset->border_width, bufferset->border_width);
|
bufferset->border_width, bufferset->border_width);
|
||||||
wlr_scene_node_set_position(&bufferset->tr->node,
|
wlr_scene_node_set_position(&bufferset->tr->node,
|
||||||
x+width-bufferset->border_width, y);
|
x+width-bufferset->border_width, y);
|
||||||
|
|
||||||
|
|
||||||
wlr_scene_buffer_set_dest_size(bufferset->br,
|
wlr_scene_buffer_set_dest_size(bufferset->br,
|
||||||
bufferset->border_width, bufferset->border_width);
|
bufferset->border_width, bufferset->border_width);
|
||||||
wlr_scene_node_set_position(&bufferset->br->node,
|
wlr_scene_node_set_position(&bufferset->br->node,
|
||||||
x+width-bufferset->border_width , y+height-bufferset->border_width);
|
x+width-bufferset->border_width, y+height-bufferset->border_width);
|
||||||
|
|
||||||
|
|
||||||
wlr_scene_buffer_set_dest_size(bufferset->bl,
|
wlr_scene_buffer_set_dest_size(bufferset->bl,
|
||||||
bufferset->border_width, bufferset->border_width);
|
bufferset->border_width, bufferset->border_width);
|
||||||
wlr_scene_node_set_position(&bufferset->bl->node,
|
wlr_scene_node_set_position(&bufferset->bl->node,
|
||||||
x, height-bufferset->border_width+y);
|
x, height-bufferset->border_width+y);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void clearBorderCache(struct borderset * borderset)
|
void clearBorderCache(struct borderset *borderset)
|
||||||
{
|
{
|
||||||
if (borderset == NULL)
|
if (!borderset) {
|
||||||
return;
|
return;
|
||||||
if (borderset->next != NULL) {
|
}
|
||||||
|
if (borderset->next) {
|
||||||
clearBorderCache(borderset->next);
|
clearBorderCache(borderset->next);
|
||||||
}
|
}
|
||||||
wlr_buffer_drop(&borderset->top->base);
|
wlr_buffer_drop(&borderset->top->base);
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
struct border_scene {
|
struct border_scene {
|
||||||
struct wlr_scene_tree *tree;
|
struct wlr_scene_tree *tree;
|
||||||
struct wlr_scene_rect *top, *bottom, *left, *right;
|
struct wlr_scene_rect *top, *bottom, *left, *right;
|
||||||
struct bufferset * texturedBorders;
|
struct bufferset *texturedBorders;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -54,14 +54,17 @@ lab_scene_rect_create(struct wlr_scene_tree *parent,
|
||||||
float b = color[2];
|
float b = color[2];
|
||||||
float a = color[3];
|
float a = color[3];
|
||||||
int bw = rect->border_width;
|
int bw = rect->border_width;
|
||||||
uint32_t colour32 = (uint32_t)(a*255) << 24 | (uint32_t)(r*255) << 16 | (uint32_t)(g*255) << 8 | (uint32_t)(b*255);
|
uint32_t colour32 = (uint32_t)(a*255) << 24 |
|
||||||
struct borderset * renderedborders = getBorders(colour32, bw, opts->border_type, opts->bevel_width);
|
(uint32_t)(r*255) << 16 |
|
||||||
border->texturedBorders = generateBufferset(border->tree, renderedborders, bw);
|
(uint32_t)(g*255) << 8 |
|
||||||
|
(uint32_t)(b*255);
|
||||||
|
struct borderset *renderedborders = getBorders(colour32, bw,
|
||||||
|
opts->border_type, opts->bevel_width);
|
||||||
|
border->texturedBorders = generateBufferset(border->tree,
|
||||||
|
renderedborders, bw);
|
||||||
} else {
|
} else {
|
||||||
border->texturedBorders = NULL;
|
border->texturedBorders = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rect->node_destroy.notify = handle_node_destroy;
|
rect->node_destroy.notify = handle_node_destroy;
|
||||||
|
|
@ -102,7 +105,7 @@ resize_border(struct border_scene *border, int border_width, int width, int heig
|
||||||
wlr_scene_rect_set_size(border->bottom, width, border_width);
|
wlr_scene_rect_set_size(border->bottom, width, border_width);
|
||||||
wlr_scene_rect_set_size(border->left, border_width, height - border_width * 2);
|
wlr_scene_rect_set_size(border->left, border_width, height - border_width * 2);
|
||||||
wlr_scene_rect_set_size(border->right, border_width, height - border_width * 2);
|
wlr_scene_rect_set_size(border->right, border_width, height - border_width * 2);
|
||||||
if (border->texturedBorders != NULL) {
|
if (border->texturedBorders) {
|
||||||
renderBufferset(border->texturedBorders, width, height, 0);
|
renderBufferset(border->texturedBorders, width, height, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ cycle_osd_scroll_init(struct cycle_osd_output *osd_output, struct wlr_box bar_ar
|
||||||
int delta_y, int nr_cols, int nr_rows, int nr_visible_rows,
|
int delta_y, int nr_cols, int nr_rows, int nr_visible_rows,
|
||||||
float *border_color, float *bg_color)
|
float *border_color, float *bg_color)
|
||||||
{
|
{
|
||||||
|
|
||||||
struct theme *theme = rc.theme;
|
struct theme *theme = rc.theme;
|
||||||
|
|
||||||
if (nr_visible_rows >= nr_rows) {
|
if (nr_visible_rows >= nr_rows) {
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ static const struct option long_options[] = {
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct borderset * borderCache = NULL;
|
struct borderset *borderCache;
|
||||||
|
|
||||||
static const char labwc_usage[] =
|
static const char labwc_usage[] =
|
||||||
"Usage: labwc [options...]\n"
|
"Usage: labwc [options...]\n"
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ item_create_scene_for_state(struct menuitem *item, float *text_color,
|
||||||
{
|
{
|
||||||
struct menu *menu = item->parent;
|
struct menu *menu = item->parent;
|
||||||
struct theme *theme = rc.theme;
|
struct theme *theme = rc.theme;
|
||||||
struct bufferset * bufferset = NULL;
|
struct bufferset *bufferset = NULL;
|
||||||
|
|
||||||
/* Tree to hold background and label buffers */
|
/* Tree to hold background and label buffers */
|
||||||
struct wlr_scene_tree *tree = lab_wlr_scene_tree_create(item->tree);
|
struct wlr_scene_tree *tree = lab_wlr_scene_tree_create(item->tree);
|
||||||
|
|
@ -201,9 +201,13 @@ item_create_scene_for_state(struct menuitem *item, float *text_color,
|
||||||
float b = bg_color[2];
|
float b = bg_color[2];
|
||||||
float a = bg_color[3];
|
float a = bg_color[3];
|
||||||
|
|
||||||
|
uint32_t colour32 = (uint32_t)(a*255) << 24 |
|
||||||
uint32_t colour32 = (uint32_t)(a*255) << 24 | (uint32_t)(r*255) << 16 | (uint32_t)(g*255) << 8 | (uint32_t)(b*255);
|
(uint32_t)(r*255) << 16 |
|
||||||
struct borderset * renderedborders = getBorders(colour32, bw, rc.theme->menu_items_active_border_type, rc.theme->menu_items_active_bevel_width);
|
(uint32_t)(g*255) << 8 |
|
||||||
|
(uint32_t)(b*255);
|
||||||
|
struct borderset *renderedborders = getBorders(colour32, bw,
|
||||||
|
rc.theme->menu_items_active_border_type,
|
||||||
|
rc.theme->menu_items_active_bevel_width);
|
||||||
bufferset = generateBufferset(tree, renderedborders, bw);
|
bufferset = generateBufferset(tree, renderedborders, bw);
|
||||||
} else if (rc.theme->menu_items_border_type && !state) {
|
} else if (rc.theme->menu_items_border_type && !state) {
|
||||||
float r = bg_color[0];
|
float r = bg_color[0];
|
||||||
|
|
@ -211,16 +215,16 @@ item_create_scene_for_state(struct menuitem *item, float *text_color,
|
||||||
float b = bg_color[2];
|
float b = bg_color[2];
|
||||||
float a = bg_color[3];
|
float a = bg_color[3];
|
||||||
|
|
||||||
|
uint32_t colour32 = (uint32_t)(a*255) << 24 |
|
||||||
uint32_t colour32 = (uint32_t)(a*255) << 24 | (uint32_t)(r*255) << 16 | (uint32_t)(g*255) << 8 | (uint32_t)(b*255);
|
(uint32_t)(r*255) << 16 |
|
||||||
struct borderset * renderedborders = getBorders(colour32, bw, rc.theme->menu_items_border_type, rc.theme->menu_items_bevel_width);
|
(uint32_t)(g*255) << 8 |
|
||||||
|
(uint32_t)(b*255);
|
||||||
|
struct borderset *renderedborders = getBorders(colour32, bw,
|
||||||
|
rc.theme->menu_items_border_type,
|
||||||
|
rc.theme->menu_items_bevel_width);
|
||||||
bufferset = generateBufferset(tree, renderedborders, bw);
|
bufferset = generateBufferset(tree, renderedborders, bw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Create icon */
|
/* Create icon */
|
||||||
bool show_app_icon = !strcmp(item->parent->id, "client-list-combined-menu")
|
bool show_app_icon = !strcmp(item->parent->id, "client-list-combined-menu")
|
||||||
&& item->client_list_view;
|
&& item->client_list_view;
|
||||||
|
|
@ -249,12 +253,10 @@ item_create_scene_for_state(struct menuitem *item, float *text_color,
|
||||||
int y = (theme->menu_item_height - label_buffer->height) / 2;
|
int y = (theme->menu_item_height - label_buffer->height) / 2;
|
||||||
wlr_scene_node_set_position(&label_buffer->scene_buffer->node, x, y);
|
wlr_scene_node_set_position(&label_buffer->scene_buffer->node, x, y);
|
||||||
|
|
||||||
|
if (bufferset) {
|
||||||
if (bufferset != NULL) {
|
|
||||||
renderBufferset(bufferset, bg_width, theme->menu_item_height, 0);
|
renderBufferset(bufferset, bg_width, theme->menu_item_height, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!item->arrow) {
|
if (!item->arrow) {
|
||||||
return tree;
|
return tree;
|
||||||
}
|
}
|
||||||
|
|
@ -374,7 +376,7 @@ title_create_scene(struct menuitem *menuitem, int *item_y)
|
||||||
assert(menuitem->type == LAB_MENU_TITLE);
|
assert(menuitem->type == LAB_MENU_TITLE);
|
||||||
struct menu *menu = menuitem->parent;
|
struct menu *menu = menuitem->parent;
|
||||||
struct theme *theme = rc.theme;
|
struct theme *theme = rc.theme;
|
||||||
struct bufferset * bufferset;
|
struct bufferset *bufferset;
|
||||||
|
|
||||||
float *bg_color = theme->menu_title_bg_color;
|
float *bg_color = theme->menu_title_bg_color;
|
||||||
float *text_color = theme->menu_title_text_color;
|
float *text_color = theme->menu_title_text_color;
|
||||||
|
|
@ -395,7 +397,6 @@ title_create_scene(struct menuitem *menuitem, int *item_y)
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int bw = theme->menu_border_width;
|
int bw = theme->menu_border_width;
|
||||||
if (rc.theme->menu_title_border_type) {
|
if (rc.theme->menu_title_border_type) {
|
||||||
float r = bg_color[0];
|
float r = bg_color[0];
|
||||||
|
|
@ -403,13 +404,16 @@ title_create_scene(struct menuitem *menuitem, int *item_y)
|
||||||
float b = bg_color[2];
|
float b = bg_color[2];
|
||||||
float a = bg_color[3];
|
float a = bg_color[3];
|
||||||
|
|
||||||
|
uint32_t colour32 = (uint32_t)(a*255) << 24 |
|
||||||
uint32_t colour32 = (uint32_t)(a*255) << 24 | (uint32_t)(r*255) << 16 | (uint32_t)(g*255) << 8 | (uint32_t)(b*255);
|
(uint32_t)(r*255) << 16 |
|
||||||
struct borderset * renderedborders = getBorders(colour32, bw, rc.theme->menu_title_border_type, rc.theme->menu_title_bevel_width);
|
(uint32_t)(g*255) << 8 |
|
||||||
|
(uint32_t)(b*255);
|
||||||
|
struct borderset *renderedborders = getBorders(colour32, bw,
|
||||||
|
rc.theme->menu_title_border_type,
|
||||||
|
rc.theme->menu_title_bevel_width);
|
||||||
bufferset = generateBufferset(menuitem->tree, renderedborders, bw);
|
bufferset = generateBufferset(menuitem->tree, renderedborders, bw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Background */
|
/* Background */
|
||||||
lab_wlr_scene_rect_create(menuitem->normal_tree,
|
lab_wlr_scene_rect_create(menuitem->normal_tree,
|
||||||
bg_width, theme->menu_header_height, bg_color);
|
bg_width, theme->menu_header_height, bg_color);
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,6 @@ reload_config_and_theme(void)
|
||||||
clearBorderCache(borderCache);
|
clearBorderCache(borderCache);
|
||||||
borderCache = NULL;
|
borderCache = NULL;
|
||||||
|
|
||||||
|
|
||||||
rcxml_read(rc.config_file);
|
rcxml_read(rc.config_file);
|
||||||
theme_finish(rc.theme);
|
theme_finish(rc.theme);
|
||||||
theme_init(rc.theme, rc.theme_name);
|
theme_init(rc.theme, rc.theme_name);
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ resize_indicator_reconfigure_view(struct resize_indicator *indicator)
|
||||||
wlr_scene_rect_set_color(indicator->border, theme->osd_border_color);
|
wlr_scene_rect_set_color(indicator->border, theme->osd_border_color);
|
||||||
wlr_scene_rect_set_color(indicator->background, theme->osd_bg_color);
|
wlr_scene_rect_set_color(indicator->background, theme->osd_bg_color);
|
||||||
|
|
||||||
|
|
||||||
if (rc.theme->osd_border_type) {
|
if (rc.theme->osd_border_type) {
|
||||||
float r = theme->osd_border_color[0];
|
float r = theme->osd_border_color[0];
|
||||||
float g = theme->osd_border_color[1];
|
float g = theme->osd_border_color[1];
|
||||||
|
|
@ -47,11 +46,15 @@ resize_indicator_reconfigure_view(struct resize_indicator *indicator)
|
||||||
float a = theme->osd_border_color[3];
|
float a = theme->osd_border_color[3];
|
||||||
int bw = theme->osd_border_width;
|
int bw = theme->osd_border_width;
|
||||||
|
|
||||||
uint32_t colour32 = (uint32_t)(a*255) << 24 | (uint32_t)(r*255) << 16 | (uint32_t)(g*255) << 8 | (uint32_t)(b*255);
|
uint32_t colour32 = (uint32_t)(a*255) << 24 |
|
||||||
struct borderset * renderedborders = getBorders(colour32, bw, theme->osd_border_type, theme->osd_border_bevel_width);
|
(uint32_t)(r*255) << 16 |
|
||||||
indicator->texturedBorders = generateBufferset(indicator->tree, renderedborders, bw);
|
(uint32_t)(g*255) << 8 |
|
||||||
|
(uint32_t)(b*255);
|
||||||
|
struct borderset *renderedborders = getBorders(colour32, bw, theme->osd_border_type,
|
||||||
|
theme->osd_border_bevel_width);
|
||||||
|
indicator->texturedBorders = generateBufferset(indicator->tree,
|
||||||
|
renderedborders, bw);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
@ -67,10 +70,8 @@ resize_indicator_init(struct view *view)
|
||||||
indicator->background = lab_wlr_scene_rect_create(
|
indicator->background = lab_wlr_scene_rect_create(
|
||||||
indicator->tree, 0, 0, rc.theme->osd_bg_color);
|
indicator->tree, 0, 0, rc.theme->osd_bg_color);
|
||||||
|
|
||||||
|
|
||||||
indicator->text = scaled_font_buffer_create(indicator->tree);
|
indicator->text = scaled_font_buffer_create(indicator->tree);
|
||||||
|
|
||||||
|
|
||||||
wlr_scene_node_set_enabled(&indicator->tree->node, false);
|
wlr_scene_node_set_enabled(&indicator->tree->node, false);
|
||||||
resize_indicator_reconfigure_view(indicator);
|
resize_indicator_reconfigure_view(indicator);
|
||||||
}
|
}
|
||||||
|
|
@ -140,7 +141,8 @@ resize_indicator_set_size(struct resize_indicator *indicator, int width)
|
||||||
indicator->height - 2 * rc.theme->osd_border_width);
|
indicator->height - 2 * rc.theme->osd_border_width);
|
||||||
|
|
||||||
if (rc.theme->osd_border_type) {
|
if (rc.theme->osd_border_type) {
|
||||||
renderBufferset(indicator->texturedBorders, indicator->width, indicator->height, 0);
|
renderBufferset(indicator->texturedBorders, indicator->width,
|
||||||
|
indicator->height, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,6 @@
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
#include "common/borderset.h"
|
#include "common/borderset.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
ssd_border_create(struct ssd *ssd)
|
ssd_border_create(struct ssd *ssd)
|
||||||
{
|
{
|
||||||
|
|
@ -40,16 +38,11 @@ ssd_border_create(struct ssd *ssd)
|
||||||
wlr_scene_node_set_enabled(&parent->node, active);
|
wlr_scene_node_set_enabled(&parent->node, active);
|
||||||
float *color = theme->window[active].border_color;
|
float *color = theme->window[active].border_color;
|
||||||
if (theme->window[active].border_type) {
|
if (theme->window[active].border_type) {
|
||||||
|
|
||||||
// These will otherwise get left under the window when we reload
|
// These will otherwise get left under the window when we reload
|
||||||
|
|
||||||
subtree->left = lab_wlr_scene_rect_create(parent, 1, 1, color);
|
subtree->left = lab_wlr_scene_rect_create(parent, 1, 1, color);
|
||||||
|
|
||||||
|
|
||||||
subtree->right = lab_wlr_scene_rect_create(parent, 1, 1, color);
|
subtree->right = lab_wlr_scene_rect_create(parent, 1, 1, color);
|
||||||
|
|
||||||
subtree->bottom = lab_wlr_scene_rect_create(parent, 1, 1, color);
|
subtree->bottom = lab_wlr_scene_rect_create(parent, 1, 1, color);
|
||||||
|
|
||||||
subtree->top = lab_wlr_scene_rect_create(parent, 1, 1, color);
|
subtree->top = lab_wlr_scene_rect_create(parent, 1, 1, color);
|
||||||
|
|
||||||
/* From Pull request 3382 */
|
/* From Pull request 3382 */
|
||||||
|
|
@ -58,37 +51,36 @@ ssd_border_create(struct ssd *ssd)
|
||||||
float b = color[2];
|
float b = color[2];
|
||||||
float a = color[3];
|
float a = color[3];
|
||||||
|
|
||||||
uint32_t colour32 = (uint32_t)(a*255) << 24 | (uint32_t)(r*255) << 16 | (uint32_t)(g*255) << 8 | (uint32_t)(b*255);
|
uint32_t colour32 = (uint32_t)(a*255) << 24 |
|
||||||
struct borderset * renderedborders = getBorders(colour32, bw, theme->window[active].border_type, theme->window[active].bevel_width);
|
(uint32_t)(r*255) << 16 |
|
||||||
subtree->texturedBorders = generateBufferset(subtree->tree, renderedborders, bw);
|
(uint32_t)(g*255) << 8 |
|
||||||
|
(uint32_t)(b*255);
|
||||||
|
struct borderset *renderedborders = getBorders(colour32, bw,
|
||||||
|
theme->window[active].border_type,
|
||||||
|
theme->window[active].bevel_width);
|
||||||
|
subtree->texturedBorders = generateBufferset(subtree->tree,
|
||||||
|
renderedborders, bw);
|
||||||
} else {
|
} else {
|
||||||
subtree->left = lab_wlr_scene_rect_create(parent,
|
subtree->left = lab_wlr_scene_rect_create(parent,
|
||||||
theme->border_width, height, color);
|
theme->border_width, height, color);
|
||||||
|
|
||||||
subtree->right = lab_wlr_scene_rect_create(parent,
|
subtree->right = lab_wlr_scene_rect_create(parent,
|
||||||
theme->border_width, height, color);
|
theme->border_width, height, color);
|
||||||
|
|
||||||
subtree->bottom = lab_wlr_scene_rect_create(parent,
|
subtree->bottom = lab_wlr_scene_rect_create(parent,
|
||||||
full_width, theme->border_width, color);
|
full_width, theme->border_width, color);
|
||||||
|
|
||||||
subtree->top = lab_wlr_scene_rect_create(parent,
|
subtree->top = lab_wlr_scene_rect_create(parent,
|
||||||
MAX(width - 2 * corner_width, 0), theme->border_width, color);
|
MAX(width - 2 * corner_width, 0), theme->border_width, color);
|
||||||
|
|
||||||
wlr_scene_node_set_position(&subtree->left->node, 0, 0);
|
wlr_scene_node_set_position(&subtree->left->node, 0, 0);
|
||||||
wlr_scene_node_set_position(&subtree->right->node,
|
wlr_scene_node_set_position(&subtree->right->node,
|
||||||
theme->border_width + width, 0);
|
theme->border_width + width, 0);
|
||||||
wlr_scene_node_set_position(&subtree->bottom->node,
|
wlr_scene_node_set_position(&subtree->bottom->node,
|
||||||
0, height);
|
0, height);
|
||||||
|
|
||||||
wlr_scene_node_set_position(&subtree->top->node,
|
wlr_scene_node_set_position(&subtree->top->node,
|
||||||
theme->border_width + corner_width,
|
theme->border_width + corner_width,
|
||||||
-(ssd->titlebar.height + theme->border_width));
|
-(ssd->titlebar.height + theme->border_width));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (view->maximized == VIEW_AXIS_BOTH) {
|
if (view->maximized == VIEW_AXIS_BOTH) {
|
||||||
wlr_scene_node_set_enabled(&ssd->border.tree->node, false);
|
wlr_scene_node_set_enabled(&ssd->border.tree->node, false);
|
||||||
}
|
}
|
||||||
|
|
@ -166,10 +158,10 @@ ssd_border_update(struct ssd *ssd)
|
||||||
enum ssd_active_state active;
|
enum ssd_active_state active;
|
||||||
FOR_EACH_ACTIVE_STATE(active) {
|
FOR_EACH_ACTIVE_STATE(active) {
|
||||||
struct ssd_border_subtree *subtree = &ssd->border.subtrees[active];
|
struct ssd_border_subtree *subtree = &ssd->border.subtrees[active];
|
||||||
|
|
||||||
|
|
||||||
if (theme->window[active].border_type) {
|
if (theme->window[active].border_type) {
|
||||||
renderBufferset(subtree->texturedBorders, full_width, side_height+(ssd->titlebar.height + 2*theme->border_width), -ssd->titlebar.height-theme->border_width);
|
renderBufferset(subtree->texturedBorders, full_width,
|
||||||
|
side_height+(ssd->titlebar.height + 2*theme->border_width),
|
||||||
|
-ssd->titlebar.height-theme->border_width);
|
||||||
} else {
|
} else {
|
||||||
wlr_scene_rect_set_size(subtree->left,
|
wlr_scene_rect_set_size(subtree->left,
|
||||||
theme->border_width, side_height);
|
theme->border_width, side_height);
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ ssd_titlebar_create(struct ssd *ssd)
|
||||||
LAB_NODE_TITLEBAR, view, /*data*/ NULL);
|
LAB_NODE_TITLEBAR, view, /*data*/ NULL);
|
||||||
|
|
||||||
enum ssd_active_state active;
|
enum ssd_active_state active;
|
||||||
bool shouldForceUpdate = FALSE;
|
bool should_force_update = FALSE;
|
||||||
FOR_EACH_ACTIVE_STATE(active) {
|
FOR_EACH_ACTIVE_STATE(active) {
|
||||||
struct ssd_titlebar_subtree *subtree = &ssd->titlebar.subtrees[active];
|
struct ssd_titlebar_subtree *subtree = &ssd->titlebar.subtrees[active];
|
||||||
subtree->tree = lab_wlr_scene_tree_create(ssd->titlebar.tree);
|
subtree->tree = lab_wlr_scene_tree_create(ssd->titlebar.tree);
|
||||||
|
|
@ -62,13 +62,21 @@ ssd_titlebar_create(struct ssd *ssd)
|
||||||
float b = color[2];
|
float b = color[2];
|
||||||
float a = color[3];
|
float a = color[3];
|
||||||
|
|
||||||
uint32_t colour32 = (uint32_t)(a*255) << 24 | (uint32_t)(r*255) << 16 | (uint32_t)(g*255) << 8 | (uint32_t)(b*255);
|
uint32_t colour32 = (uint32_t)(a*255) << 24 |
|
||||||
struct borderset * renderedborders = getBorders(colour32, theme->window[active].title_bg.border_width, theme->window[active].title_bg.border_type, theme->window[active].title_bg.bevel_width);
|
(uint32_t)(r*255) << 16 |
|
||||||
subtree->texturedBorders = generateBufferset(subtree->tree, renderedborders, theme->window[active].title_bg.border_width);
|
(uint32_t)(g*255) << 8 |
|
||||||
|
(uint32_t)(b*255);
|
||||||
|
struct borderset *renderedborders = getBorders(colour32,
|
||||||
|
theme->window[active].title_bg.border_width,
|
||||||
|
theme->window[active].title_bg.border_type,
|
||||||
|
theme->window[active].title_bg.bevel_width);
|
||||||
|
subtree->texturedBorders = generateBufferset(subtree->tree, renderedborders,
|
||||||
|
theme->window[active].title_bg.border_width);
|
||||||
|
|
||||||
// If we have the beveled borders, we actually have to run ssd_titlebar_update() to make sure we render the updated
|
// If we have the beveled borders, we actually have to run
|
||||||
// borders. Otherwise they disappear on reconfigure
|
// ssd_titlebar_update() to make sure we render the updated borders.
|
||||||
shouldForceUpdate = true;
|
// Otherwise they disappear on reconfigure
|
||||||
|
should_force_update = true;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Work around the wlroots/pixman bug that widened 1px buffer
|
* Work around the wlroots/pixman bug that widened 1px buffer
|
||||||
|
|
@ -92,7 +100,8 @@ ssd_titlebar_create(struct ssd *ssd)
|
||||||
|
|
||||||
/* Title */
|
/* Title */
|
||||||
if (theme->window[active].title_bg.border_type) {
|
if (theme->window[active].title_bg.border_type) {
|
||||||
// Use a blank background pattern so it doesn't overlay a pattern on the order.
|
// Use a blank background pattern so it doesn't overlay
|
||||||
|
// a pattern on the order.
|
||||||
subtree->title = scaled_font_buffer_create_for_titlebar(
|
subtree->title = scaled_font_buffer_create_for_titlebar(
|
||||||
subtree->tree, theme->titlebar_height,
|
subtree->tree, theme->titlebar_height,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
@ -147,7 +156,10 @@ ssd_titlebar_create(struct ssd *ssd)
|
||||||
if (squared) {
|
if (squared) {
|
||||||
ssd->state.was_squared = true;
|
ssd->state.was_squared = true;
|
||||||
}
|
}
|
||||||
set_squared_corners(ssd, maximized || squared || theme->window[SSD_ACTIVE].title_bg.border_type || theme->window[SSD_INACTIVE].title_bg.border_type);
|
set_squared_corners(ssd, maximized ||
|
||||||
|
squared ||
|
||||||
|
theme->window[SSD_ACTIVE].title_bg.border_type ||
|
||||||
|
theme->window[SSD_INACTIVE].title_bg.border_type);
|
||||||
|
|
||||||
if (view->shaded) {
|
if (view->shaded) {
|
||||||
set_alt_button_icon(ssd, LAB_NODE_BUTTON_SHADE, true);
|
set_alt_button_icon(ssd, LAB_NODE_BUTTON_SHADE, true);
|
||||||
|
|
@ -157,7 +169,7 @@ ssd_titlebar_create(struct ssd *ssd)
|
||||||
set_alt_button_icon(ssd, LAB_NODE_BUTTON_OMNIPRESENT, true);
|
set_alt_button_icon(ssd, LAB_NODE_BUTTON_OMNIPRESENT, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldForceUpdate) {
|
if (should_force_update) {
|
||||||
ssd_titlebar_update(ssd);
|
ssd_titlebar_update(ssd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -309,7 +321,10 @@ ssd_titlebar_update(struct ssd *ssd)
|
||||||
|
|
||||||
if (ssd->state.was_maximized != maximized
|
if (ssd->state.was_maximized != maximized
|
||||||
|| ssd->state.was_squared != squared) {
|
|| ssd->state.was_squared != squared) {
|
||||||
set_squared_corners(ssd, maximized || squared || theme->window[SSD_ACTIVE].title_bg.border_type || theme->window[SSD_INACTIVE].title_bg.border_type);
|
set_squared_corners(ssd, maximized ||
|
||||||
|
squared ||
|
||||||
|
theme->window[SSD_ACTIVE].title_bg.border_type ||
|
||||||
|
theme->window[SSD_INACTIVE].title_bg.border_type);
|
||||||
if (ssd->state.was_maximized != maximized) {
|
if (ssd->state.was_maximized != maximized) {
|
||||||
set_alt_button_icon(ssd, LAB_NODE_BUTTON_MAXIMIZE, maximized);
|
set_alt_button_icon(ssd, LAB_NODE_BUTTON_MAXIMIZE, maximized);
|
||||||
}
|
}
|
||||||
|
|
@ -337,7 +352,11 @@ ssd_titlebar_update(struct ssd *ssd)
|
||||||
/* Center buttons vertically within titlebar */
|
/* Center buttons vertically within titlebar */
|
||||||
int y = (theme->titlebar_height - theme->window_button_height) / 2;
|
int y = (theme->titlebar_height - theme->window_button_height) / 2;
|
||||||
int x;
|
int x;
|
||||||
int bg_offset = (maximized || squared || theme->window[SSD_INACTIVE].title_bg.border_type || theme->window[SSD_ACTIVE].title_bg.border_type) ? 0 : corner_width;
|
int bg_offset = (maximized ||
|
||||||
|
squared ||
|
||||||
|
theme->window[SSD_INACTIVE].title_bg.border_type ||
|
||||||
|
theme->window[SSD_ACTIVE].title_bg.border_type)
|
||||||
|
? 0 : corner_width;
|
||||||
|
|
||||||
enum ssd_active_state active;
|
enum ssd_active_state active;
|
||||||
FOR_EACH_ACTIVE_STATE(active) {
|
FOR_EACH_ACTIVE_STATE(active) {
|
||||||
|
|
@ -349,7 +368,6 @@ ssd_titlebar_update(struct ssd *ssd)
|
||||||
struct ssd_button *button;
|
struct ssd_button *button;
|
||||||
int button_count = 0;
|
int button_count = 0;
|
||||||
|
|
||||||
|
|
||||||
wl_list_for_each(button, &subtree->buttons_left, link) {
|
wl_list_for_each(button, &subtree->buttons_left, link) {
|
||||||
wlr_scene_node_set_position(button->node, x, y);
|
wlr_scene_node_set_position(button->node, x, y);
|
||||||
x += theme->window_button_width + theme->window_button_spacing;
|
x += theme->window_button_width + theme->window_button_spacing;
|
||||||
|
|
@ -357,7 +375,6 @@ ssd_titlebar_update(struct ssd *ssd)
|
||||||
}
|
}
|
||||||
int exclusive_x = x;
|
int exclusive_x = x;
|
||||||
|
|
||||||
|
|
||||||
x = width - corner_width;
|
x = width - corner_width;
|
||||||
wlr_scene_node_set_position(&subtree->corner_right->node,
|
wlr_scene_node_set_position(&subtree->corner_right->node,
|
||||||
x, -rc.theme->border_width);
|
x, -rc.theme->border_width);
|
||||||
|
|
@ -369,18 +386,23 @@ ssd_titlebar_update(struct ssd *ssd)
|
||||||
button_count++;
|
button_count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (theme->window[active].title_bg.border_type) {
|
if (theme->window[active].title_bg.border_type) {
|
||||||
int titlebar_x = 0;
|
int titlebar_x = 0;
|
||||||
int titlebar_width = MAX(view->current.width, 0);
|
int titlebar_width = MAX(view->current.width, 0);
|
||||||
if (theme->window[active].title_bg.exclusive) {
|
if (theme->window[active].title_bg.exclusive) {
|
||||||
titlebar_x = exclusive_x+theme->window_titlebar_padding_width;
|
titlebar_x = exclusive_x+theme->window_titlebar_padding_width;
|
||||||
titlebar_width = MAX((theme->window_button_width + theme->window_button_spacing)* button_count, titlebar_width - (theme->window_button_width + theme->window_button_spacing)* button_count);
|
titlebar_width = MAX(
|
||||||
|
(theme->window_button_width + theme->window_button_spacing)
|
||||||
|
* button_count,
|
||||||
|
titlebar_width -
|
||||||
|
(theme->window_button_width + theme->window_button_spacing)
|
||||||
|
* button_count
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
renderBuffersetXY(subtree->texturedBorders, titlebar_width, theme->titlebar_height, titlebar_x, 0);
|
renderBuffersetXY(subtree->texturedBorders, titlebar_width,
|
||||||
|
theme->titlebar_height, titlebar_x, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ssd_update_title(ssd);
|
ssd_update_title(ssd);
|
||||||
|
|
|
||||||
116
src/theme.c
116
src/theme.c
|
|
@ -91,7 +91,7 @@ draw_hover_overlay_on_button(cairo_t *cairo, int w, int h)
|
||||||
cairo_fill(cairo);
|
cairo_fill(cairo);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_beveled_border_on_button(cairo_t* cairo, int w, int h, int active, int hover)
|
static void draw_beveled_border_on_button(cairo_t *cairo, int w, int h, int active, int hover)
|
||||||
{
|
{
|
||||||
if (rc.theme->window[active].button_border_type) {
|
if (rc.theme->window[active].button_border_type) {
|
||||||
int bw = rc.theme->window[active].button_border_width;
|
int bw = rc.theme->window[active].button_border_width;
|
||||||
|
|
@ -108,9 +108,13 @@ static void draw_beveled_border_on_button(cairo_t* cairo, int w, int h, int acti
|
||||||
a = rc.theme->window[active].button_hover_border_color[3];
|
a = rc.theme->window[active].button_hover_border_color[3];
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t colour32 = (uint32_t)(a*255) << 24 | (uint32_t)(r*255) << 16 | (uint32_t)(g*255) << 8 | (uint32_t)(b*255);
|
uint32_t colour32 = (uint32_t)(a*255) << 24 |
|
||||||
struct borderset * renderedborders = getBorders(colour32, bw, rc.theme->window[active].button_border_type, rc.theme->window[active].button_bevel_width);
|
(uint32_t)(r*255) << 16 |
|
||||||
|
(uint32_t)(g*255) << 8 |
|
||||||
|
(uint32_t)(b*255);
|
||||||
|
struct borderset *renderedborders = getBorders(colour32, bw,
|
||||||
|
rc.theme->window[active].button_border_type,
|
||||||
|
rc.theme->window[active].button_bevel_width);
|
||||||
|
|
||||||
cairo_set_source_surface(cairo, renderedborders->top->surface, 0, 0);
|
cairo_set_source_surface(cairo, renderedborders->top->surface, 0, 0);
|
||||||
cairo_pattern_set_extend(cairo_get_source(cairo), CAIRO_EXTEND_REPEAT);
|
cairo_pattern_set_extend(cairo_get_source(cairo), CAIRO_EXTEND_REPEAT);
|
||||||
|
|
@ -122,21 +126,16 @@ static void draw_beveled_border_on_button(cairo_t* cairo, int w, int h, int acti
|
||||||
cairo_rectangle(cairo, bw, h-bw, w-bw*2, bw);
|
cairo_rectangle(cairo, bw, h-bw, w-bw*2, bw);
|
||||||
cairo_fill(cairo);
|
cairo_fill(cairo);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cairo_set_source_surface(cairo, renderedborders->left->surface, 0, 0);
|
cairo_set_source_surface(cairo, renderedborders->left->surface, 0, 0);
|
||||||
cairo_pattern_set_extend(cairo_get_source(cairo), CAIRO_EXTEND_REPEAT);
|
cairo_pattern_set_extend(cairo_get_source(cairo), CAIRO_EXTEND_REPEAT);
|
||||||
cairo_rectangle(cairo, 0, bw, bw, h-bw*2);
|
cairo_rectangle(cairo, 0, bw, bw, h-bw*2);
|
||||||
cairo_fill(cairo);
|
cairo_fill(cairo);
|
||||||
|
|
||||||
|
|
||||||
cairo_set_source_surface(cairo, renderedborders->right->surface, w-bw, bw);
|
cairo_set_source_surface(cairo, renderedborders->right->surface, w-bw, bw);
|
||||||
cairo_pattern_set_extend(cairo_get_source(cairo), CAIRO_EXTEND_REPEAT);
|
cairo_pattern_set_extend(cairo_get_source(cairo), CAIRO_EXTEND_REPEAT);
|
||||||
cairo_rectangle(cairo, w-bw, bw, bw, h-bw*2);
|
cairo_rectangle(cairo, w-bw, bw, bw, h-bw*2);
|
||||||
cairo_fill(cairo);
|
cairo_fill(cairo);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cairo_set_source_surface(cairo, renderedborders->tl->surface, 0, 0);
|
cairo_set_source_surface(cairo, renderedborders->tl->surface, 0, 0);
|
||||||
cairo_rectangle(cairo, 0, 0, bw, bw);
|
cairo_rectangle(cairo, 0, 0, bw, bw);
|
||||||
cairo_fill(cairo);
|
cairo_fill(cairo);
|
||||||
|
|
@ -175,8 +174,6 @@ static void draw_nonhover_inactive_border_on_button(cairo_t *cairo, int w, int h
|
||||||
draw_beveled_border_on_button(cairo, w, h, SSD_INACTIVE, 0);
|
draw_beveled_border_on_button(cairo, w, h, SSD_INACTIVE, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Round the buffer for the leftmost button in the titlebar */
|
/* Round the buffer for the leftmost button in the titlebar */
|
||||||
static void
|
static void
|
||||||
round_left_corner_button(cairo_t *cairo, int w, int h)
|
round_left_corner_button(cairo_t *cairo, int w, int h)
|
||||||
|
|
@ -308,16 +305,15 @@ load_button(struct theme *theme, struct button *b, enum ssd_active_state active)
|
||||||
draw_hover_overlay_on_button);
|
draw_hover_overlay_on_button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (theme->window[active].button_border_type) {
|
if (theme->window[active].button_border_type) {
|
||||||
if (active) {
|
if (active) {
|
||||||
if (b->state_set & LAB_BS_HOVERED) {
|
if (b->state_set & LAB_BS_HOVERED) {
|
||||||
lab_img_add_modifier(*img, draw_hover_active_border_on_button);
|
lab_img_add_modifier(*img, draw_hover_active_border_on_button);
|
||||||
} else {
|
} else {
|
||||||
lab_img_add_modifier(*img, draw_nonhover_active_border_on_button);
|
lab_img_add_modifier(*img, draw_nonhover_active_border_on_button);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (b->state_set & LAB_BS_HOVERED) {
|
if (b->state_set & LAB_BS_HOVERED) {
|
||||||
lab_img_add_modifier(*img, draw_hover_inactive_border_on_button);
|
lab_img_add_modifier(*img, draw_hover_inactive_border_on_button);
|
||||||
} else {
|
} else {
|
||||||
lab_img_add_modifier(*img, draw_nonhover_inactive_border_on_button);
|
lab_img_add_modifier(*img, draw_nonhover_inactive_border_on_button);
|
||||||
|
|
@ -552,15 +548,23 @@ parse_hexstrs(const char *hexes, float colors[3][4])
|
||||||
g_strfreev(elements);
|
g_strfreev(elements);
|
||||||
}
|
}
|
||||||
|
|
||||||
static enum border_type parse_border_type(const char *str) {
|
static enum border_type parse_border_type(const char *str)
|
||||||
|
{
|
||||||
char *lower = g_ascii_strdown(str, -1);
|
char *lower = g_ascii_strdown(str, -1);
|
||||||
enum border_type border_type;
|
enum border_type border_type;
|
||||||
if (strstr(lower, "doublesunken")) border_type = BORDER_DOUBLE_INSET;
|
if (strstr(lower, "doublesunken")) {
|
||||||
else if (strstr(lower, "sunken")) border_type = BORDER_INSET;
|
border_type = BORDER_DOUBLE_INSET;
|
||||||
else if (strstr(lower, "doubleraised")) border_type = BORDER_DOUBLE;
|
} else if (strstr(lower, "sunken")) {
|
||||||
else if (strstr(lower, "raised")) border_type = BORDER_SINGLE;
|
border_type = BORDER_INSET;
|
||||||
else if (strstr(lower, "flat")) border_type = BORDER_FLAT;
|
} else if (strstr(lower, "doubleraised")) {
|
||||||
else border_type = BORDER_NONE;
|
border_type = BORDER_DOUBLE;
|
||||||
|
} else if (strstr(lower, "raised")) {
|
||||||
|
border_type = BORDER_SINGLE;
|
||||||
|
} else if (strstr(lower, "flat")) {
|
||||||
|
border_type = BORDER_FLAT;
|
||||||
|
} else {
|
||||||
|
border_type = BORDER_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
g_free(lower);
|
g_free(lower);
|
||||||
return border_type;
|
return border_type;
|
||||||
|
|
@ -678,18 +682,17 @@ theme_builtin(struct theme *theme)
|
||||||
theme->window[SSD_INACTIVE].title_bg.border_width = 0;
|
theme->window[SSD_INACTIVE].title_bg.border_width = 0;
|
||||||
theme->window[SSD_INACTIVE].title_bg.exclusive = FALSE;
|
theme->window[SSD_INACTIVE].title_bg.exclusive = FALSE;
|
||||||
theme->window[SSD_INACTIVE].title_bg.border_type = BORDER_NONE;
|
theme->window[SSD_INACTIVE].title_bg.border_type = BORDER_NONE;
|
||||||
theme->window[SSD_ACTIVE].button_border_type=BORDER_NONE;
|
theme->window[SSD_ACTIVE].button_border_type = BORDER_NONE;
|
||||||
theme->window[SSD_ACTIVE].button_border_width=0;
|
theme->window[SSD_ACTIVE].button_border_width = 0;
|
||||||
theme->window[SSD_ACTIVE].button_bevel_width=0;
|
theme->window[SSD_ACTIVE].button_bevel_width = 0;
|
||||||
theme->window[SSD_ACTIVE].button_border_color[0] = FLT_MIN;
|
theme->window[SSD_ACTIVE].button_border_color[0] = FLT_MIN;
|
||||||
theme->window[SSD_ACTIVE].button_hover_border_color[0] = FLT_MIN;
|
theme->window[SSD_ACTIVE].button_hover_border_color[0] = FLT_MIN;
|
||||||
theme->window[SSD_INACTIVE].button_border_type=BORDER_NONE;
|
theme->window[SSD_INACTIVE].button_border_type = BORDER_NONE;
|
||||||
theme->window[SSD_INACTIVE].button_border_width=0;
|
theme->window[SSD_INACTIVE].button_border_width = 0;
|
||||||
theme->window[SSD_INACTIVE].button_bevel_width=0;
|
theme->window[SSD_INACTIVE].button_bevel_width = 0;
|
||||||
theme->window[SSD_INACTIVE].button_border_color[0] = FLT_MIN;
|
theme->window[SSD_INACTIVE].button_border_color[0] = FLT_MIN;
|
||||||
theme->window[SSD_INACTIVE].button_hover_border_color[0] = FLT_MIN;
|
theme->window[SSD_INACTIVE].button_hover_border_color[0] = FLT_MIN;
|
||||||
|
|
||||||
|
|
||||||
parse_hexstr("#000000", theme->window[SSD_ACTIVE].label_text_color);
|
parse_hexstr("#000000", theme->window[SSD_ACTIVE].label_text_color);
|
||||||
parse_hexstr("#000000", theme->window[SSD_INACTIVE].label_text_color);
|
parse_hexstr("#000000", theme->window[SSD_INACTIVE].label_text_color);
|
||||||
theme->window_label_text_justify = parse_justification("Center");
|
theme->window_label_text_justify = parse_justification("Center");
|
||||||
|
|
@ -861,17 +864,19 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match_glob(key, "window.active.title.bg") && parse_border_type(value)) {
|
if (match_glob(key, "window.active.title.bg") && parse_border_type(value)) {
|
||||||
theme->window[SSD_ACTIVE].title_bg.border_type= parse_border_type(value);
|
theme->window[SSD_ACTIVE].title_bg.border_type = parse_border_type(value);
|
||||||
}
|
}
|
||||||
if (match_glob(key, "window.active.title.bg.width")) {
|
if (match_glob(key, "window.active.title.bg.width")) {
|
||||||
theme->window[SSD_ACTIVE].title_bg.border_width = get_int_if_positive(value, "window.active.title.bg.width");
|
theme->window[SSD_ACTIVE].title_bg.border_width =
|
||||||
|
get_int_if_positive(value, "window.active.title.bg.width");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match_glob(key, "window.active.title.bg.exclusive")) {
|
if (match_glob(key, "window.active.title.bg.exclusive")) {
|
||||||
set_bool(value, &theme->window[SSD_ACTIVE].title_bg.exclusive);
|
set_bool(value, &theme->window[SSD_ACTIVE].title_bg.exclusive);
|
||||||
}
|
}
|
||||||
if (match_glob(key, "window.active.title.bg.bevel-width")) {
|
if (match_glob(key, "window.active.title.bg.bevel-width")) {
|
||||||
theme->window[SSD_ACTIVE].title_bg.bevel_width = get_int_if_positive(value, "window.active.title.bg.bevel-width");
|
theme->window[SSD_ACTIVE].title_bg.bevel_width =
|
||||||
|
get_int_if_positive(value, "window.active.title.bg.bevel-width");
|
||||||
}
|
}
|
||||||
if (match_glob(key, "window.active.border.color")) {
|
if (match_glob(key, "window.active.border.color")) {
|
||||||
parse_color(value, theme->window[SSD_ACTIVE].border_color);
|
parse_color(value, theme->window[SSD_ACTIVE].border_color);
|
||||||
|
|
@ -881,7 +886,8 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
theme->window[SSD_ACTIVE].border_type = parse_border_type(value);
|
theme->window[SSD_ACTIVE].border_type = parse_border_type(value);
|
||||||
}
|
}
|
||||||
if (match_glob(key, "window.active.border.bevel-width")) {
|
if (match_glob(key, "window.active.border.bevel-width")) {
|
||||||
theme->window[SSD_ACTIVE].bevel_width = get_int_if_positive(value, "window.active.border.bevel-width");
|
theme->window[SSD_ACTIVE].bevel_width =
|
||||||
|
get_int_if_positive(value, "window.active.border.bevel-width");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match_glob(key, "window.inactive.border.color")) {
|
if (match_glob(key, "window.inactive.border.color")) {
|
||||||
|
|
@ -889,7 +895,8 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match_glob(key, "window.inactive.border.bevel-width")) {
|
if (match_glob(key, "window.inactive.border.bevel-width")) {
|
||||||
theme->window[SSD_INACTIVE].bevel_width = get_int_if_positive(value, "window.inactive.border.bevel-width");
|
theme->window[SSD_INACTIVE].bevel_width =
|
||||||
|
get_int_if_positive(value, "window.inactive.border.bevel-width");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match_glob(key, "window.inactive.border.type")) {
|
if (match_glob(key, "window.inactive.border.type")) {
|
||||||
|
|
@ -909,21 +916,21 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
theme->window[SSD_ACTIVE].title_bg.gradient = parse_gradient(value);
|
theme->window[SSD_ACTIVE].title_bg.gradient = parse_gradient(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (match_glob(key, "window.inactive.title.bg") && parse_border_type(value)) {
|
if (match_glob(key, "window.inactive.title.bg") && parse_border_type(value)) {
|
||||||
theme->window[SSD_INACTIVE].title_bg.border_type= parse_border_type(value);
|
theme->window[SSD_INACTIVE].title_bg.border_type = parse_border_type(value);
|
||||||
}
|
}
|
||||||
if (match_glob(key, "window.inactive.title.bg.width")) {
|
if (match_glob(key, "window.inactive.title.bg.width")) {
|
||||||
theme->window[SSD_INACTIVE].title_bg.border_width = get_int_if_positive(value, "window.inactive.title.bg.width");
|
theme->window[SSD_INACTIVE].title_bg.border_width =
|
||||||
|
get_int_if_positive(value, "window.inactive.title.bg.width");
|
||||||
}
|
}
|
||||||
if (match_glob(key, "window.inactive.title.bg.bevel-width")) {
|
if (match_glob(key, "window.inactive.title.bg.bevel-width")) {
|
||||||
theme->window[SSD_INACTIVE].title_bg.bevel_width = get_int_if_positive(value, "window.inactive.title.bg.bevel-width");
|
theme->window[SSD_INACTIVE].title_bg.bevel_width =
|
||||||
|
get_int_if_positive(value, "window.inactive.title.bg.bevel-width");
|
||||||
}
|
}
|
||||||
if (match_glob(key, "window.inactive.title.bg.exclusive")) {
|
if (match_glob(key, "window.inactive.title.bg.exclusive")) {
|
||||||
set_bool(value, &theme->window[SSD_INACTIVE].title_bg.exclusive);
|
set_bool(value, &theme->window[SSD_INACTIVE].title_bg.exclusive);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (match_glob(key, "window.inactive.title.bg")) {
|
if (match_glob(key, "window.inactive.title.bg")) {
|
||||||
theme->window[SSD_INACTIVE].title_bg.gradient = parse_gradient(value);
|
theme->window[SSD_INACTIVE].title_bg.gradient = parse_gradient(value);
|
||||||
}
|
}
|
||||||
|
|
@ -984,13 +991,15 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match_glob(key, "window.inactive.button.bg") && parse_border_type(value)) {
|
if (match_glob(key, "window.inactive.button.bg") && parse_border_type(value)) {
|
||||||
theme->window[SSD_INACTIVE].button_border_type= parse_border_type(value);
|
theme->window[SSD_INACTIVE].button_border_type = parse_border_type(value);
|
||||||
}
|
}
|
||||||
if (match_glob(key, "window.inactive.button.bg.width")) {
|
if (match_glob(key, "window.inactive.button.bg.width")) {
|
||||||
theme->window[SSD_INACTIVE].button_border_width = get_int_if_positive(value, "window.inactive.button.bg.width");
|
theme->window[SSD_INACTIVE].button_border_width =
|
||||||
|
get_int_if_positive(value, "window.inactive.button.bg.width");
|
||||||
}
|
}
|
||||||
if (match_glob(key, "window.inactive.button.bg.bevel-width")) {
|
if (match_glob(key, "window.inactive.button.bg.bevel-width")) {
|
||||||
theme->window[SSD_INACTIVE].button_bevel_width = get_int_if_positive(value, "window.inactive.button.bg.bevel-width");
|
theme->window[SSD_INACTIVE].button_bevel_width =
|
||||||
|
get_int_if_positive(value, "window.inactive.button.bg.bevel-width");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match_glob(key, "window.inactive.button.bg.border-color")) {
|
if (match_glob(key, "window.inactive.button.bg.border-color")) {
|
||||||
|
|
@ -1002,13 +1011,15 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match_glob(key, "window.active.button.bg") && parse_border_type(value)) {
|
if (match_glob(key, "window.active.button.bg") && parse_border_type(value)) {
|
||||||
theme->window[SSD_ACTIVE].button_border_type= parse_border_type(value);
|
theme->window[SSD_ACTIVE].button_border_type = parse_border_type(value);
|
||||||
}
|
}
|
||||||
if (match_glob(key, "window.active.button.bg.width")) {
|
if (match_glob(key, "window.active.button.bg.width")) {
|
||||||
theme->window[SSD_ACTIVE].button_border_width = get_int_if_positive(value, "window.active.button.bg.width");
|
theme->window[SSD_ACTIVE].button_border_width =
|
||||||
|
get_int_if_positive(value, "window.active.button.bg.width");
|
||||||
}
|
}
|
||||||
if (match_glob(key, "window.inactive.button.bg.bevel-width")) {
|
if (match_glob(key, "window.inactive.button.bg.bevel-width")) {
|
||||||
theme->window[SSD_ACTIVE].button_bevel_width = get_int_if_positive(value, "window.active.button.bg.bevel-width");
|
theme->window[SSD_ACTIVE].button_bevel_width =
|
||||||
|
get_int_if_positive(value, "window.active.button.bg.bevel-width");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match_glob(key, "window.active.button.bg.border-color")) {
|
if (match_glob(key, "window.active.button.bg.border-color")) {
|
||||||
|
|
@ -1019,8 +1030,6 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
parse_color(value, theme->window[SSD_ACTIVE].button_hover_border_color);
|
parse_color(value, theme->window[SSD_ACTIVE].button_hover_border_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* botton hover overlay */
|
/* botton hover overlay */
|
||||||
if (match_glob(key, "window.button.hover.bg.color")) {
|
if (match_glob(key, "window.button.hover.bg.color")) {
|
||||||
parse_color(value, theme->window_button_hover_bg_color);
|
parse_color(value, theme->window_button_hover_bg_color);
|
||||||
|
|
@ -1142,10 +1151,10 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
theme->menu_border_type = parse_border_type(value);
|
theme->menu_border_type = parse_border_type(value);
|
||||||
}
|
}
|
||||||
if (match_glob(key, "menu.bg.bevel-width")) {
|
if (match_glob(key, "menu.bg.bevel-width")) {
|
||||||
theme->menu_bevel_width = get_int_if_positive(value, "menu.bg.bevel-width");
|
theme->menu_bevel_width =
|
||||||
|
get_int_if_positive(value, "menu.bg.bevel-width");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (match_glob(key, "menu.items.padding.x")) {
|
if (match_glob(key, "menu.items.padding.x")) {
|
||||||
theme->menu_items_padding_x = get_int_if_positive(
|
theme->menu_items_padding_x = get_int_if_positive(
|
||||||
value, "menu.items.padding.x");
|
value, "menu.items.padding.x");
|
||||||
|
|
@ -1161,7 +1170,8 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
theme->menu_items_border_type = parse_border_type(value);
|
theme->menu_items_border_type = parse_border_type(value);
|
||||||
}
|
}
|
||||||
if (match_glob(key, "menu.items.bg.bevel-width")) {
|
if (match_glob(key, "menu.items.bg.bevel-width")) {
|
||||||
theme->menu_items_bevel_width = get_int_if_positive(value, "menu.items.bg.bevel-width");
|
theme->menu_items_bevel_width =
|
||||||
|
get_int_if_positive(value, "menu.items.bg.bevel-width");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match_glob(key, "menu.items.text.color")) {
|
if (match_glob(key, "menu.items.text.color")) {
|
||||||
|
|
@ -1178,10 +1188,10 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
theme->menu_items_active_border_type = parse_border_type(value);
|
theme->menu_items_active_border_type = parse_border_type(value);
|
||||||
}
|
}
|
||||||
if (match_glob(key, "menu.items.active.bg.bevel-width")) {
|
if (match_glob(key, "menu.items.active.bg.bevel-width")) {
|
||||||
theme->menu_items_active_bevel_width = get_int_if_positive(value, "menu.items.active.bg.bevel-width");
|
theme->menu_items_active_bevel_width =
|
||||||
|
get_int_if_positive(value, "menu.items.active.bg.bevel-width");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (match_glob(key, "menu.separator.width")) {
|
if (match_glob(key, "menu.separator.width")) {
|
||||||
theme->menu_separator_line_thickness = get_int_if_positive(
|
theme->menu_separator_line_thickness = get_int_if_positive(
|
||||||
value, "menu.separator.width");
|
value, "menu.separator.width");
|
||||||
|
|
@ -1212,10 +1222,10 @@ entry(struct theme *theme, const char *key, const char *value)
|
||||||
theme->menu_title_border_type = parse_border_type(value);
|
theme->menu_title_border_type = parse_border_type(value);
|
||||||
}
|
}
|
||||||
if (match_glob(key, "menu.title.bg.bevel-width")) {
|
if (match_glob(key, "menu.title.bg.bevel-width")) {
|
||||||
theme->menu_title_bevel_width = get_int_if_positive(value, "menu.title.bg.bevel-width");
|
theme->menu_title_bevel_width =
|
||||||
|
get_int_if_positive(value, "menu.title.bg.bevel-width");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (match_glob(key, "osd.bg.color")) {
|
if (match_glob(key, "osd.bg.color")) {
|
||||||
parse_color(value, theme->osd_bg_color);
|
parse_color(value, theme->osd_bg_color);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,8 +110,12 @@ _osd_update(void)
|
||||||
float b = theme->osd_border_color[2];
|
float b = theme->osd_border_color[2];
|
||||||
float a = theme->osd_border_color[3];
|
float a = theme->osd_border_color[3];
|
||||||
|
|
||||||
uint32_t colour32 = (uint32_t)(a*255) << 24 | (uint32_t)(r*255) << 16 | (uint32_t)(g*255) << 8 | (uint32_t)(b*255);
|
uint32_t colour32 = (uint32_t)(a*255) << 24 |
|
||||||
struct borderset * renderedborders = getBorders(colour32, bw, theme->osd_border_type, theme->osd_border_bevel_width);
|
(uint32_t)(r*255) << 16 |
|
||||||
|
(uint32_t)(g*255) << 8 |
|
||||||
|
(uint32_t)(b*255);
|
||||||
|
struct borderset *renderedborders = getBorders(colour32, bw,
|
||||||
|
theme->osd_border_type, theme->osd_border_bevel_width);
|
||||||
|
|
||||||
cairo_set_source_surface(cairo, renderedborders->top->surface, 0, 0);
|
cairo_set_source_surface(cairo, renderedborders->top->surface, 0, 0);
|
||||||
cairo_pattern_set_extend(cairo_get_source(cairo), CAIRO_EXTEND_REPEAT);
|
cairo_pattern_set_extend(cairo_get_source(cairo), CAIRO_EXTEND_REPEAT);
|
||||||
|
|
@ -123,21 +127,16 @@ _osd_update(void)
|
||||||
cairo_rectangle(cairo, bw, height-bw, width-bw*2, bw);
|
cairo_rectangle(cairo, bw, height-bw, width-bw*2, bw);
|
||||||
cairo_fill(cairo);
|
cairo_fill(cairo);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cairo_set_source_surface(cairo, renderedborders->left->surface, 0, 0);
|
cairo_set_source_surface(cairo, renderedborders->left->surface, 0, 0);
|
||||||
cairo_pattern_set_extend(cairo_get_source(cairo), CAIRO_EXTEND_REPEAT);
|
cairo_pattern_set_extend(cairo_get_source(cairo), CAIRO_EXTEND_REPEAT);
|
||||||
cairo_rectangle(cairo, 0, bw, bw, height-bw*2);
|
cairo_rectangle(cairo, 0, bw, bw, height-bw*2);
|
||||||
cairo_fill(cairo);
|
cairo_fill(cairo);
|
||||||
|
|
||||||
|
|
||||||
cairo_set_source_surface(cairo, renderedborders->right->surface, 0, 0);
|
cairo_set_source_surface(cairo, renderedborders->right->surface, 0, 0);
|
||||||
cairo_pattern_set_extend(cairo_get_source(cairo), CAIRO_EXTEND_REPEAT);
|
cairo_pattern_set_extend(cairo_get_source(cairo), CAIRO_EXTEND_REPEAT);
|
||||||
cairo_rectangle(cairo, width-bw, bw, bw, height-bw*2);
|
cairo_rectangle(cairo, width-bw, bw, bw, height-bw*2);
|
||||||
cairo_fill(cairo);
|
cairo_fill(cairo);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
cairo_set_source_surface(cairo, renderedborders->tl->surface, 0, 0);
|
cairo_set_source_surface(cairo, renderedborders->tl->surface, 0, 0);
|
||||||
cairo_rectangle(cairo, 0, 0, bw, bw);
|
cairo_rectangle(cairo, 0, 0, bw, bw);
|
||||||
cairo_fill(cairo);
|
cairo_fill(cairo);
|
||||||
|
|
@ -146,15 +145,16 @@ _osd_update(void)
|
||||||
cairo_rectangle(cairo, width - bw, 0, bw, bw);
|
cairo_rectangle(cairo, width - bw, 0, bw, bw);
|
||||||
cairo_fill(cairo);
|
cairo_fill(cairo);
|
||||||
|
|
||||||
cairo_set_source_surface(cairo, renderedborders->bl->surface, 0, height - bw);
|
cairo_set_source_surface(cairo, renderedborders->bl->surface,
|
||||||
|
0, height - bw);
|
||||||
cairo_rectangle(cairo, 0, height - bw, bw, bw);
|
cairo_rectangle(cairo, 0, height - bw, bw, bw);
|
||||||
cairo_fill(cairo);
|
cairo_fill(cairo);
|
||||||
|
|
||||||
cairo_set_source_surface(cairo, renderedborders->br->surface, width - bw, height -bw);
|
cairo_set_source_surface(cairo, renderedborders->br->surface,
|
||||||
|
width - bw, height -bw);
|
||||||
cairo_rectangle(cairo, width - bw, height - bw, bw, bw);
|
cairo_rectangle(cairo, width - bw, height - bw, bw, bw);
|
||||||
cairo_fill(cairo);
|
cairo_fill(cairo);
|
||||||
|
|
||||||
|
|
||||||
set_cairo_color(cairo, theme->osd_border_color);
|
set_cairo_color(cairo, theme->osd_border_color);
|
||||||
} else {
|
} else {
|
||||||
set_cairo_color(cairo, theme->osd_border_color);
|
set_cairo_color(cairo, theme->osd_border_color);
|
||||||
|
|
@ -165,7 +165,6 @@ _osd_update(void)
|
||||||
draw_cairo_border(cairo, border_fbox, theme->osd_border_width);
|
draw_cairo_border(cairo, border_fbox, theme->osd_border_width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Boxes */
|
/* Boxes */
|
||||||
uint16_t x;
|
uint16_t x;
|
||||||
if (!hide_boxes) {
|
if (!hide_boxes) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue